Package ca.carleton.gcrc.couch.export

Examples of ca.carleton.gcrc.couch.export.SchemaExportInfo


       && docFilter.accepts(doc) ) {
        JSONObject jsonDoc = doc.getJSONObject();
       
        String schemaName = jsonDoc.optString("nunaliit_schema");
        if( null != schemaName ) {
          SchemaExportInfo exportInfo = schemaCache.getExportInfo(schemaName);
          if( null != exportInfo ){
            jsonWriter.object();
           
            jsonWriter.key("type");
            jsonWriter.value("Feature");

            jsonWriter.key("id");
            jsonWriter.value(doc.getId());
           
            jsonWriter.key("properties");
            jsonWriter.object();
           
            for(SchemaExportProperty exportProperty : exportInfo.getProperties()){
              Object value = exportProperty.select(jsonDoc);
              if( null != value ) {
                jsonWriter.key(exportProperty.getLabel());
                jsonWriter.value(value);
              }
View Full Code Here


  public SchemaExportInfo getExportInfo(String schemaName) throws Exception {
    if( exportInfoFromSchemaName.containsKey(schemaName) ){
      return exportInfoFromSchemaName.get(schemaName);
    }
   
    SchemaExportInfo exportInfo = null;
    try {
      Document doc = getSchema(schemaName);
      if( null != doc ) {
        JSONArray jsonExport = doc.getJSONObject().optJSONArray("export");
        if( null != jsonExport ) {
View Full Code Here

        JSONObject jsonDoc = doc.getJSONObject();
       
        String schemaName = jsonDoc.optString("nunaliit_schema");
        if( null != schemaName ) {
          boolean containsGeometry = JSONSupport.containsKey(jsonDoc, "nunaliit_geom");
          SchemaExportInfo exportInfo = schemaCache.getExportInfo(schemaName);
         
          if( null != exportInfo || containsGeometry ){
            jsonWriter.object();
           
            jsonWriter.key("type");
            jsonWriter.value("Feature");

            jsonWriter.key("id");
            jsonWriter.value(doc.getId());
           
            jsonWriter.key("properties");
            jsonWriter.object();
           
            if( null != exportInfo ){
              for(SchemaExportProperty exportProperty : exportInfo.getProperties()){
                Object value = exportProperty.select(jsonDoc);
                if( null != value ) {
                  jsonWriter.key(exportProperty.getLabel());
                  jsonWriter.value(value);
                }
View Full Code Here

  public SchemaExportInfo getExportInfo(String schemaName) throws Exception {
    if( exportInfoFromSchemaName.containsKey(schemaName) ){
      return exportInfoFromSchemaName.get(schemaName);
    }
   
    SchemaExportInfo exportInfo = null;
    try {
      Document doc = getSchema(schemaName);
      if( null != doc ) {
        JSONArray jsonExport = doc.getJSONObject().optJSONArray("export");
        if( null != jsonExport ) {
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.export.SchemaExportInfo

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.