Package org.culturegraph.registry.mongo

Examples of org.culturegraph.registry.mongo.MongoDao


    mappings.put("502 $o", "xbib://identifierUniversityScript");
   
    //mappings.put("022 $a", "dc:identifier");
    //mappings.put("027 $a", "dc:identifier");     
    //mappings.put("245 $a", "title");
    MongoDao dao = MongoDao.Factory.newTestMongoDao();
    marcImporter.setPropertyRecordDao(dao);
    marcImporter.setPrimaryIdTemplate("urn:nbn:de:eki:cg$ID");
    marcImporter.importMarcXmlFromFile(new File("test/input/A2010titmrc_1.xml"));

  }
View Full Code Here


public class MongoDaoTest extends TestCase{
 
  private final static Logger logger = Logger.getLogger(MongoDaoTest.class);

  public void testSearch() throws UnknownHostException, MongoException {
    MongoDao dao = MongoDao.Factory.newTestMongoDao();
    Collection<PropertyRecord> result = dao.find("_id", "urn:nbn:de:eki:cg010018727");
    logger.info("" + result.size());
   
    Iterator<PropertyRecord> it = result.iterator();
    while(it.hasNext()){
      logger.info(it.next().getLastModified());
View Full Code Here

      logger.info(it.next().getLastModified());
    }
  }
 
  public void testFindDublicates() throws UnknownHostException, MongoException {
    MongoDao dao = MongoDao.Factory.newTestMongoDao();
    PropertyRecord propertyRecord = new PropertyRecord();
    propertyRecord.add(new Property<Object>("ID2", "010014454"));

    Collection<PropertyRecord> result = dao.findDublicates(propertyRecord);
    logger.info("" + result.size());
  }
View Full Code Here

   *
   * @throws UnknownHostException
   * @throws MongoException
   */
  public void testCollectionViaCursor() throws UnknownHostException, MongoException {
    MongoDao dao = MongoDao.Factory.newTestMongoDao();
   
    DBCollection col = dao.getDbCollection();
   
    DBCursor cur = col.find();

        while(cur.hasNext()) {
            System.out.println(cur.next());
View Full Code Here

  }
 
 

  public void testCollectionViaFindOne() throws UnknownHostException, MongoException {
    MongoDao dao = MongoDao.Factory.newTestMongoDao();
   
    DBCollection col = dao.getDbCollection();
   
    DBObject myDoc = col.findOne();
    logger.info("first object: "+myDoc);
    logger.info("counted objects: "+col.getCount());
View Full Code Here

TOP

Related Classes of org.culturegraph.registry.mongo.MongoDao

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.