[mapguide-internals] Default values for InsertionPointX

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Wed May 13 17:01:56 EDT 2009


Ok, I have now updated Maestro to allow using non-numeric values.
I added a warning to help people trying to set the Y value to an expression.

Regards, Kenneth Skovhede, GEOGRAF A/S



Walt Welton-Lair skrev:
> Good grief...  InsertionPointY should also be a string so that it can support expressions.  The data model (MdfModel) correctly exposes them both as strings, and the stylization code allows both to be expressions.
>
> It looks like no one has ever set InsertionPointY to an expression such as a column name - the resulting LayerDefinition XML would probably fail schema validation.
>
> This should be fixed, but I suspect this will require us to bump the schema version.  For now in your code, do the same as the MG server and assume both are strings.  That way when we finally fix the problem your code will require fewer (if any) changes.
>
> I'll create a ticket for this.
>
> Thanks,
> Walt
>
> -----Original Message-----
> From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Kenneth Skovhede, GEOGRAF A/S
> Sent: Wednesday, May 13, 2009 3:59 PM
> To: MapGuide Internals Mail List
> Subject: Re: [mapguide-internals] Default values for InsertionPointX
>
> Thanks Walt.
>
> I have updated Maestro to use the default values.
>
> I have created a new ticket for the issue, and attached a patch for 
> LayerDefinition-1.2.0.
> http://trac.osgeo.org/mapguide/ticket/984
>
> I also belive that this update is a documentation issue, and as such 
> should not produce ill effects.
>
> However, I noticed that InsertionPointX is a string and InsertionPointY 
> is a double.
> If they are actually both doubles, I guess that there is something in a 
> parse/serializer somewhere that has trouble assigning null to a double,
> so it was decided to make it a string? Or is it because it could also be 
> a column name (so the Y is the faulty one)?
>
> If both can only be doubles, I belive that it is an error to adjust an 
> xsd schema to fit a parser/serializer,
> but changing that will likely require a lot of work, and definately an RFC.
> The benefit from changing it will likely be mostly asthetic, so should I 
> just forget about it?
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> Walt Welton-Lair skrev:
>   
>> Hi Kenneth,
>>
>> MapGuide's XML serialization code for this element assumes default values of 0.5.  So, yes, the schema should be updated to indicate this is the default value.
>>
>> In general, our schemas should specify default values for all optional elements that are basic types.  For example in that same SymbolType element we should specify a default value of true for MaintainAspect, and 0.0 for Rotation.  There are lots of other elements that are missing this information.
>>
>> Normally we need an RFC for a schema change, but to me this isn't really that kind of a change.  We're just clarifying how the existing schema should be interpreted.  For now go ahead and update Maestro to assume 0.5 defaults.  I think as a separate step we need to go through the whole schema and add the missing default value attributes.
>>
>> *** Does anyone disagree and feel an RFC is needed? ***
>>
>> I generally have maintained the XML serialization code, ensuring that it adheres to the schema, and correctly handles versioning.  So I don't mind doing the schema edits, but it will take a week or so before I can get to it.  How about after fixing the Maestro code you can assign the ticket to me, and add a comment indicating what still needs to be done.
>>
>> Thanks,
>> Walt
>>
>>
>> -----Original Message-----
>> From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Kenneth Skovhede, GEOGRAF A/S
>> Sent: Wednesday, May 13, 2009 3:31 AM
>> To: MapGuide Internals Mail List
>> Subject: [mapguide-internals] Default values for InsertionPointX
>>
>> I'm trying to fix issue #918:
>> http://trac.osgeo.org/mapguide/ticket/918
>>
>> The ticket seems to indicate that 0.5 is the default value.
>> The xml fragment looks like this:
>>
>>       <xs:element name="InsertionPointX" type="xs:string" minOccurs="0">
>>         <xs:annotation>
>>           <xs:documentation>X offset for the symbol specified in symbol 
>> space.  Does not apply to labels.</xs:documentation>
>>         </xs:annotation>
>>       </xs:element>
>>       <xs:element name="InsertionPointY" type="xs:double" minOccurs="0">
>>         <xs:annotation>
>>           <xs:documentation>Y offset for the symbol specified in symbol 
>> space.  Does not apply to labels.</xs:documentation>
>>         </xs:annotation>
>>       </xs:element>
>>
>> If the InsertionPoint values are omitted, does MapGuide assume 0.5 or 0.0 ?
>> If it assumes 0.5 should the xsd be updated to indicate this?
>>
>>   
>>     
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
>   


More information about the mapguide-internals mailing list