Add column to Map Location Details

Help
Don Sesler
2012-01-16
2013-06-12
  • Don Sesler
    Don Sesler
    2012-01-16

    Sorry, real newbie question.

    I have been reading through the documentation but cannot work out how to add the altitude column to the location details listed when a map is generated under the mapping section.  I looked through reports.xml but if it is there I missed it.

    Can somebody help me out?

    Thanks,
    Don

     

  • Anonymous
    2012-09-04

    I worked out a sort of tutorial to add new fields to the database.

    Example: To add a LONG field named newField to the Device table.

    1. Add the field details and Info in the desired table file. Ex (src/org/opengts/db/tables/Device.java):

    // Accounting fields
    public static final String FLD_newField = "newField"; // New field to be created
    public static final DBField NewFieldInfo = {
    new DBField(FLD_newField , Long.TYPE , DBField.TYPE_UINT32 , "New Field in Device" , "edit=2"),
    };

    2. Create the methods to access the fields, in the same file. Ex (/src/org/opengts/db/tables/Device.java):

    // --

    public long getNewField()
    {

    }

    public void setNewField(long v)
    {

    }

    // Add whatever other methods you may need…

    // --

    3. Add an entry in the /src/org/opengts/StartupInit.java file in the corresponding selectFields method entry.
    It should look like:

    // startupInit.Device.NewFieldInfo=true
    addDBFields(tblName, fields, "startupInit.Device.NewFieldInfo" , true , Device.NewFieldInfo);

    4. Add an entry in the common.java file like

    startupInit.Device.NewFieldInfo=true

    5. The run the following command from the OpenGTS base directory to create the new fieds:

    bin/dbAdmin.pl -tables=ca

    And verify that they have been created using the following command:

    bin/dbAdmin.pl -tables

    6. Have lots of fun!!!

     

  • Anonymous
    2012-09-04

    The above information was originally posted a while back by the devs.  Just re-posted for completeness