[Branch ~dhis2-devs-core/dhis2/trunk] Rev 821: (GIS)

revision-diff.txt (12.9 KB)


revno: 821

committer: Jan Henrik Overland janhenrik.overland@gmail.com

branch nick: trunk

timestamp: Tue 2009-10-06 02:48:07 +0200

message:

(GIS)

modified:

dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java

dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java

dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapOrganisationUnitRelationByFeatureIdAction.java

dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js

dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js

dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js

dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js

dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/ProportionalSymbol.js

lp:dhis2

https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.

To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.

=== modified file ‘dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java’

— dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java 2009-09-29 16:17:58 +0000

+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java 2009-10-06 00:48:07 +0000

@@ -257,7 +257,7 @@

  */

 MapOrganisationUnitRelation getMapOrganisationUnitRelation( Map map, OrganisationUnit organisationUnit );
  • MapOrganisationUnitRelation getMapOrganisationUnitRelationByFeatureId( String featureId );
  • MapOrganisationUnitRelation getMapOrganisationUnitRelationByFeatureId( String featureId, String mapLayerPath );

    /**

    • Returns a Collection of MapOrganisationUnitRelations.

=== modified file ‘dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java’

— dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java 2009-09-29 16:17:58 +0000

+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java 2009-10-06 00:48:07 +0000

@@ -408,9 +408,11 @@

     return mappingStore.getMapOrganisationUnitRelation( map, organisationUnit );

 }
  • public MapOrganisationUnitRelation getMapOrganisationUnitRelationByFeatureId( String featureId )
  • public MapOrganisationUnitRelation getMapOrganisationUnitRelationByFeatureId( String featureId, String mapLayerPath )

    {

  •    Collection<MapOrganisationUnitRelation> relations = mappingStore.getAllMapOrganisationUnitRelations();
    
  •    Map map = mappingStore.getMapByMapLayerPath( mapLayerPath );
    
  •    Collection<MapOrganisationUnitRelation> relations = mappingStore.getMapOrganisationUnitRelationsByMap( map );
    
    
    
       for ( MapOrganisationUnitRelation relation : relations )
    
       {
    

=== modified file ‘dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapOrganisationUnitRelationByFeatureIdAction.java’

— dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapOrganisationUnitRelationByFeatureIdAction.java 2009-09-22 00:35:09 +0000

+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetMapOrganisationUnitRelationByFeatureIdAction.java 2009-10-06 00:48:07 +0000

@@ -30,6 +30,13 @@

     this.featureId = featureId;

 }
  • private String mapLayerPath;

  • public void setMapLayerPath( String mapLayerPath )

  • {

  •    this.mapLayerPath = mapLayerPath;
    
  • }

 // -------------------------------------------------------------------------

 // Output

 // -------------------------------------------------------------------------

@@ -48,7 +55,7 @@

 public String execute()

     throws Exception

 {
  •    object = mappingService.getMapOrganisationUnitRelationByFeatureId( featureId );
    
  •    object = mappingService.getMapOrganisationUnitRelationByFeatureId( featureId, mapLayerPath );
    
    
    
       return SUCCESS;
    

    }

=== modified file ‘dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js’

— dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js 2009-10-02 13:47:51 +0000

+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/config.js 2009-10-06 00:48:07 +0000

@@ -51,6 +51,9 @@

    AA_MED = 'font-family:myriad pro,frutiger,arial; font-weight:bold; font-size:12px; color:#444; letter-spacing:1px;';

    AA_LIGHT = 'font-family:myriad pro,frutiger,arial; font-weight:bold; font-size:12px; color:#888; letter-spacing:1px;';

    LABEL = 'padding-bottom:2px; padding-left:3px;';
  •   ASSIGNED_ROW_COLOR = '#b1ffa1';
    
  •   UNASSIGNED_ROW_COLOR = '#ffffff';
    

// Ext.message

=== modified file ‘dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js’

— dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2009-10-05 13:55:43 +0000

+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2009-10-06 00:48:07 +0000

@@ -1109,7 +1109,7 @@

     var wmsPreviewWindow = new Ext.Window({

         title: '<font style="' + AA_DARK + '">Preview: ' + record.get("title") + '</font>',

         width: screen.width * 0.5,
  •        height: screen.height * 0.5,
    
  •        height: screen.height * 0.3,
    
           layout: 'fit',
    
           items: [{
    
               xtype: 'gx_mappanel',
    

@@ -1125,7 +1125,7 @@

            title: '<font style="' + AA_DARK + '">Geoserver shapefiles</font>',

            closeAction: 'hide',

            width: wmsGrid.width,
  •           height: wmsGrid.height,
    
  •           height: screen.height * 0.4,
    
              items: [wmsGrid],
    
              bbar: new Ext.StatusBar({
    
                      id: 'wmswindow_sb',
    

@@ -1900,7 +1900,7 @@

            title: '<font style="' + AA_DARK + '">Geoserver shapefiles</font>',

            closeAction: 'hide',

            width: wmsOverlayGrid.width,
  •           height: wmsOverlayGrid.height,
    
  •           height: screen.height * 0.4,
    
              items: [wmsOverlayGrid],
    
              bbar: new Ext.StatusBar({
    
                      id: 'wmsoverlaywindow_sb',
    

@@ -2593,8 +2593,8 @@

             }

         }

     }
  • });

  • });

 mapping.hide();

 shapefilePanel.hide();

 mapLayerPanel.hide();

@@ -2906,11 +2906,12 @@

     }



     var featureId = feature.attributes[MAPDATA.nameColumn];
  •           var mlp = Ext.getCmp('maps_cb').getValue();
    
    
    
              Ext.Ajax.request({
    
                      url: path + 'getMapOrganisationUnitRelationByFeatureId' + type,
    
           method: 'POST',
    
  •                   params: {featureId:featureId},
    
  •                   params: {featureId:featureId, mapLayerPath:mlp},
    
    
    
                      success: function( responseObject ) {
    
                              var mour = Ext.util.JSON.decode( responseObject.responseText ).mapOrganisationUnitRelation[0];
    

@@ -2927,7 +2928,7 @@

                                            params: { mapLayerPath: MAPDATA.mapLayerPath, organisationUnitId: organisationUnitId, featureId: featureId },



                                            success: function( responseObject ) {
  •                                                   Ext.messageBlack.msg('Assign organisation units', msg_highlight_start + organisationUnit + msg_highlight_end + ' (database) assigned to ' + msg_highlight_start + featureId + msg_highlight_end + ' (geojson).');
    
  •                                                   Ext.messageBlack.msg('Assign organisation units', msg_highlight_start + organisationUnit + msg_highlight_end + ' (database) assigned to ' + msg_highlight_start + featureId + msg_highlight_end + ' (map).');
    
    
    
                                                      Ext.getCmp('grid_gp').getStore().reload();
    
                                                      popup_feature.hide();
    
                                                      loadMapData('assignment');
    

@@ -3108,19 +3109,35 @@

 var relations = Ext.util.JSON.decode(responseText).mapOrganisationUnitRelations;
  • var nameColumn = MAPDATA.nameColumn;

  • for (var i = 0; i < features.length; i++) {

  • var nameColumn = MAPDATA.nameColumn;

  •   var noCls = 1;
    
  •   var noAssigned = 0;
    
  •   for (var i = 0; i < features.length; i++) {
    
       features[i].attributes['value'] = 0;
    
    
    
       for (var j=0; j < relations.length; j++) {
    
           if (relations[j].featureId == features[i].attributes[nameColumn]) {
    
               features[i].attributes['value'] = 1;
    
  •                           noAssigned++;
    
  •                           if (noCls < 2) {
    
  •                                   noCls = 2;
    
  •                           }
    
                              break;
    
           }
    
       }
    

    }

  •   var color = UNASSIGNED_ROW_COLOR;
    
  •   if (noCls > 1) {
    
  •           if (noAssigned == features.length) {
    
  •                   noCls = 1;
    
  •                   color = ASSIGNED_ROW_COLOR;
    
  •           }
    
  •   }
    
 var options = {};



 /*hidden*/

@@ -3129,13 +3146,13 @@

 options.indicator = mapping.indicator;



 options.method = 1;
  • options.numClasses = 2;
  • options.numClasses = noCls;

    var colorA = new mapfish.ColorRgb();

  • colorA.setFromHex(‘#FFFFFF’);
  • colorA.setFromHex(color);

    var colorB = new mapfish.ColorRgb();

  • colorB.setFromHex(‘#b1ffa1’);

  • options.colors = [colorA, colorB];

  • colorB.setFromHex(ASSIGNED_ROW_COLOR);

  • options.colors = [colorA, colorB];

    mapping.coreComp.updateOptions(options);

    mapping.coreComp.applyClassification();

=== modified file ‘dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js’

— dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js 2009-09-21 17:41:44 +0000

+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat.js 2009-10-06 00:48:07 +0000

@@ -362,7 +362,15 @@

  *   nBins - {Integer} Total number of bins

  */

 defaultLabelGenerator: function(bin, binIndex, nbBins) {
  •    return parseFloat(bin.lowerBound).toFixed(1) + ' - ' + parseFloat(bin.upperBound).toFixed(1) + '&nbsp;&nbsp; ( ' + bin.nbVal + ' )';
    
  •           if (ACTIVEPANEL == 'mapping') {
    
  •                   if (bin.upperBound < 1) {
    
  •                           return 'Available' + '&nbsp;&nbsp; ( ' + bin.nbVal + ' )';
    
  •                   }
    
  •                   else {
    
  •                           return 'Assigned' + '&nbsp;&nbsp; ( ' + bin.nbVal + ' )';
    
  •                   }
    
  •           }
    
  •    // return parseFloat(bin.lowerBound).toFixed(1) + ' - ' + parseFloat(bin.upperBound).toFixed(1) + '&nbsp;&nbsp; ( ' + bin.nbVal + ' )';
    

    },

    classifyWithBounds: function(bounds) {

=== modified file ‘dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js’

— dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2009-10-05 13:55:43 +0000

+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2009-10-06 00:48:07 +0000

@@ -394,6 +394,7 @@

  */

 classify: function(exception) {

     if (!this.ready) {

+alert(2);

         Ext.MessageBox.alert('Error', 'Component init not complete');

         return;

     }

=== modified file ‘dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/ProportionalSymbol.js’

— dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/ProportionalSymbol.js 2009-06-02 17:10:54 +0000

+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/ProportionalSymbol.js 2009-10-06 00:48:07 +0000

@@ -1,4 +1,4 @@

  • /*

+/*

  • Copyright (C) 2007-2008 Camptocamp

  • This file is part of MapFish Client

@@ -130,30 +130,6 @@

  */

 initComponent : function() {

     this.items = [{
  •        xtype: 'combo',
    
  •        fieldLabel: 'Indicator',
    
  •        typeAhead: true,
    
  •        name: 'indicator',
    
  •        editable: false,
    
  •        valueField: 'value',
    
  •        displayField: 'text',
    
  •        mode: 'local',
    
  •        emptyText: 'Select indicator',
    
  •        selectOnFocus: true,
    
  •        triggerAction: 'all',
    
  •        store: new Ext.data.SimpleStore({
    
  •            fields: ['value', 'text'],
    
  •            data : this.indicators
    
  •        }),
    
  •        listeners: {
    
  • // ‘select’: {

  • // fn: function() {

  • // this.classify(false);

  • // },

  • // scope: this

  • // }

  •        }
    
  •    },{
    
           xtype: 'numberfield',
    
           fieldLabel:'Min Size',
    
           name: 'minSize',
    

@@ -167,21 +143,14 @@

         width: 30,

         value: 20,

         maxValue: 50
  •    },{
    
  •        xtype: 'button',
    
  •        text: 'Submit',
    
  •        handler: function() {
    
  •            this.classify(true);
    
  •        },
    
  •    }];
    
  •    this.buttons = [{
    
  •        text: 'OK',
    
  •        handler: this.classify,
    
           scope: this
    
       }];
    

-// this.buttons = [{

-// text: ‘OK’,

-// handler: this.classify,

-// scope: this

-// }];

     mapfish.widgets.geostat.ProportionalSymbol.superclass.initComponent.apply(this);

 },

@@ -207,8 +176,7 @@

 requestFailure: function(request) {

     OpenLayers.Console.error('Ajax request failed');

 },
 /**

  * Method: classify

  *    Reads the features to get the different value for

@@ -223,16 +191,17 @@

         }

         return;

     }
  •    this.indicator = 'value';
    
  •    this.indicatorText = 'Indicator';
    
  •    if (!this.indicator) {
    
  •        Ext.MessageBox.alert('Error', 'You must choose an indicator');
    
  •        return;
    
  •    }
    
  •    loadMapData('point');
    
  •    this.indicator = 'MARK1';
    
  •    var minSize = parseInt(this.form.findField('minSize').getValue());
    
  •    var maxSize = parseInt(this.form.findField('maxSize').getValue());
    

+alert(minSize + ‘\n’ + maxSize);

  •    this.coreComp.updateOptions({
    
  •        'indicator': this.indicator,
    
  •        'minSize': minSize,
    
  •        'maxSize': maxSize
    
  •    });
    
  •    this.coreComp.applyClassification();
    
  •    this.classificationApplied = true;
    

    },

    /**


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

image

image

image

···

On Tue, Oct 6, 2009 at 2:50 AM, noreply@launchpad.net wrote: