public SchemaCacheCouchDb(CouchDb couchDb) throws Exception { // this.couchDb = couchDb; this.dd = couchDb.getDesignDocument("atlas"); }
static public UserDesignDocumentImpl getUserDesignDocument(CouchDb couchDb) throws Exception { if( false == couchDb.documentExists(DD_ID) ) { throw new Exception("Design document "+DD_ID+" was not found"); } CouchDesignDocument dd = couchDb.getDesignDocument(DD_NAME); return new UserDesignDocumentImpl(dd); }
private void initDate(ServletContext servletContext) throws ServletException { try { DateServletConfiguration config = new DateServletConfiguration(); CouchDb couchDb = couchDd.getDatabase(); config.setCouchDb(couchDb); CouchDesignDocument atlasDesign = couchDb.getDesignDocument("atlas"); config.setAtlasDesignDocument(atlasDesign); servletContext.setAttribute(DateServletConfiguration.CONFIGURATION_KEY, config); } catch(Exception e) { logger.error("Error configuring date service",e); throw new ServletException("Error configuring date service",e); } }
CouchDesignDocument submissionDesign = submissionDb.getDesignDocument("submission");
private void initExport(ServletContext servletContext) throws ServletException { try { ExportConfiguration config = new ExportConfiguration(); CouchDb couchDb = couchDd.getDatabase(); config.setCouchDb(couchDb); CouchDesignDocument atlasDesign = couchDb.getDesignDocument("atlas"); config.setAtlasDesignDocument(atlasDesign); servletContext.setAttribute(ExportConfiguration.CONFIGURATION_KEY, config); } catch(Exception e) { logger.error("Error configuring export service",e); throw new ServletException("Error configuring export service",e); } }
couchDd = documentDatabase.getDesignDocument("server"); } catch (Exception e) { throw new ServletException("Unable to get design document", e);
static public DocumentRetrieval create(CouchDb couchDb, String layerName) throws Exception { CouchDesignDocument dd = couchDb.getDesignDocument("atlas"); CouchQuery query = new CouchQuery(); query.setViewName("geom-layer"); query.setStartKey(layerName); query.setEndKey(layerName); query.setIncludeDocs(false); CouchQueryResults results = dd.performQuery(query); Set<String> ids = new HashSet<String>(); for(JSONObject row : results.getRows()){ String docId = row.optString("id"); if( null != docId ) { ids.add(docId); } } return new DocumentRetrievalLayer(couchDb, ids.iterator()); }
static public DocumentRetrieval create(CouchDb couchDb, String schemaName) throws Exception { CouchDesignDocument dd = couchDb.getDesignDocument("atlas"); CouchQuery query = new CouchQuery(); query.setViewName("nunaliit-schema"); query.setStartKey(schemaName); query.setEndKey(schemaName); query.setIncludeDocs(false); CouchQueryResults results = dd.performQuery(query); Set<String> ids = new HashSet<String>(); for(JSONObject row : results.getRows()){ String docId = row.optString("id"); if( null != docId ) { ids.add(docId); } } return new DocumentRetrievalSchema(couchDb, ids.iterator()); }
CouchDesignDocument designDoc = couchDb.getDesignDocument("atlas"); CouchQuery query = new CouchQuery(); query.setViewName("skeleton-docs");
private void initSubmissionRobot(ServletContext servletContext) throws ServletException { try { // Is submission DB enabled if( null != submissionDb ){ CouchDesignDocument submissionDesign = submissionDb.getDesignDocument("submission"); SubmissionRobotSettings settings = new SubmissionRobotSettings(); settings.setAtlasName(atlasProperties.getAtlasName()); settings.setDocumentDesignDocument(couchDd); settings.setSubmissionDesignDocument(submissionDesign); settings.setUserDb(userDb); settings.setMailNotifier(submissionNotifier); submissionRobot = new SubmissionRobot(settings); submissionRobot.start(); } else { logger.info("Submission database is not enabled"); } } catch (Exception e) { logger.error("Error starting submission worker",e); throw new ServletException("Error starting submission worker",e); } }
AgreementRobotSettings settings = new AgreementRobotSettings(); settings.setAtlasName(atlasName); settings.setDocumentDesignDocument(documentDb.getDesignDocument("atlas")); settings.setUserDb(userDb);
CouchDesignDocument atlasDesign = atlasDb.getDesignDocument("atlas");
CouchDesignDocument submissionDbDesign = submissionDb.getDesignDocument("submission"); uploadWorker.setSubmissionDbDesign(submissionDbDesign);