[mapguide][MG200][Modified] No error checking with map view parameters

Walt Welton-Lair walt.welton-lair at autodesk.com
Fri Apr 7 17:07:44 EDT 2006


You can view the artifact detail at the following URL:

    https://mapguide.osgeo.org/servlets/Scarab/id/MG200

Type:
Defect

Artifact ID:
MG200 (No error checking with map view parameters)

Modified by:
Walt Welton-Lair
waltweltonlair (walt.welton-lair at autodesk.com)

The following modifications were made to this artifact:
---------------------------------------------------------------------

-- Developer Notes set to new value:
Old value:
Here's a sumary of changes I made:

1/ Updated the MgMap constructor to set more reasonable defaults for the scale, width, height, and dpi.  BEfore these were all 0.  Now scale, width, and height are 1, and dpi is 72.

2/ The MgController class now validates any map view parameters that are supplied.  It verifies that the scale, width, height, and dpi are greater than zero.

3/ Map view command are supplied via HTTP requests, and the MgController class raises InvalidArgumentExceptions when a bad command is encountered.  The displayed error message looked like:

New value:
Here's a sumary of changes I made:

1/ Updated the MgMap constructor to set more valid defaults for the scale, width, height, and dpi.  Before these were all 0.  Now scale, width, and height are 1, and dpi is 96.

2/ The MgController class now validates any map view parameters that are supplied.  It verifies that the scale, width, height, and dpi are greater than zero.

3/ Map view command are supplied via HTTP requests, and the MgController class raises InvalidArgumentExceptions when a bad command is encountered.  The displayed error message used to look like:

Invalid argument(s): [2] = "0" The value cannot be less than or equal to zero.

The [2] refers to the second argument passed to the ApplyMapViewCommands method.  I changed this to instead display the parameter name in the brackets:

Invalid argument(s): [SETDISPLAYDPI] = "0" The value cannot be less than or equal to zero.

While this isn't the traditional way we use MgInvalidArgumentException it's fine in this case since the arguments are the parameters supplied with the HTTP request.




---------------------------------------------------------------------
This message was automatically generated by Project Tracker.








More information about the Mapguide_issues mailing list