Examples of CouchDesignDocument


Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

      servletContext.setAttribute(SubmissionServlet.ConfigAttributeName_UserDb, userDb);
      servletContext.setAttribute(SubmissionServlet.ConfigAttributeName_DocumentDesign, couchDd);

      // Is submission DB enabled?
      if( null != submissionDb ){
        CouchDesignDocument submissionDesign = submissionDb.getDesignDocument("submission");

        servletContext.setAttribute(SubmissionServlet.ConfigAttributeName_SubmissionDesign, submissionDesign);
      }

    } catch (Exception e) {
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

    if( atlasInfo.isRestricted() ){
      roles.add(atlasInfo.getAtlasName() + "_user");
    }
   
    CouchDb atlasDb = couchClient.getDatabase(atlasInfo.getDatabaseName());
    CouchDesignDocument atlasDesign = atlasDb.getDesignDocument("atlas");

    // Roles from layer definitions
    {
      CouchQuery query = new CouchQuery();
      query.setViewName("layer-definitions");
      CouchQueryResults queryResults = atlasDesign.performQuery(query);
      for(JSONObject row : queryResults.getRows()){
        String layerId = row.getString("key");
        if( false == "public".equals(layerId) ) {
          String layerRole = atlasInfo.getAtlasName() + "_layer_" + layerId;
          roles.add(layerRole);
        }
      }
    }

    // Roles from layers in use
    {
      CouchQuery query = new CouchQuery();
      query.setViewName("layers");
      query.setReduce(true);
      query.setGrouping(true);
      CouchQueryResults queryResults = atlasDesign.performQuery(query);
      for(JSONObject row : queryResults.getRows()){
        String layerId = row.getString("key");
        if( false == "public".equals(layerId) ) {
          String layerRole = atlasInfo.getAtlasName() + "_layer_" + layerId;
          roles.add(layerRole);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

    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);
  }
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

        }
      }
    }
   
    // Nunaliit user design document
    CouchDesignDocument userDesignDocument = null;
    if( null != userDb ){
      try {
        userDesignDocument = userDb.getDesignDocument("nunaliit_user");
      } catch (Exception e) {
        throw new ServletException("Unable to create user design document.",e);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

  private void initExport(ServletContext servletContext) throws ServletException {
   
    try {
      ExportConfiguration config = new ExportConfiguration();
      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);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

import ca.carleton.gcrc.couch.export.DocumentRetrieval;

public class DocumentRetrievalSchema implements DocumentRetrieval {

  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 ) {
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

import ca.carleton.gcrc.couch.export.DocumentRetrieval;

public class DocumentRetrievalLayer implements DocumentRetrieval {

  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 ) {
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

  private void initExport(ServletContext servletContext) throws ServletException {
   
    try {
      ExportConfiguration config = new ExportConfiguration();
      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);
View Full Code Here

Examples of ca.carleton.gcrc.couch.client.CouchDesignDocument

  private void initExport(ServletContext servletContext) throws ServletException {
   
    try {
      ExportConfiguration config = new ExportConfiguration();
      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);
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.