Examples of Exhibit


Examples of edu.mit.simile.backstage.model.Exhibit

        } catch (MalformedURLException e) {
            _logger.error("Failed to construct exhibit identity from request " + request.toString(), e);
            return null;
        }
       
        return new Exhibit(this, exhibitIdentity);
    }
View Full Code Here

Examples of edu.mit.simile.backstage.model.Exhibit

    // ---------------------------------------------------------------------
   
    public Object jsFunction_createExhibit(Object requestO, String refererUrlSHA1, String id) throws MalformedURLException {
        HttpServletRequest request = (HttpServletRequest) unwrap(requestO);
        ExhibitCollection ec = getExhibitCollection(request);
        Exhibit exhibit = getModule().createExhibit(request, refererUrlSHA1);
       
        ec.setExhibit(id, exhibit);
       
        return wrap(exhibit, this);
    }
View Full Code Here

Examples of edu.mit.simile.backstage.model.Exhibit

    }
   
    public Object jsFunction_getExhibit(Object requestO, String id) throws MalformedURLException {
        HttpServletRequest request = (HttpServletRequest) unwrap(requestO);
        ExhibitCollection ec = getExhibitCollection(request);
        Exhibit exhibit = ec.getExhibit(id);
       
        return wrap(exhibit, this);
    }
View Full Code Here

Examples of org.apache.art.Exhibit

*/
public class CayenneDataObjectValidationTest extends CayenneCase {

    public void testValidateForSaveMandatoryToOneMissing() throws Exception {
        DataContext context = createDataContext();
        Exhibit exhibit = context.newObject(Exhibit.class);
        exhibit.setOpeningDate(new Date());
        exhibit.setClosingDate(new Date());

        ValidationResult result = new ValidationResult();
        exhibit.validateForSave(result);

        assertTrue("Validation of 'toGallery' should've failed.", result.hasFailures());
        assertTrue(result.hasFailures(exhibit));

        List failures = result.getFailures();
        assertEquals(1, failures.size());

        BeanValidationFailure failure = (BeanValidationFailure) failures.get(0);
        assertEquals(Exhibit.TO_GALLERY_PROPERTY, failure.getProperty());

        // fix the problem and see if it goes away
        Gallery gallery = context.newObject(Gallery.class);
        exhibit.setToGallery(gallery);
        result = new ValidationResult();
        exhibit.validateForSave(result);
        assertFalse("No failures expected: " + result, result.hasFailures());
    }
View Full Code Here

Examples of org.apache.art.Exhibit

        // first prepare test fixture
        createTestData("testGalleries");
        populateExhibits();

        ObjectId eId = new ObjectId("Exhibit", Exhibit.EXHIBIT_ID_PK_COLUMN, 2);
        Exhibit e = (Exhibit) context.performQuery(new ObjectIdQuery(eId)).get(0);

        assertTrue(e.readPropertyDirectly(Exhibit.TO_GALLERY_PROPERTY) instanceof Fault);

        DataRow snapshot = context.currentSnapshot(e);

        // assert that after taking a snapshot, we have FK in, but the relationship
        // is still a Fault
        assertTrue(e.readPropertyDirectly(Exhibit.TO_GALLERY_PROPERTY) instanceof Fault);
        assertEquals(new Integer(33002), snapshot.get("GALLERY_ID"));
    }
View Full Code Here

Examples of org.apache.art.Exhibit

        populateExhibits();

        List objects = context.performQuery(new SelectQuery(Exhibit.class));
        assertFalse(objects.isEmpty());

        Exhibit e1 = (Exhibit) objects.get(0);
        assertEquals(java.util.Date.class, e1.getClosingDate().getClass());
    }
View Full Code Here

Examples of org.apache.art.Exhibit

        assertTrue(g2.readPropertyDirectly("exhibitArray") instanceof ValueHolder);
        List exhibits = (List) g2.readPropertyDirectly("exhibitArray");
        assertFalse(((ValueHolder) exhibits).isFault());
        assertEquals(1, exhibits.size());

        Exhibit e1 = (Exhibit) exhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, e1.getPersistenceState());

        // this to-many must also be resolved
        assertTrue(e1.readPropertyDirectly("artistExhibitArray") instanceof ValueHolder);
        List aexhibits = (List) e1.readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(1, exhibits.size());

        ArtistExhibit ae1 = (ArtistExhibit) aexhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, ae1.getPersistenceState());
View Full Code Here

Examples of org.apache.art.Exhibit

        assertTrue(g2.readPropertyDirectly("exhibitArray") instanceof ValueHolder);
        List exhibits = (List) g2.readPropertyDirectly("exhibitArray");
        assertFalse(((ValueHolder) exhibits).isFault());
        assertEquals(1, exhibits.size());

        Exhibit e1 = (Exhibit) exhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, e1.getPersistenceState());

        // this to-many must also be resolved
        assertTrue(e1.readPropertyDirectly("artistExhibitArray") instanceof ValueHolder);
        List aexhibits = (List) e1.readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(2, aexhibits.size());

        ArtistExhibit ae1 = (ArtistExhibit) aexhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, ae1.getPersistenceState());
View Full Code Here

Examples of org.apache.art.Exhibit

        assertTrue(g2.readPropertyDirectly("exhibitArray") instanceof ValueHolder);
        List exhibits = (List) g2.readPropertyDirectly("exhibitArray");
        assertFalse(((ValueHolder) exhibits).isFault());
        assertEquals(1, exhibits.size());

        Exhibit e1 = (Exhibit) exhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, e1.getPersistenceState());

        // this to-many must also be resolved
        assertTrue(e1.readPropertyDirectly("artistExhibitArray") instanceof ValueHolder);
        List aexhibits = (List) e1.readPropertyDirectly("artistExhibitArray");
        assertFalse(((ValueHolder) aexhibits).isFault());
        assertEquals(2, aexhibits.size());

        ArtistExhibit ae1 = (ArtistExhibit) aexhibits.get(0);
        assertEquals(PersistenceState.COMMITTED, ae1.getPersistenceState());
View Full Code Here

Examples of org.apache.art.Exhibit

    public void testCascadeToMany() {
        // Artist artistExhibitArray
        Artist anArtist = (Artist) context.newObject("Artist");
        anArtist.setArtistName("A Name");
        Exhibit anExhibit = (Exhibit) context.newObject("Exhibit");
        anExhibit.setClosingDate(new java.sql.Timestamp(System.currentTimeMillis()));
        anExhibit.setOpeningDate(new java.sql.Timestamp(System.currentTimeMillis()));

        // Needs a gallery... required for data integrity
        Gallery gallery = (Gallery) context.newObject("Gallery");
        gallery.setGalleryName("A Name");

        anExhibit.setToGallery(gallery);

        ArtistExhibit artistExhibit = (ArtistExhibit) context.newObject("ArtistExhibit");

        artistExhibit.setToArtist(anArtist);
        artistExhibit.setToExhibit(anExhibit);
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.