From ScottH at mPower-tech.com Wed Jan 3 11:04:42 2007 From: ScottH at mPower-tech.com (Scott Hameister) Date: Wed Jan 3 12:00:48 2007 Subject: [Mapguide_dev] Zooms and Coordinate Systems Message-ID: <000601c72f50$e11dbc60$18d167d1@domain.local> I left a similar post that was unanswered in the Users list. I have a couple Lat/Lon Layers in a map that is projected to UTM16N...When I click on an object(s) and then right click and do a "zoom to Seleceted" it zooms to a Lat Lon area and not to the reprojected objects.. .is this an oversight in MG Open Source code, or am I missing something really simple. ..If it is an oversight has anyone developed code that fixes it.or does anyone have a starting point for me to try it? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070103/195e298b/attachment.html From ScottH at mPower-tech.com Wed Jan 3 11:09:19 2007 From: ScottH at mPower-tech.com (Scott Hameister) Date: Wed Jan 3 12:05:23 2007 Subject: [Mapguide_dev] KML and localhost. Message-ID: <001601c72f51$867b4330$18d167d1@domain.local> I also posted this in the users forum.but no response.. Does the KML Map request work with localhost..I run it and nothing shows up.It just zooms into the US and that's it Here is my Request.. HELLO Here is the resulting KML file contents: TESTER 1 53.99876436.250870 -70.674290-109.114973 STATES http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] COUNTIES http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] LAKES http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] Weather 0 http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070103/7272a2ab/attachment.html From ScottH at mPower-tech.com Wed Jan 3 13:00:50 2007 From: ScottH at mPower-tech.com (Scott Hameister) Date: Wed Jan 3 13:56:57 2007 Subject: [Mapguide_dev] KML and localhost. In-Reply-To: <73BD5EF42E005C47988D1624D128BC7E053845C3@msgusawmb03.ads.autodesk.com> Message-ID: <003701c72f61$1a465aa0$18d167d1@domain.local> Not building from source.using 1.1 Release Candidate on windows..Does that Help at all? _____ From: Chris Claydon [mailto:chris.claydon@autodesk.com] Sent: Wednesday, January 03, 2007 11:57 AM To: Scott Hameister Subject: RE: [Mapguide_dev] KML and localhost. Hi Scott, Can you let me know the platform you're working on, and which version of MapGuide you're using (or if you're building from source code)? In the returned XML, it looks like you have a lot of parameters enclosed in CDATA sections that shouldn't be. So either there's a bug in the code, or you have some files that are out of date. I'd like to try to reproduce this behavior so I can figure out where it's going wrong. Thanks, Chris. _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: January 3, 2007 9:09 AM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] KML and localhost. I also posted this in the users forum.but no response.. Does the KML Map request work with localhost..I run it and nothing shows up.It just zooms into the US and that's it Here is my Request.. HELLO Here is the resulting KML file contents: TESTER 1 53.99876436.250870 -70.674290-109.114973 STATES http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] COUNTIES http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] LAKES http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] Weather 0 http://localhost:80/mapguide/mapagent/mapagent.fcgi?OPERATION=Ge tLayerKmlonStop1BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070103/3fcd8f09/attachment-0001.html From tom.fukushima at autodesk.com Wed Jan 3 16:00:08 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Wed Jan 3 17:00:54 2007 Subject: [Mapguide_dev] RE: [mapguide-dev] MapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Message-ID: Hi Jason, To follow up: We wil incorporate the idea about using extended data for all of the elements. Tom _____ From: Jason Birch [mailto:Jason.Birch@nanaimo.ca] Sent: Thursday, December 21, 2006 2:12 PM To: dev@mapguide.osgeo.org Subject: RE: [mapguide-dev] MapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Yeah, Tom, we know it's all your fault :) [Tom] :) That problem looks like a royal pain. As I understand it, it's forcing us to say that the current structure is Schema-prime, and everything else that is added to the structure is extended? Is this just an interim thing? Will the elements be moved from the extended area into the main area when a new schema version is defined, or are they stuck in there forever? [Tom] The added data/elements are interim. Eventually, when we feel the time is right, the interim data will be moved to a "permanent" spot, that is, a validated area of the schema. So they will not be stuck in the extended area forever. If we are forced to go this way, then it might be better to use extended data for all of the elements rather than allowing arbitrary extensions in some and requiring extensions to be added in a special construct in others? This would make it easier than having to know for each section which strategy to use. [Tom] That sounds good. Jon, do you have any thoughts about this? Is there no way that we can just modify DB-XML to not throw a fatal error for these parsing issues? [Tom] We can turn off validation, but that defeats the purpose of things. The schemas provide a way of detecting errors in the documents before they are published and used. It's like static type checking in the programming world; and the more errors that we can catch up front before running an application the better. What impact does this have on MGPs? Will they be forwards and/or backwards compatible, or will they need to be regenerated at each version increment? [Tom] I'm not 100% sure on this but I believe the MGPs will be backwards compatible. Steve, do you have any more information on this? Jason _____ From: Tom Fukushima [mailto:tom.fukushima@autodesk.com] Sent: Thursday, December 21, 2006 12:58 To: dev@mapguide.osgeo.org Subject: [mapguide-dev] MapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Please review MapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements. Thanks. http://wiki.osgeo.org/index.php/MapGuide_RFC_10_-_Make_Schemas_More_Amen able_to_Interim_Enhancements Sorry for the bad timing on this with the mailing list move and holiday season. Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070103/39355c0a/attachment.html From ScottH at mPower-tech.com Wed Jan 3 18:16:57 2007 From: ScottH at mPower-tech.com (Scott Hameister) Date: Wed Jan 3 19:13:04 2007 Subject: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms In-Reply-To: <032601c72f5f$8919b370$6401a8c0@SPINAJM> Message-ID: <007901c72f8d$438ff2f0$18d167d1@domain.local> I discovered that in mapFrame under the "ZoomSelection" Function that it makes an fcgi call using GETFEATURESETENVELOPE.... ...It's Obvious that GETFEATURESETENVELOPE returns the extents of the features in their layers native coordinate system and not the MAPS projected coordinate system. So if My Map is in State Plan... 1 Layer is in UTM and another layer is in LL84...and I select things from the UTM and LL84 layer I get a really bad extent that is a combo of both... ...The only way to fix it would be to intercept/redirect the "ZoomSelection" function to run some code that iterates through each layer, reprojects the extent of the selection on that layer, and grabs the x and Y's into an array...and then look for Max and Min X and Ys to develop the correct Zoom position. Now I ask Does GETFEATURESETENVELOPE fcgi call have an undocumented way of doing this without having to destroy the web-api code? -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Andy Morsell Sent: Wednesday, January 03, 2007 11:50 AM To: mapguide_users@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I have the same problem with a map in an international foot state plane coordinate system (Oregon, South Zone, NAD83, International feet). The same thing occurs if you are using a custom web layout search command on a layer. The search works (as long as its not on a joined field) but clicking on a result zooms to 0,0 with a scale of 1:0.001. Andy -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Tuesday, January 02, 2007 8:16 AM To: mapguide_users@lists.osgeo.org Subject: [Mapguide_users] Coordinate Systems and Zooms I'm having trouble with Zooms in Authored Maps with Coordinate Systems Assigned...Example I have a Lat/Lon WGS84 map Of states and Counties Projected locally into UTM Zone 16N...I can look at a weblayout...select a county...right click and do a zoom selected and it flys off into nowheresville...It seems to be zooming to the Lat and Lon cords of the county and not the UTM...is this a known bug, and is there a Fix for this? _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users From amorsell at spatialgis.com Thu Jan 4 11:12:51 2007 From: amorsell at spatialgis.com (Andy Morsell) Date: Thu Jan 4 12:10:01 2007 Subject: [Mapguide_dev] PSC Meeting today? Message-ID: <039801c7301b$2fe203e0$6401a8c0@SPINAJM> Project steering committee, Is there an IRC meeting today? I tried to attend the last two and I don't know if the meetings were not happening, or if I was having problems with freenode IRC or ChatZilla. Have there been any recent meetings? Thanks. Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070104/99638f7e/attachment.html From cgountanis at mpower-tech.com Thu Jan 4 09:40:27 2007 From: cgountanis at mpower-tech.com (Chris Gountanis) Date: Thu Jan 4 13:10:21 2007 Subject: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms In-Reply-To: <007901c72f8d$438ff2f0$18d167d1@domain.local> Message-ID: <000601c7300e$465fd730$17d167d1@ChrisGountanis> Is there going to be an update to address this or is that normal operation? Chris -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Wednesday, January 03, 2007 5:17 PM To: 'Andy Morsell'; mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I discovered that in mapFrame under the "ZoomSelection" Function that it makes an fcgi call using GETFEATURESETENVELOPE.... ...It's Obvious that GETFEATURESETENVELOPE returns the extents of the features in their layers native coordinate system and not the MAPS projected coordinate system. So if My Map is in State Plan... 1 Layer is in UTM and another layer is in LL84...and I select things from the UTM and LL84 layer I get a really bad extent that is a combo of both... ...The only way to fix it would be to intercept/redirect the "ZoomSelection" function to run some code that iterates through each layer, reprojects the extent of the selection on that layer, and grabs the x and Y's into an array...and then look for Max and Min X and Ys to develop the correct Zoom position. Now I ask Does GETFEATURESETENVELOPE fcgi call have an undocumented way of doing this without having to destroy the web-api code? -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Andy Morsell Sent: Wednesday, January 03, 2007 11:50 AM To: mapguide_users@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I have the same problem with a map in an international foot state plane coordinate system (Oregon, South Zone, NAD83, International feet). The same thing occurs if you are using a custom web layout search command on a layer. The search works (as long as its not on a joined field) but clicking on a result zooms to 0,0 with a scale of 1:0.001. Andy -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Tuesday, January 02, 2007 8:16 AM To: mapguide_users@lists.osgeo.org Subject: [Mapguide_users] Coordinate Systems and Zooms I'm having trouble with Zooms in Authored Maps with Coordinate Systems Assigned...Example I have a Lat/Lon WGS84 map Of states and Counties Projected locally into UTM Zone 16N...I can look at a weblayout...select a county...right click and do a zoom selected and it flys off into nowheresville...It seems to be zooming to the Lat and Lon cords of the county and not the UTM...is this a known bug, and is there a Fix for this? _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users From trevor.wekel at autodesk.com Thu Jan 4 12:30:30 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Thu Jan 4 13:28:05 2007 Subject: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms Message-ID: Hi Chris, Virtually all of the other HTTP requests return the extents in the map's coordinate system and not the layer's coordinate system. From a consistency perspective I think GETFEATURESETENVELOPE should return the extents in the map's coordinate system. We will need to investigate this further and determine the impact of switching to the map's coordinate system. One noted side effect will be the behaviour of MgSelection::GetExtents. I'm not sure simply switching it over is the right solution. It will break any existing code which was written against the current functionality. Thank you for investigating and finding the root cause. Trevor -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Chris Gountanis Sent: Thursday, January 04, 2007 7:40 AM To: 'Scott Hameister'; 'Andy Morsell'; mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms Is there going to be an update to address this or is that normal operation? Chris -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Wednesday, January 03, 2007 5:17 PM To: 'Andy Morsell'; mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I discovered that in mapFrame under the "ZoomSelection" Function that it makes an fcgi call using GETFEATURESETENVELOPE.... ...It's Obvious that GETFEATURESETENVELOPE returns the extents of the features in their layers native coordinate system and not the MAPS projected coordinate system. So if My Map is in State Plan... 1 Layer is in UTM and another layer is in LL84...and I select things from the UTM and LL84 layer I get a really bad extent that is a combo of both... ...The only way to fix it would be to intercept/redirect the "ZoomSelection" function to run some code that iterates through each layer, reprojects the extent of the selection on that layer, and grabs the x and Y's into an array...and then look for Max and Min X and Ys to develop the correct Zoom position. Now I ask Does GETFEATURESETENVELOPE fcgi call have an undocumented way of doing this without having to destroy the web-api code? -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Andy Morsell Sent: Wednesday, January 03, 2007 11:50 AM To: mapguide_users@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I have the same problem with a map in an international foot state plane coordinate system (Oregon, South Zone, NAD83, International feet). The same thing occurs if you are using a custom web layout search command on a layer. The search works (as long as its not on a joined field) but clicking on a result zooms to 0,0 with a scale of 1:0.001. Andy -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Tuesday, January 02, 2007 8:16 AM To: mapguide_users@lists.osgeo.org Subject: [Mapguide_users] Coordinate Systems and Zooms I'm having trouble with Zooms in Authored Maps with Coordinate Systems Assigned...Example I have a Lat/Lon WGS84 map Of states and Counties Projected locally into UTM Zone 16N...I can look at a weblayout...select a county...right click and do a zoom selected and it flys off into nowheresville...It seems to be zooming to the Lat and Lon cords of the county and not the UTM...is this a known bug, and is there a Fix for this? _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev From trevor.wekel at autodesk.com Thu Jan 4 12:32:15 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Thu Jan 4 13:29:54 2007 Subject: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms Message-ID: Oops! I apologize Scott. Thank you SCOTT for finding the root cause. Trevor -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Trevor Wekel Sent: Thursday, January 04, 2007 10:31 AM To: Chris Gountanis; Scott Hameister; Andy Morsell; mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms Hi Chris, Virtually all of the other HTTP requests return the extents in the map's coordinate system and not the layer's coordinate system. From a consistency perspective I think GETFEATURESETENVELOPE should return the extents in the map's coordinate system. We will need to investigate this further and determine the impact of switching to the map's coordinate system. One noted side effect will be the behaviour of MgSelection::GetExtents. I'm not sure simply switching it over is the right solution. It will break any existing code which was written against the current functionality. Thank you for investigating and finding the root cause. Trevor -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Chris Gountanis Sent: Thursday, January 04, 2007 7:40 AM To: 'Scott Hameister'; 'Andy Morsell'; mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] RE: [Mapguide_users] Coordinate Systems and Zooms Is there going to be an update to address this or is that normal operation? Chris -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Wednesday, January 03, 2007 5:17 PM To: 'Andy Morsell'; mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I discovered that in mapFrame under the "ZoomSelection" Function that it makes an fcgi call using GETFEATURESETENVELOPE.... ...It's Obvious that GETFEATURESETENVELOPE returns the extents of the features in their layers native coordinate system and not the MAPS projected coordinate system. So if My Map is in State Plan... 1 Layer is in UTM and another layer is in LL84...and I select things from the UTM and LL84 layer I get a really bad extent that is a combo of both... ...The only way to fix it would be to intercept/redirect the "ZoomSelection" function to run some code that iterates through each layer, reprojects the extent of the selection on that layer, and grabs the x and Y's into an array...and then look for Max and Min X and Ys to develop the correct Zoom position. Now I ask Does GETFEATURESETENVELOPE fcgi call have an undocumented way of doing this without having to destroy the web-api code? -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Andy Morsell Sent: Wednesday, January 03, 2007 11:50 AM To: mapguide_users@lists.osgeo.org Subject: RE: [Mapguide_users] Coordinate Systems and Zooms I have the same problem with a map in an international foot state plane coordinate system (Oregon, South Zone, NAD83, International feet). The same thing occurs if you are using a custom web layout search command on a layer. The search works (as long as its not on a joined field) but clicking on a result zooms to 0,0 with a scale of 1:0.001. Andy -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Tuesday, January 02, 2007 8:16 AM To: mapguide_users@lists.osgeo.org Subject: [Mapguide_users] Coordinate Systems and Zooms I'm having trouble with Zooms in Authored Maps with Coordinate Systems Assigned...Example I have a Lat/Lon WGS84 map Of states and Counties Projected locally into UTM Zone 16N...I can look at a weblayout...select a county...right click and do a zoom selected and it flys off into nowheresville...It seems to be zooming to the Lat and Lon cords of the county and not the UTM...is this a known bug, and is there a Fix for this? _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev From tom.fukushima at autodesk.com Fri Jan 5 12:44:54 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Fri Jan 5 13:42:22 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or reject MapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Message-ID: Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_10_-_Make_Schemas_More_Amen able_to_Interim_Enhancements. I would like to set a 48 hour deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/086e4acb/attachment.html From pspencer at dmsolutions.ca Fri Jan 5 13:08:30 2007 From: pspencer at dmsolutions.ca (Paul Spencer) Date: Fri Jan 5 14:06:07 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or reject MapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements In-Reply-To: References: Message-ID: <83DA9633-72E2-4EB1-B12F-BFD4574DB515@dmsolutions.ca> +1 On 5-Jan-07, at 12:44 PM, Tom Fukushima wrote: > Hi PSC members, > I motion for a vote on RFC http://wiki.osgeo.org/index.php/ > MapGuide_RFC_10_-_Make_Schemas_More_Amenable_to_Interim_Enhancements. > > I would like to set a 48 hour deadline for your votes on this. > +1 from me. > Thanks > Tom > > _______________________________________________ > Mapguide_dev mailing list > Mapguide_dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide_dev +-----------------------------------------------------------------+ |Paul Spencer pspencer@dmsolutions.ca | +-----------------------------------------------------------------+ |Chief Technology Officer | |DM Solutions Group Inc http://www.dmsolutions.ca/ | +-----------------------------------------------------------------+ From bruce.dechant at autodesk.com Fri Jan 5 13:18:27 2007 From: bruce.dechant at autodesk.com (Bruce Dechant) Date: Fri Jan 5 14:15:56 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Message-ID: +1 Bruce _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: January 5, 2007 10:45 AM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_10_-_Make_Schemas_More_Amen able_to_Interim_Enhancements . I would like to set a 48 hour deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/562b67c6/attachment.html From tom.fukushima at autodesk.com Fri Jan 5 15:37:11 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Fri Jan 5 16:34:41 2007 Subject: [Mapguide_dev] svn commit: r1032 - Changes to allow compiling on Fedora Core 6, gcc 4.1.1 20061011 (Red Hat 4.1.1-30) Message-ID: NOTE: we are sending these commit emails to mapguide_dev@lists.osgeo.org until the mapguide_commits@lists.osgeo.org list comes back online. Revision: 1032 Author: tomfukushima Date: 5:05:21 PM, Thursday, January 04, 2007 Message: Changes to allow compiling on Fedora Core 6, gcc 4.1.1 20061011 (Red Hat 4.1.1-30) ---- Modified : /trunk/MgDev/Common/MapGuideCommon/Services/PrintLayout.h Modified : /trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionImp.h Modified : /trunk/MgDev/Common/MdfParser/IOAttributeRelate.h Modified : /trunk/MgDev/Oem/SWIGEx/Source/Modules/java.cxx Modified : /trunk/MgDev/Oem/gdal-1.3.0/frmts/fit/fitdataset.cpp Modified : /trunk/MgDev/Oem/geos-2.2.0/source/headers/geos/geom.h Modified : /trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFlatFdoReader.cpp Modified : /trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryDefinition.cpp Modified : /trunk/MgDev/Server/src/Gws/Include/GwsCommon.h Modified : /trunk/MgDev/Server/src/Services/Feature/ServerDescribeSchema.h Index: D:/svn/MgDev/Oem/gdal-1.3.0/frmts/fit/fitdataset.cpp =================================================================== --- D:/svn/MgDev/Oem/gdal-1.3.0/frmts/fit/fitdataset.cpp (revision 1031) +++ D:/svn/MgDev/Oem/gdal-1.3.0/frmts/fit/fitdataset.cpp (revision 1032) @@ -174,7 +174,7 @@ public: - FITRasterBand::FITRasterBand( FITDataset *, int ); + FITRasterBand( FITDataset *, int ); ~FITRasterBand(); // should override RasterIO eventually. Index: D:/svn/MgDev/Oem/SWIGEx/Source/Modules/java.cxx =================================================================== --- D:/svn/MgDev/Oem/SWIGEx/Source/Modules/java.cxx (revision 1031) +++ D:/svn/MgDev/Oem/SWIGEx/Source/Modules/java.cxx (revision 1032) @@ -3579,7 +3579,7 @@ * director-based class. * ------------------------------------------------------------------------ ----- */ - virtual int JAVA::abstractClassTest(Node *n) { + virtual int abstractClassTest(Node *n) { if (!Cmp(Getattr(n, "feature:director"), "1")) return 0; return Language::abstractClassTest(n); @@ -3608,3 +3608,4 @@ -dllname - set the name of JNI dll\n\ \n"; + Index: D:/svn/MgDev/Oem/geos-2.2.0/source/headers/geos/geom.h =================================================================== --- D:/svn/MgDev/Oem/geos-2.2.0/source/headers/geos/geom.h (revision 1031) +++ D:/svn/MgDev/Oem/geos-2.2.0/source/headers/geos/geom.h (revision 1032) @@ -358,52 +358,52 @@ //double distance(Coordinate& p); static Coordinate nullCoord; - void Coordinate::setNull() { + void setNull() { x=DoubleNotANumber; y=DoubleNotANumber; z=DoubleNotANumber; } - static Coordinate& Coordinate::getNull() { + static Coordinate& getNull() { return nullCoord; } - Coordinate::Coordinate() { + Coordinate() { x=0.0; y=0.0; z=DoubleNotANumber; } - Coordinate::Coordinate(double xNew, double yNew, double zNew) { + Coordinate(double xNew, double yNew, double zNew) { x=xNew; y=yNew; z=zNew; } #ifndef PROFILE_COORDINATE_COPIES - Coordinate::Coordinate(const Coordinate& c){ + Coordinate(const Coordinate& c){ x=c.x; y=c.y; z=c.z; } #else - Coordinate::Coordinate(const Coordinate& c); + Coordinate(const Coordinate& c); Coordinate &operator=(const Coordinate &c); #endif - Coordinate::Coordinate(double xNew, double yNew){ + Coordinate(double xNew, double yNew){ x=xNew; y=yNew; z=DoubleNotANumber; } - void Coordinate::setCoordinate(const Coordinate& other) { + void setCoordinate(const Coordinate& other) { x = other.x; y = other.y; z = other.z; } - bool Coordinate::equals2D(const Coordinate& other) const { + bool equals2D(const Coordinate& other) const { if (x != other.x) { return false; } @@ -413,7 +413,7 @@ return true; } - int Coordinate::compareTo(const Coordinate& other) const { + int compareTo(const Coordinate& other) const { if (x < other.x) { return -1; } @@ -429,22 +429,22 @@ return 0; } - bool Coordinate::equals3D(const Coordinate& other) const { + bool equals3D(const Coordinate& other) const { return (x == other.x) && ( y == other.y) && ((z == other.z)||(ISNAN(z) && ISNAN(other.z))); } - void Coordinate::makePrecise(const PrecisionModel *precisionModel) { + void makePrecise(const PrecisionModel *precisionModel) { x = precisionModel->makePrecise(x); y = precisionModel->makePrecise(y); } - double Coordinate::distance(const Coordinate& p) const { + double distance(const Coordinate& p) const { double dx = x - p.x; double dy = y - p.y; return sqrt(dx * dx + dy * dy); } - int Coordinate::hashCode() { + int hashCode() { //Algorithm from Effective Java by Joshua Bloch [Jon Aquino] int result = 17; result = 37 * result + hashCode(x); @@ -456,7 +456,7 @@ * Returns a hash code for a double value, using the algorithm from * Joshua Bloch's book Effective Java */ - static int Coordinate::hashCode(double x) { + static int hashCode(double x) { int64 f = (int64)(x); return (int)(f^(f>>32)); } Index: D:/svn/MgDev/Common/MdfParser/IOAttributeRelate.h =================================================================== --- D:/svn/MgDev/Common/MdfParser/IOAttributeRelate.h (revision 1031) +++ D:/svn/MgDev/Common/MdfParser/IOAttributeRelate.h (revision 1032) @@ -35,7 +35,7 @@ Extension *m_pExtension; void WriteType(MdfStream &fd, AttributeRelate *pAttributeRelate); - AttributeRelate::RelateType IOAttributeRelate::ReadType(const wchar_t *name); + AttributeRelate::RelateType ReadType(const wchar_t *name); public: IOAttributeRelate(); Index: D:/svn/MgDev/Common/MapGuideCommon/Services/ServerConnectionImp.h =================================================================== --- D:/svn/MgDev/Common/MapGuideCommon/Services/ServerConnectionImp.h (revision 1031) +++ D:/svn/MgDev/Common/MapGuideCommon/Services/ServerConnectionImp.h (revision 1032) @@ -69,7 +69,7 @@ /// \brief /// Returns the ace handle /// - ACE_HANDLE MgServerConnectionImp::GetHandle(); + ACE_HANDLE GetHandle(); private: ACE_SOCK_Stream* mServer; Index: D:/svn/MgDev/Common/MapGuideCommon/Services/PrintLayout.h =================================================================== --- D:/svn/MgDev/Common/MapGuideCommon/Services/PrintLayout.h (revision 1031) +++ D:/svn/MgDev/Common/MapGuideCommon/Services/PrintLayout.h (revision 1032) @@ -213,13 +213,13 @@ INTERNAL_API: /// Layout element constants - static const double MgPrintLayout::LegendWidth; - static const double MgPrintLayout::LegendPadding; - static const double MgPrintLayout::HeaderHeight; - static const double MgPrintLayout::ScalebarHeight; - static const double MgPrintLayout::ScalebarPadding; - static const double MgPrintLayout::FooterHeight; - static const double MgPrintLayout::GroupIndent; + static const double LegendWidth; + static const double LegendPadding; + static const double HeaderHeight; + static const double ScalebarHeight; + static const double ScalebarPadding; + static const double FooterHeight; + static const double GroupIndent; ////////////////////////////////////////////////////////////////// /// \brief Index: D:/svn/MgDev/Server/src/Gws/Include/GwsCommon.h =================================================================== --- D:/svn/MgDev/Server/src/Gws/Include/GwsCommon.h (revision 1031) +++ D:/svn/MgDev/Server/src/Gws/Include/GwsCommon.h (revision 1032) @@ -828,7 +828,7 @@ IGWSException(){} virtual ~IGWSException() {} - virtual void IGWSException::Dispose(){} + virtual void Dispose(){} }; Index: D:/svn/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryDefinition.cpp =================================================================== --- D:/svn/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryDefinition.cpp (revision 1031) +++ D:/svn/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryDefinition.cpp (revision 1032) @@ -231,13 +231,11 @@ } +template class GWSQueryDefinition; +template class GWSQueryDefinition; +template class GWSQueryDefinition; -template GWSQueryDefinition; -template GWSQueryDefinition; -template GWSQueryDefinition; - - bool GwsQueryDefinitionXmlHelpers::CompareQueries(IGWSQueryDefinition* firstQuery , IGWSQueryDefinition* secondQuery) Index: D:/svn/MgDev/Server/src/Gws/GwsQueryEngine/GwsFlatFdoReader.cpp =================================================================== --- D:/svn/MgDev/Server/src/Gws/GwsQueryEngine/GwsFlatFdoReader.cpp (revision 1031) +++ D:/svn/MgDev/Server/src/Gws/GwsQueryEngine/GwsFlatFdoReader.cpp (revision 1032) @@ -847,11 +847,11 @@ template static void bpo(std::multimap& propmap, FdoOrderingOption order, std::vector& propertyOrder) { if(FdoOrderingOption_Ascending==order) { - std::multimap::iterator mmIter; + typename std::multimap::iterator mmIter; for(mmIter = propmap.begin(); mmIter!= propmap.end(); mmIter++) propertyOrder.push_back(mmIter->second); } else { - std::multimap::reverse_iterator mmIter; + typename std::multimap::reverse_iterator mmIter; for(mmIter = propmap.rbegin(); mmIter!= propmap.rend(); mmIter++) propertyOrder.push_back(mmIter->second); } Index: D:/svn/MgDev/Server/src/Services/Feature/ServerDescribeSchema.h =================================================================== --- D:/svn/MgDev/Server/src/Services/Feature/ServerDescribeSchema.h (revision 1031) +++ D:/svn/MgDev/Server/src/Services/Feature/ServerDescribeSchema.h (revision 1032) @@ -34,8 +34,8 @@ MgStringCollection* GetClasses(MgResourceIdentifier* resource, CREFSTRING schemaName); MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource, CREFSTRING schemaName, CREFSTRING className); STRING SchemaToXml(MgFeatureSchemaCollection* schema); - FdoFeatureSchemaCollection* MgServerDescribeSchema::GetFdoFeatureSchemaCollection(MgFeatureSchemaCol lection* mgSchemaCol); - FdoFeatureSchema* MgServerDescribeSchema::GetFdoFeatureSchema(MgFeatureSchema* mgSchema); + FdoFeatureSchemaCollection* GetFdoFeatureSchemaCollection(MgFeatureSchemaCollection* mgSchemaCol); + FdoFeatureSchema* GetFdoFeatureSchema(MgFeatureSchema* mgSchema); void GetFdoClassCollection(FdoClassCollection* fdoClassCol, MgClassDefinitionCollection* mgClassDefCol); FdoClassDefinition* GetFdoClassDefinition(MgClassDefinition* mgClassDef, FdoClassCollection* fdoClassCol); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/ba9a7757/attachment-0001.html From steve.dang at autodesk.com Fri Jan 5 15:48:49 2007 From: steve.dang at autodesk.com (Steve Dang) Date: Fri Jan 5 16:46:19 2007 Subject: [Mapguide_dev] svn commit: r1033 - Miscellaneous code cleanups and fixes. Message-ID: <73BD5EF42E005C47988D1624D128BC7E053FB8BE@msgusawmb03.ads.autodesk.com> Revision: 1033 Author: stevedang Date: 2:34:30 PM, Friday, January 05, 2007 Message: MG456 (Miscellaneous code cleanups and fixes) - Added a new error message to clarify the reason why the server fails to open the repository. - Cleaned up/sorted string resource IDs. - Synchronized the server/web tier resource files. ---- Modified : /trunk/MgDev/Server/src/Resources/server_en.res Modified : /trunk/MgDev/Server/src/Services/Resource/Repository.cpp Modified : /trunk/MgDev/Web/src/mapagent/Resources/web_en.res Index: C:/Projects/MgDev/OS/Server/src/Services/Resource/Repository.cpp =================================================================== --- C:/Projects/MgDev/OS/Server/src/Services/Resource/Repository.cpp (revision 1032) +++ C:/Projects/MgDev/OS/Server/src/Services/Resource/Repository.cpp (revision 1033) @@ -73,7 +73,7 @@ throw new MgRepositoryOpenFailedException( L"MgRepository.VerifySafeDatabaseAccess", - __LINE__, __WFILE__, &arguments, L"", NULL); + __LINE__, __WFILE__, &arguments, L"MgRepositoryAlreadyOpened", NULL); } } Index: C:/Projects/MgDev/OS/Server/src/Resources/server_en.res =================================================================== --- C:/Projects/MgDev/OS/Server/src/Resources/server_en.res (revision 1032) +++ C:/Projects/MgDev/OS/Server/src/Resources/server_en.res (revision 1033) @@ -154,6 +154,7 @@ # ************************************************************************ ***** [ErrorDescription] MgArgumentsMismatch = The arguments needed do not match the arguments provided. +MgClassWOIdentity = A class definition has no identity property. MgCollectionEmpty = The collection cannot be empty. MgConfigurationPropertyLengthIsInvalid = The value of property %1 under section %2 is %3. Its length must be %4 MgConfigurationPropertyLengthIsOutOfRange = The value of property %1 under section %2 is %3. Its length must be between %4 and %5 @@ -222,9 +223,13 @@ MgInvalidXmlDateTime = The Xml date time is invalid because not all of the fields were found. MgInvalidYear = The year is invalid because it must be between 1 and 9999. MgMapLayerGroupNameNotFound = The map layer group name was not found. +MgMissingClassDef = No class definition specified. +MgMissingSchema = No schema specified. +MgMissingSrs = No coordinate system specified. MgNameNotFound = The name was not found. MgPropertyValuesEmpty = The property values cannot be empty. MgReaderIdNotFound = The reader ID was not found. +MgRepositoryAlreadyOpened = The repository is already opened by another process (e.g. If you are running the server interactively as an application from the command line, are you also running the server as a service?). MgResourceDataFilePathEmpty = The resource data file path is empty. MgResourceNameDoesNotContainSectionName = The resource name does not contain a section name. MgResourceNameSeparatorNotFound = The resource name separator was not found. @@ -242,10 +247,6 @@ MgValueCannotBeLessThanOrEqualToZero = The value cannot be less than or equal to zero. MgValueCannotBeLessThanZero = The value cannot be less than zero. MgValueCannotBeZero = The value cannot be zero. -MgMissingClassDef = No class definition specified. -MgClassWOIdentity = A class definition has no identity property. -MgMissingSrs = No coordinate system specified. -MgMissingSchema = No schema specified. # ************************************************************************ ***** # D R A W I N G S E R V I C E @@ -256,24 +257,29 @@ # F E A T U R E S E R V I C E # ************************************************************************ ***** [FeatureService] +MgBatchInsertNotSupported = Provider does not support batch insert. Only one Feature instance is allowed. +MgCommandNotSupported = Command is not supported by Provider. +MgCustomFunctionNotSupported = Aggregate function specified not supported or invalid data type +MgGroupingNotSupported = Grouping is not supported by provider +MgInsertError = Error occurred while insert operation, no ID to retrieve +MgInvalidComputedProperty = Invalid Computed property specified, Make sure valid no of arguments are specified +MgInvalidConnectionString = Invalid Connection String. MgInvalidFdoProvider = Invalid Feature Provider specified. MgInvalidPropertyName = Invalid Property Name found. MgMissingConfiguration = No configuration specified. -MgInvalidConnectionString = Invalid Connection String. -MgPropertyNotEnumerable = Property specified is not enumerable. +MgMissingPropertyAlias = Alias for computed property is missing MgMissingRasterProperty = No Raster Property available in the class. -MgCommandNotSupported = Command is not supported by Provider. +MgNoFeaturesForInsert = No Features for Insert supplied MgOnlyOnePropertyAllowed = Only one aggregate function of this kind is supported -MgInvalidComputedProperty = Invalid Computed property specified, Make sure valid no of arguments are specified -MgCustomFunctionNotSupported = Aggregate function specified not supported or invalid data type -MgMissingPropertyAlias = Alias for computed property is missing -MgBatchInsertNotSupported = Provider does not support batch insert. Only one Feature instance is allowed. -MgNoFeaturesForInsert = No Features for Insert supplied -MgInsertError = Error occurred while insert operation, no ID to retrieve MgOrderingOptionNotSupported = Ordering Option is not supported by provider -MgGroupingNotSupported = Grouping is not supported by provider +MgPropertyNotEnumerable = Property specified is not enumerable. # ************************************************************************ ***** +# K M L S E R V I C E +# ************************************************************************ ***** +[KmlService] + +# ************************************************************************ ***** # M A P P I N G S E R V I C E # ************************************************************************ ***** [MappingService] @@ -287,12 +293,12 @@ # R E S O U R C E S E R V I C E # ************************************************************************ ***** [ResourceService] +MgPackageStatusMessageLoadPackageFailed = LOAD FAILED: %1 failed to load package on %2 +MgPackageStatusMessageLoadPackageInProgress = Loading package %1 ... MgPackageStatusMessageLoadPackageSucceeded = LOAD SUCCEEDED: %1 successfully loaded package on %2 -MgPackageStatusMessageMakePackageSucceeded = MAKE SUCCEEDED: %1 successfully made package on %2 -MgPackageStatusMessageLoadPackageFailed = LOAD FAILED: %1 failed to load package on %2 MgPackageStatusMessageMakePackageFailed = MAKE FAILED: %1 failed to make package on %2 -MgPackageStatusMessageLoadPackageInProgress = Loading package %1 ... MgPackageStatusMessageMakePackageInProgress = Making package %1 ... +MgPackageStatusMessageMakePackageSucceeded = MAKE SUCCEEDED: %1 successfully made package on %2 MgPackageStatusMessageNotStarted = Not started MgPackageStatusMessageUnknown = Unknown MgRepositoryBusy = Please try your operation later as the repository was busy. @@ -322,3 +328,8 @@ MgUserFullNameAuthor = Map Author MgUserFullNameWfsUser = WFS User MgUserFullNameWmsUser = WMS User + +# ************************************************************************ ***** +# T I L E S E R V I C E +# ************************************************************************ ***** +[TileService] Index: C:/Projects/MgDev/OS/Web/src/mapagent/Resources/web_en.res =================================================================== --- C:/Projects/MgDev/OS/Web/src/mapagent/Resources/web_en.res (revision 1032) +++ C:/Projects/MgDev/OS/Web/src/mapagent/Resources/web_en.res (revision 1033) @@ -30,6 +30,7 @@ MgCoordinateSystemComputationFailedException = The coordinate system computation failed. MgCoordinateSystemConversionFailedException = The coordinate system conversion failed. MgCoordinateSystemInitializationFailedException = The coordinate system initialization failed. +MgCoordinateSystemLoadFailedException = The coordinate system load failed. MgCoordinateSystemMeasureFailedException = The coordinate system measure failed. MgCoordinateSystemTransformFailedException = The coordinate system transform failed. MgDateTimeException = A date and/or time exception occurred. @@ -95,6 +96,7 @@ MgInvalidResourcePreProcessingTypeException = Invalid resource pre-processing type. MgInvalidResourceTypeException = Invalid resource type. MgInvalidServerNameException = Invalid server name: %1 +MgInvalidSerialNumberException = Invalid serial number: %1 MgInvalidStreamHeaderException = Invalid stream header exception. MgIoException = An IO exception occurred. MgLayerNotFoundException = The specified layer was not found: %1 @@ -135,7 +137,9 @@ MgServiceNotAvailableException = The specified service is not available. MgServiceNotSupportedException = The specified service is not supported. MgSessionExpiredException = Session has expired or is invalid. Please log in again. +MgSessionNotFoundException = A required session was not found. MgStreamIoException = A stream IO exception occurred. +MgStylizeLayerFailedException = Failed to stylize layer: %1 MgTemporaryFileNotAvailableException = Temporary file is not available. MgUnauthorizedAccessException = Unauthorized access. MgUnclassifiedException = An unclassified exception occurred. @@ -150,6 +154,7 @@ # ************************************************************************ ***** [ErrorDescription] MgArgumentsMismatch = The arguments needed do not match the arguments provided. +MgClassWOIdentity = A class definition has no identity property. MgCollectionEmpty = The collection cannot be empty. MgConfigurationPropertyLengthIsInvalid = The value of property %1 under section %2 is %3. Its length must be %4 MgConfigurationPropertyLengthIsOutOfRange = The value of property %1 under section %2 is %3. Its length must be between %4 and %5 @@ -218,9 +223,13 @@ MgInvalidXmlDateTime = The Xml date time is invalid because not all of the fields were found. MgInvalidYear = The year is invalid because it must be between 1 and 9999. MgMapLayerGroupNameNotFound = The map layer group name was not found. +MgMissingClassDef = No class definition specified. +MgMissingSchema = No schema specified. +MgMissingSrs = No coordinate system specified. MgNameNotFound = The name was not found. MgPropertyValuesEmpty = The property values cannot be empty. MgReaderIdNotFound = The reader ID was not found. +MgRepositoryAlreadyOpened = The repository is already opened by another process (e.g. If you are running the server interactively as an application from the command line, are you also running the server as a service?). MgResourceDataFilePathEmpty = The resource data file path is empty. MgResourceNameDoesNotContainSectionName = The resource name does not contain a section name. MgResourceNameSeparatorNotFound = The resource name separator was not found. @@ -250,6 +259,11 @@ [FeatureService] # ************************************************************************ ***** +# K M L S E R V I C E +# ************************************************************************ ***** +[KmlService] + +# ************************************************************************ ***** # M A P P I N G S E R V I C E # ************************************************************************ ***** [MappingService] @@ -263,12 +277,12 @@ # R E S O U R C E S E R V I C E # ************************************************************************ ***** [ResourceService] +MgPackageStatusMessageLoadPackageFailed = LOAD FAILED: %1 failed to load package on %2 +MgPackageStatusMessageLoadPackageInProgress = Loading package %1 ... MgPackageStatusMessageLoadPackageSucceeded = LOAD SUCCEEDED: %1 successfully loaded package on %2 -MgPackageStatusMessageMakePackageSucceeded = MAKE SUCCEEDED: %1 successfully made package on %2 -MgPackageStatusMessageLoadPackageFailed = LOAD FAILED: %1 failed to load package on %2 MgPackageStatusMessageMakePackageFailed = MAKE FAILED: %1 failed to make package on %2 -MgPackageStatusMessageLoadPackageInProgress = Loading package %1 ... MgPackageStatusMessageMakePackageInProgress = Making package %1 ... +MgPackageStatusMessageMakePackageSucceeded = MAKE SUCCEEDED: %1 successfully made package on %2 MgPackageStatusMessageNotStarted = Not started MgPackageStatusMessageUnknown = Unknown -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/a453529f/attachment-0001.html From steve.dang at autodesk.com Fri Jan 5 15:52:58 2007 From: steve.dang at autodesk.com (Steve Dang) Date: Fri Jan 5 16:50:27 2007 Subject: [Mapguide_dev] svn commit: r1034 - Miscellaneous code cleanups and fixes. Message-ID: <73BD5EF42E005C47988D1624D128BC7E053FB8CC@msgusawmb03.ads.autodesk.com> Revision: 1034 Author: stevedang Date: 2:38:18 PM, Friday, January 05, 2007 Message: MG456 (Miscellaneous code cleanups and fixes) - Added MG_UNUSED_ARG macro to keep compilers quiet about unused parameters. - Removed all other UNUSED macros. ---- Modified : /trunk/MgDev/Common/Foundation/FoundationDefs.h Modified : /trunk/MgDev/Common/MapGuideCommon/Services/ConnectionProperties.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionImp.cpp Modified : /trunk/MgDev/Common/PlatformBase/Services/FeatureSet.cpp Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsCommon.cpp Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp Modified : /trunk/MgDev/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp Modified : /trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp Modified : /trunk/MgDev/Web/src/HttpHandler/HttpHeader.cpp Index: C:/Projects/MgDev/OS/Common/PlatformBase/Services/FeatureSet.cpp =================================================================== --- C:/Projects/MgDev/OS/Common/PlatformBase/Services/FeatureSet.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Common/PlatformBase/Services/FeatureSet.cpp (revision 1034) @@ -46,7 +46,7 @@ /// set based on the result of a select command void MgFeatureSet::FromReader(MgFeatureReader* featureReader) { - UNUSED(featureReader); + MG_UNUSED_ARG(featureReader); } ////////////////////////////////////////////////////////////////// Index: C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ConnectionProperties .cpp =================================================================== --- C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ConnectionProperties .cpp (revision 1033) +++ C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ConnectionProperties .cpp (revision 1034) @@ -177,7 +177,7 @@ /// void MgConnectionProperties::Serialize(MgStream* stream) { - UNUSED(stream); + MG_UNUSED_ARG(stream); } /// @@ -185,7 +185,7 @@ /// void MgConnectionProperties::Deserialize(MgStream* stream) { - UNUSED(stream); + MG_UNUSED_ARG(stream); } /// \brief Index: C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ServerConnectionImp. cpp =================================================================== --- C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ServerConnectionImp. cpp (revision 1033) +++ C:/Projects/MgDev/OS/Common/MapGuideCommon/Services/ServerConnectionImp. cpp (revision 1034) @@ -104,7 +104,7 @@ if (-1 == connectResult) { int err = ACE_OS::last_error(); - UNUSED(err); + MG_UNUSED_ARG(err); // Could not connect delete mServer; mServer = NULL; Index: C:/Projects/MgDev/OS/Common/Foundation/FoundationDefs.h =================================================================== --- C:/Projects/MgDev/OS/Common/Foundation/FoundationDefs.h (revision 1033) +++ C:/Projects/MgDev/OS/Common/Foundation/FoundationDefs.h (revision 1034) @@ -168,16 +168,7 @@ /// Byte array. typedef unsigned char* BYTE_ARRAY_OUT; -#ifdef _WIN32 -#define UNUSED(var) -#define UNUSED_BOOL(var) -#define UNUSED_ENUM(var, type) -#define UNUSED_STR(var) -#else -#define UNUSED(var) (var=0) -#define UNUSED_BOOL(var) (var=false) -#define UNUSED_ENUM(var, type) (var=(type)0) -#define UNUSED_STR(var) (var.length()) -#endif +// Keep compilers quiet about unused parameters. +#define MG_UNUSED_ARG(a) static_cast(&(a)) -#endif // MGCOMMONDEFS_H_ +#endif // MGFOUNDATIONDEFS_H_ Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp =================================================================== --- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsXmlUtils.cpp (revision 1034) @@ -65,7 +65,7 @@ void CGwsStringCollectionSaxHandler::XmlCharacters(FdoXmlSaxContext* ctx, FdoString* chars) { - ctx = 0; // For "unreferenced formal parameter" warning + static_cast(&(ctx)); // For "unreferenced formal parameter" warning if (m_strcoll) { FdoPtr tcoll = FdoStringCollection::Create (chars, m_sdelimiter); Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommon.cpp =================================================================== --- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommon.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommon.cpp (revision 1034) @@ -22,8 +22,8 @@ LPVOID lpReserved ) { - hModule = 0; // For "unreferenced formal parameter" warning - lpReserved = 0; // For "unreferenced formal parameter" warning + static_cast(&(hModule)); // For "unreferenced formal parameter" warning + static_cast(&(lpReserved)); // For "unreferenced formal parameter" warning switch (ul_reason_for_call) { Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp =================================================================== --- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsObjectImpl.cpp (revision 1034) @@ -276,7 +276,7 @@ void CGwsObject::Write (FdoXmlWriter * writer) { - writer = 0; // For "unreferenced formal parameter" warning + static_cast(&(writer)); // For "unreferenced formal parameter" warning } Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp =================================================================== --- C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Server/src/Gws/GwsCommon/GwsCommonFdoUtils.cpp (revision 1034) @@ -749,7 +749,7 @@ const wchar_t * ltname ) { - ltname; // For "unreferenced formal parameter" warning + static_cast(&(ltname)); // For "unreferenced formal parameter" warning static GWSExtendedFeatureId s_fid; Index: C:/Projects/MgDev/OS/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp =================================================================== --- C:/Projects/MgDev/OS/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Server/src/Gws/GwsQueryEngine/GwsFdoCommand.cpp (revision 1034) @@ -76,7 +76,7 @@ //////////////////////////////////////////////////////////////////////// /////// EGwsStatus CGwsFdoCommand::Init (const wchar_t* pFDOCommandClass /*NULL*/) { - pFDOCommandClass; // For "unreferenced formal parameter" warning + static_cast(&(pFDOCommandClass)); // For "unreferenced formal parameter" warning // initilaize class definition if(m_classDef == NULL) @@ -193,7 +193,7 @@ //////////////////////////////////////////////////////////////////////// /////// EGwsStatus CGwsFdoCommand::Execute (CGwsMutableFeature & feature) { - feature; // For "unreferenced formal parameter" warning + static_cast(&(feature)); // For "unreferenced formal parameter" warning return eGwsNotSupported; } @@ -211,7 +211,7 @@ //////////////////////////////////////////////////////////////////////// /////// EGwsStatus CGwsFdoCommand::Execute (const GWSFeatureId & featid) { - featid; // For "unreferenced formal parameter" warning + static_cast(&(featid)); // For "unreferenced formal parameter" warning return eGwsNotSupported; } @@ -228,9 +228,9 @@ int ubound ) { - featids; // For "unreferenced formal parameter" warning - lbound; // For "unreferenced formal parameter" warning - ubound; // For "unreferenced formal parameter" warning + static_cast(&(featids)); // For "unreferenced formal parameter" warning + static_cast(&(lbound)); // For "unreferenced formal parameter" warning + static_cast(&(ubound)); // For "unreferenced formal parameter" warning return eGwsNotSupported; } Index: C:/Projects/MgDev/OS/Web/src/HttpHandler/HttpHeader.cpp =================================================================== --- C:/Projects/MgDev/OS/Web/src/HttpHandler/HttpHeader.cpp (revision 1033) +++ C:/Projects/MgDev/OS/Web/src/HttpHandler/HttpHeader.cpp (revision 1034) @@ -206,7 +206,7 @@ /// MgStringCollection* MgHttpHeader::GetHeaders(CREFSTRING name) { - UNUSED_STR(name); + MG_UNUSED_ARG(name); // TODO: Return proper string collection here Ptr mgsCollection; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/247dbbfe/attachment-0001.html From tom.fukushima at autodesk.com Fri Jan 5 16:11:57 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Fri Jan 5 17:09:26 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or reject MapGuide RFC 3 - Session Affinity Message-ID: Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_3_-_Session_Affinity. I would like to set a 96 hour (as opposed to 48 hours since RFC 10 is also out for approval right now) deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/ab8fe694/attachment.html From amorsell at spatialgis.com Fri Jan 5 17:35:11 2007 From: amorsell at spatialgis.com (Andy Morsell) Date: Fri Jan 5 18:32:18 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity In-Reply-To: Message-ID: <047e01c73119$c3599580$6401a8c0@SPINAJM> +1 Andy Andy _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Friday, January 05, 2007 1:12 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_3_-_Session_Affinity. I would like to set a 96 hour (as opposed to 48 hours since RFC 10 is also out for approval right now) deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/96a832ac/attachment.html From amorsell at spatialgis.com Fri Jan 5 17:35:28 2007 From: amorsell at spatialgis.com (Andy Morsell) Date: Fri Jan 5 18:32:26 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements In-Reply-To: Message-ID: <048301c73119$cd25abd0$6401a8c0@SPINAJM> +1 Andy Andy _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Friday, January 05, 2007 9:45 AM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 10 - Make Schemas More Amenable to Interim Enhancements Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_10_-_Make_Schemas_More_Amenable _to_Interim_Enhancements. I would like to set a 48 hour deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/65b69dff/attachment.html From trevor.wekel at autodesk.com Fri Jan 5 19:16:12 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Fri Jan 5 20:13:40 2007 Subject: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request Message-ID: Hello Dev list, I would like to submit the following RFC for review and discussion by the community. Please post any comments back to the list and I will be happy to respond. http://wiki.osgeo.org/index.php/MapGuide_RFC_11_-_Stateless_Http_GETTILE IMAGE_request Thanks, Trevor -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070105/dc3691f4/attachment.html From bruce.dechant at autodesk.com Sat Jan 6 11:53:24 2007 From: bruce.dechant at autodesk.com (Bruce Dechant) Date: Sat Jan 6 12:50:52 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity Message-ID: +1 Bruce _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: January 5, 2007 2:12 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_3_-_Session_Affinity . I would like to set a 96 hour (as opposed to 48 hours since RFC 10 is also out for approval right now) deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070106/a89dfd27/attachment.html From walt.welton-lair at autodesk.com Sat Jan 6 20:27:06 2007 From: walt.welton-lair at autodesk.com (Walt Welton-Lair) Date: Sat Jan 6 21:24:33 2007 Subject: [Mapguide_dev] svn commit: r1035 - Fixed a typo in FastCGI library for regular CGI mode Message-ID: r1035 | waltweltonlair | 2007-01-07 03:18:36 +0100 (Sun, 07 Jan 2007) | 33 lines Fixed a typo in FastCGI library for regular CGI mode. The MapAgent would fail when I tried to do a simple enumerate resource request: I would repeatedly get prompted for credentials. So I debugged the agent a little and all the calls to getenv() were returning NULL. Stepping a little deeper, I saw this code in fcgi_stdio.c: if(!acceptCalled) { /* * First call to FCGI_Accept. Is application running * as FastCGI or as CGI? */ isCGI = FCGX_IsCGI(); acceptCalled = TRUE; atexit(&FCGI_Finish); origenv = environ; while (NULL != *origenv) { ++origenvsize; ++origenv; } origenv = environ; environ = NULL; } The last 4 lines of this if-block were recently added with submission MG428. The problem is that environ is getting set to NULL. This is an extern variable that is later used by getenv. In the CGI case (isCGI=true) the environ variable is not getting reconstructed later on (see further down in the method). So for the CGI case getenv will fail. The right thing to do is to only set environ to NULL if isCGI is false. In that case it will be reconstructed from the original environment, and so getenv will succeed. In FCGI_Finish we free the environ variable if it's not NULL, but only for the non-CGI case. So we're ok there too. =================================================================== --- fcgi_stdio.c (revision 1034) +++ fcgi_stdio.c (working copy) @@ -122,10 +122,13 @@ isCGI = FCGX_IsCGI(); acceptCalled = TRUE; atexit(&FCGI_Finish); - origenv = environ; - while (NULL != *origenv) { ++origenvsize; ++origenv; } - origenv = environ; - environ = NULL; + if (!isCGI) + { + origenv = environ; + while (NULL != *origenv) { ++origenvsize; ++origenv; } + origenv = environ; + environ = NULL; + } } else if(isCGI) { /* W E @__ __o A T R @___ _ \<,_ L @_ (*)/ (*) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070106/98a68a30/attachment.html From tom.fukushima at autodesk.com Sun Jan 7 23:25:49 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Mon Jan 8 00:23:20 2007 Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Message-ID: Hi, I would like to release MapGuide Open Source 1.1.0 RC2 in a couple of weeks. This means that approved defect submissions to the 1.1.0 stream need to be made by next weekend. If you have a defect fix that you would like to submit, please send it to this list for review. If it is a security related defect fix, please send it to me directly for review. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070107/d5f5b0f0/attachment.html From pspencer at dmsolutions.ca Mon Jan 8 08:35:09 2007 From: pspencer at dmsolutions.ca (Paul Spencer) Date: Mon Jan 8 09:32:40 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or reject MapGuide RFC 3 - Session Affinity In-Reply-To: References: Message-ID: <9B2B8068-12E2-4178-882B-501E6639EB3F@dmsolutions.ca> +0 Paul On 5-Jan-07, at 4:11 PM, Tom Fukushima wrote: > Hi PSC members, > > I motion for a vote on RFC http://wiki.osgeo.org/index.php/ > MapGuide_RFC_3_-_Session_Affinity. > > I would like to set a 96 hour (as opposed to 48 hours since RFC 10 > is also out for approval right now) deadline for your votes on this. > > +1 from me. > > Thanks > Tom > > _______________________________________________ > Mapguide_dev mailing list > Mapguide_dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide_dev +-----------------------------------------------------------------+ |Paul Spencer pspencer@dmsolutions.ca | +-----------------------------------------------------------------+ |Chief Technology Officer | |DM Solutions Group Inc http://www.dmsolutions.ca/ | +-----------------------------------------------------------------+ From pspencer at dmsolutions.ca Mon Jan 8 08:42:40 2007 From: pspencer at dmsolutions.ca (Paul Spencer) Date: Mon Jan 8 09:40:03 2007 Subject: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request In-Reply-To: References: Message-ID: <9D26506B-4E39-4644-9AF2-76402A610E53@dmsolutions.ca> I like it! This will make it a lot easier to integrate mapguide into existing tiling clients like OpenLayers. Paul On 5-Jan-07, at 7:16 PM, Trevor Wekel wrote: > > Hello Dev list, > > I would like to submit the following RFC for review and discussion > by the community. Please post any comments back to the list and I > will be happy to respond. > > http://wiki.osgeo.org/index.php/MapGuide_RFC_11_- > _Stateless_Http_GETTILEIMAGE_request > > Thanks, > Trevor > > _______________________________________________ > Mapguide_dev mailing list > Mapguide_dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide_dev +-----------------------------------------------------------------+ |Paul Spencer pspencer@dmsolutions.ca | +-----------------------------------------------------------------+ |Chief Technology Officer | |DM Solutions Group Inc http://www.dmsolutions.ca/ | +-----------------------------------------------------------------+ From walt.welton-lair at autodesk.com Mon Jan 8 10:49:08 2007 From: walt.welton-lair at autodesk.com (Walt Welton-Lair) Date: Mon Jan 8 11:46:30 2007 Subject: [Mapguide_dev] svn commit: r1036 - Add missing ReadNext() check Message-ID: r1036 | waltweltonlair | 2007-01-08 17:40:08 +0100 (Mon, 08 Jan 2007) | 10 lines Add missing ReadNext() check The buffer web code was calling ReadNext on an MgSpatialContextReader without checking the return value. It then immediately called GetCoordinateSystemWkt on the reader. This generates an MgIndexOutOfRangeException if there are no spatial contexts. Updated the code to only call GetCoordinateSystemWkt if ReadNext returns true. The fix was made for all three web tier flavors: ASPX, PHP, JSP. =================================================================== --- mapviewerjava/buffer.jsp (revision 1035) +++ mapviewerjava/buffer.jsp (revision 1036) @@ -221,17 +221,10 @@ MgResourceIdentifier featSourceId = new MgResourceIdentifier(selLayer.GetFeatureSourceId()); MgSpatialContextReader ctxs = featureSrvc.GetSpatialContexts(featSourceId, true); String srsDefDs = ""; - if(ctxs != null) - { - ctxs.ReadNext(); + if(ctxs != null && ctxs.ReadNext()) srsDefDs = ctxs.GetCoordinateSystemWkt(); - if(srsDefDs == null || srsDefDs.length() == 0) - { - excludedLayers++; - continue; - } - } - else + + if(srsDefDs == null || srsDefDs.length() == 0) { excludedLayers++; continue; @@ -505,16 +498,16 @@ String GetMapSrs(MgMap map) { - try + try { String srs = map.GetMapSRS(); - if(!srs.equals("")) + if(!srs.equals("")) return srs; } catch(MgException e) { } - + //No SRS, set to ArbitrayXY meters // return "LOCALCS[\"*XY-MT*\",LOCAL_DATUM[\"*X-Y*\",10000],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"; =================================================================== --- mapviewernet/buffer.aspx (revision 1035) +++ mapviewernet/buffer.aspx (revision 1036) @@ -202,17 +202,10 @@ MgResourceIdentifier featSourceId = new MgResourceIdentifier(selLayer.GetFeatureSourceId()); MgSpatialContextReader ctxs = featureSrvc.GetSpatialContexts(featSourceId, true); String srsDefDs = ""; - if (ctxs != null) - { - ctxs.ReadNext(); + if (ctxs != null && ctxs.ReadNext()) srsDefDs = ctxs.GetCoordinateSystemWkt(); - if (srsDefDs == null || srsDefDs.Length == 0) - { - excludedLayers++; - continue; - } - } - else + + if (srsDefDs == null || srsDefDs.Length == 0) { excludedLayers++; continue; =================================================================== --- mapviewerphp/buffer.php (revision 1035) +++ mapviewerphp/buffer.php (revision 1036) @@ -191,17 +191,10 @@ $featSourceId = new MgResourceIdentifier($selLayer->GetFeatureSourceId()); $ctxs = $featureSrvc->GetSpatialContexts($featSourceId, true); $srsDefDs = ""; - if($ctxs != null) - { - $ctxs->ReadNext(); + if($ctxs != null && $ctxs->ReadNext()) $srsDefDs = $ctxs->GetCoordinateSystemWkt(); - if($srsDefDs == "") - { - $excludedLayers ++; - continue; - } - } - else + + if($srsDefDs == "") { $excludedLayers ++; continue; @@ -213,7 +206,7 @@ if($arbitraryDsSrs) $dsSrsUnits = $srsDs->GetUnits(); - + // exclude layer if: // the map is non-arbitrary and the layer is arbitrary or vice-versa // or @@ -474,9 +467,9 @@ function GetMapSrs($map) { $srs = $map->GetMapSRS(); - if($srs != "") + if($srs != "") return $srs; - + //No SRS, set to ArbitrayXY meters // return "LOCALCS[\"*XY-MT*\",LOCAL_DATUM[\"*X-Y*\",10000],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"; W E @__ __o A T R @___ _ \<,_ L @_ (*)/ (*) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/95abc826/attachment-0001.html From trevor.wekel at autodesk.com Mon Jan 8 11:41:57 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Mon Jan 8 12:39:19 2007 Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Message-ID: Hi Tom, I would like to put a TCP/IP stream version check in the 1.1.0 release to help catch versioning issues between the Web Extensions and Server code bases. Over time, improvements in the TCP/IP protocol will be made. Some of these improvements could break compatibility with older releases. Thanks, Trevor _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Sunday, January 07, 2007 9:26 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi, I would like to release MapGuide Open Source 1.1.0 RC2 in a couple of weeks. This means that approved defect submissions to the 1.1.0 stream need to be made by next weekend. If you have a defect fix that you would like to submit, please send it to this list for review. If it is a security related defect fix, please send it to me directly for review. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/e7ad3f70/attachment.html From tom.fukushima at autodesk.com Mon Jan 8 11:59:52 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Mon Jan 8 12:57:19 2007 Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Message-ID: Hi Trevor, I would like to get an idea of the risk and size of the change. Can you give me the revision numbers for the submissions for this to the trunk? Thanks Tom _____ From: Trevor Wekel Sent: Monday, January 08, 2007 9:42 AM To: Tom Fukushima; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi Tom, I would like to put a TCP/IP stream version check in the 1.1.0 release to help catch versioning issues between the Web Extensions and Server code bases. Over time, improvements in the TCP/IP protocol will be made. Some of these improvements could break compatibility with older releases. Thanks, Trevor _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Sunday, January 07, 2007 9:26 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi, I would like to release MapGuide Open Source 1.1.0 RC2 in a couple of weeks. This means that approved defect submissions to the 1.1.0 stream need to be made by next weekend. If you have a defect fix that you would like to submit, please send it to this list for review. If it is a security related defect fix, please send it to me directly for review. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/3d6ec394/attachment.html From trevor.wekel at autodesk.com Mon Jan 8 12:21:31 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Mon Jan 8 13:18:52 2007 Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Message-ID: Hi Tom, The check went into trunk as part of a much larger submission. After some testing, I have noticed that this code does not correctly detect the difference between a garbled stream and a stream of the wrong version. They are all detected as wrong version so I will need to add some additional logic to discriminate between the two cases. Here are the relevant lines of code from the original submission: >From StreamParser::ParseStreamHeader Index: StreamParser.cpp =================================================================== --- StreamParser.cpp (revision 737) +++ StreamParser.cpp (revision 1028) @@ -77,6 +77,12 @@ ret = true; } } + + if (ret == false || MgStreamParser::StreamVersion != pStreamData->GetVersion()) + { + throw new MgStreamIoException(L"MgStreamParser.ParseStreamHeader", __LINE__, __WFILE__, NULL, L"MgInvalidTC PProtocol", NULL); + } + } return ret; >From MgCommand::GetResponse Index: Command.cpp =================================================================== --- Command.cpp (revision 770) +++ Command.cpp (revision 1028) @@ -141,6 +141,12 @@ // Get the stream header i.e. stream_start, stream_data etc. ptrStream->GetStreamHeader(msh); + + if (MgStreamParser::mshStreamStart != msh.m_streamStart || MgStreamParser::StreamVersion != msh.m_streamVersion) + { + throw new MgStreamIoException(L"MgCommand.GetResponse", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NUL L); + } + // Get the operation response header ptrStream->GetOperationResponseHeader(morp); // Process the result based on eCode. In case of exception, it would throw the exception _____ From: Tom Fukushima Sent: Monday, January 08, 2007 10:00 AM To: Trevor Wekel; 'mapguide_dev@lists.osgeo.org' Subject: RE: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi Trevor, I would like to get an idea of the risk and size of the change. Can you give me the revision numbers for the submissions for this to the trunk? Thanks Tom _____ From: Trevor Wekel Sent: Monday, January 08, 2007 9:42 AM To: Tom Fukushima; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi Tom, I would like to put a TCP/IP stream version check in the 1.1.0 release to help catch versioning issues between the Web Extensions and Server code bases. Over time, improvements in the TCP/IP protocol will be made. Some of these improvements could break compatibility with older releases. Thanks, Trevor _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Sunday, January 07, 2007 9:26 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi, I would like to release MapGuide Open Source 1.1.0 RC2 in a couple of weeks. This means that approved defect submissions to the 1.1.0 stream need to be made by next weekend. If you have a defect fix that you would like to submit, please send it to this list for review. If it is a security related defect fix, please send it to me directly for review. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/edf357a1/attachment.html From Jason.Birch at nanaimo.ca Mon Jan 8 19:12:28 2007 From: Jason.Birch at nanaimo.ca (Jason Birch) Date: Mon Jan 8 20:09:51 2007 Subject: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request Message-ID: <8E468917B01800408B91984428BE03DD05852FC5@starfish.nanaimo.ca> I like this proposal. Will there be a message written to the server log when the map cache is flushed? I don't know if generating the MgMap objects is especially costly, but on a site that has more than 10 tiled maps set up, it's probably worth being able to see where some additional performance could be squeezed out. Jason ________________________________ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Trevor Wekel Sent: Friday, January 05, 2007 16:16 To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request Hello Dev list, I would like to submit the following RFC for review and discussion by the community. Please post any comments back to the list and I will be happy to respond. http://wiki.osgeo.org/index.php/MapGuide_RFC_11_-_Stateless_Http_GETTILE IMAGE_request Thanks, Trevor -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/c78c5ed9/attachment-0001.html From Jason.Birch at nanaimo.ca Mon Jan 8 19:14:14 2007 From: Jason.Birch at nanaimo.ca (Jason Birch) Date: Mon Jan 8 20:11:34 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity Message-ID: <8E468917B01800408B91984428BE03DD05852FC6@starfish.nanaimo.ca> Has it been 96 hours yet? I'm still on Florida time :) +1 if not... ________________________________ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Friday, January 05, 2007 13:12 To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity Hi PSC members, I motion for a vote on RFC http://wiki.osgeo.org/index.php/MapGuide_RFC_3_-_Session_Affinity . I would like to set a 96 hour (as opposed to 48 hours since RFC 10 is also out for approval right now) deadline for your votes on this. +1 from me. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/92d0fa85/attachment.html From trevor.wekel at autodesk.com Mon Jan 8 19:25:30 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Mon Jan 8 20:22:51 2007 Subject: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request Message-ID: Hi Jason, I can add a message to the server log indicating when the cache has been flushed. MgMap generation can be costly if the FeatureSource and LayerDefinitions have not been previously cached. For large maps, I have seen initial MgMap createtimes in the 1 to 2 second range. If the FeatureSource/LayerDefinition docs have been cached, the create time will go down to roughly 0.2 seconds. If you interested in calculating create times for your maps, take a look at the response times for mapframe.php/jsp/aspx. This is where the MgMap is initially constructed by the ajax viewer. Thanks, Trevor _____ From: Jason Birch [mailto:Jason.Birch@nanaimo.ca] Sent: Monday, January 08, 2007 5:12 PM To: Trevor Wekel; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request I like this proposal. Will there be a message written to the server log when the map cache is flushed? I don't know if generating the MgMap objects is especially costly, but on a site that has more than 10 tiled maps set up, it's probably worth being able to see where some additional performance could be squeezed out. Jason _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Trevor Wekel Sent: Friday, January 05, 2007 16:16 To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] MapGuide RFC 11 - Stateless Http GETTILEIMAGE request Hello Dev list, I would like to submit the following RFC for review and discussion by the community. Please post any comments back to the list and I will be happy to respond. http://wiki.osgeo.org/index.php/MapGuide_RFC_11_-_Stateless_Http_GETTILE IMAGE_request Thanks, Trevor -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/e0faeb9d/attachment.html From walt.welton-lair at autodesk.com Mon Jan 8 19:29:57 2007 From: walt.welton-lair at autodesk.com (Walt Welton-Lair) Date: Mon Jan 8 20:27:17 2007 Subject: [Mapguide_dev] svn commit: r1037 - Add missing ReadNext() check Message-ID: r1037 | waltweltonlair | 2007-01-09 02:21:43 +0100 (Tue, 09 Jan 2007) | 12 lines This is for the 1.1.x branch... Add missing ReadNext() check The buffer web code was calling ReadNext on an MgSpatialContextReader without checking the return value. It then immediately called GetCoordinateSystemWkt on the reader. This generates an MgIndexOutOfRangeException if there are no spatial contexts. Updated the code to only call GetCoordinateSystemWkt if ReadNext returns true. The fix was made for all three web tier flavors: ASPX, PHP, JSP. =================================================================== --- mapviewerjava/buffer.jsp (revision 1036) +++ mapviewerjava/buffer.jsp (revision 1037) @@ -221,17 +221,10 @@ MgResourceIdentifier featSourceId = new MgResourceIdentifier(selLayer.GetFeatureSourceId()); MgSpatialContextReader ctxs = featureSrvc.GetSpatialContexts(featSourceId, true); String srsDefDs = ""; - if(ctxs != null) - { - ctxs.ReadNext(); + if(ctxs != null && ctxs.ReadNext()) srsDefDs = ctxs.GetCoordinateSystemWkt(); - if(srsDefDs == null || srsDefDs.length() == 0) - { - excludedLayers++; - continue; - } - } - else + + if(srsDefDs == null || srsDefDs.length() == 0) { excludedLayers++; continue; @@ -505,16 +498,16 @@ String GetMapSrs(MgMap map) { - try + try { String srs = map.GetMapSRS(); - if(!srs.equals("")) + if(!srs.equals("")) return srs; } catch(MgException e) { } - + //No SRS, set to ArbitrayXY meters // return "LOCALCS[\"*XY-MT*\",LOCAL_DATUM[\"*X-Y*\",10000],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"; =================================================================== --- mapviewernet/buffer.aspx (revision 1036) +++ mapviewernet/buffer.aspx (revision 1037) @@ -202,17 +202,10 @@ MgResourceIdentifier featSourceId = new MgResourceIdentifier(selLayer.GetFeatureSourceId()); MgSpatialContextReader ctxs = featureSrvc.GetSpatialContexts(featSourceId, true); String srsDefDs = ""; - if (ctxs != null) - { - ctxs.ReadNext(); + if (ctxs != null && ctxs.ReadNext()) srsDefDs = ctxs.GetCoordinateSystemWkt(); - if (srsDefDs == null || srsDefDs.Length == 0) - { - excludedLayers++; - continue; - } - } - else + + if (srsDefDs == null || srsDefDs.Length == 0) { excludedLayers++; continue; =================================================================== --- mapviewerphp/buffer.php (revision 1036) +++ mapviewerphp/buffer.php (revision 1037) @@ -191,17 +191,10 @@ $featSourceId = new MgResourceIdentifier($selLayer->GetFeatureSourceId()); $ctxs = $featureSrvc->GetSpatialContexts($featSourceId, true); $srsDefDs = ""; - if($ctxs != null) - { - $ctxs->ReadNext(); + if($ctxs != null && $ctxs->ReadNext()) $srsDefDs = $ctxs->GetCoordinateSystemWkt(); - if($srsDefDs == "") - { - $excludedLayers ++; - continue; - } - } - else + + if($srsDefDs == "") { $excludedLayers ++; continue; @@ -213,7 +206,7 @@ if($arbitraryDsSrs) $dsSrsUnits = $srsDs->GetUnits(); - + // exclude layer if: // the map is non-arbitrary and the layer is arbitrary or vice-versa // or @@ -474,9 +467,9 @@ function GetMapSrs($map) { $srs = $map->GetMapSRS(); - if($srs != "") + if($srs != "") return $srs; - + //No SRS, set to ArbitrayXY meters // return "LOCALCS[\"*XY-MT*\",LOCAL_DATUM[\"*X-Y*\",10000],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"; W E @__ __o A T R @___ _ \<,_ L @_ (*)/ (*) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/9fb8f578/attachment-0001.html From trevor.wekel at autodesk.com Mon Jan 8 21:20:46 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Tue Jan 9 00:16:04 2007 Subject: [Mapguide_dev] svn commit: r1038 - RFC 10 Make Schemas More Amenable to Interim Enhancements Message-ID: Revision: 1038 Author: trevorwekel Date: 8:10:06 PM, Monday, January 08, 2007 Message: RFC 10 - Make Schemas More Amenable to Interim Enhancements ---- Modified : /trunk/MgDev/Common/MdfModel/AttributeRelate.h Modified : /trunk/MgDev/Common/MdfModel/CalculatedProperty.h Modified : /trunk/MgDev/Common/MdfModel/ChannelBand.h Modified : /trunk/MgDev/Common/MdfModel/Extension.h Modified : /trunk/MgDev/Common/MdfModel/FeatureSource.h Modified : /trunk/MgDev/Common/MdfModel/FeatureTypeStyle.h Modified : /trunk/MgDev/Common/MdfModel/Fill.h Modified : /trunk/MgDev/Common/MdfModel/GridColor.h Modified : /trunk/MgDev/Common/MdfModel/GridScaleRange.h Modified : /trunk/MgDev/Common/MdfModel/HillShade.h Modified : /trunk/MgDev/Common/MdfModel/Label.h Modified : /trunk/MgDev/Common/MdfModel/LayerDefinition.h Modified : /trunk/MgDev/Common/MdfModel/Makefile.am Modified : /trunk/MgDev/Common/MdfModel/MdfModel.vcproj Added : /trunk/MgDev/Common/MdfModel/MdfRootObject.cpp Added : /trunk/MgDev/Common/MdfModel/MdfRootObject.h Modified : /trunk/MgDev/Common/MdfModel/NameStringPair.h Modified : /trunk/MgDev/Common/MdfModel/RelateProperty.h Modified : /trunk/MgDev/Common/MdfModel/Rule.h Modified : /trunk/MgDev/Common/MdfModel/Stroke.h Modified : /trunk/MgDev/Common/MdfModel/SupplementalSpatialContextInfo.h Modified : /trunk/MgDev/Common/MdfModel/Symbol.h Modified : /trunk/MgDev/Common/MdfModel/Symbolization.h Modified : /trunk/MgDev/Common/MdfModel/VectorScaleRange.h Modified : /trunk/MgDev/Common/MdfParser/FSDSAX2Parser.cpp Modified : /trunk/MgDev/Common/MdfParser/FSDSAX2Parser.h Modified : /trunk/MgDev/Common/MdfParser/IOAreaRule.cpp Modified : /trunk/MgDev/Common/MdfParser/IOAreaSymbolization2D.cpp Modified : /trunk/MgDev/Common/MdfParser/IOAreaTypeStyle.cpp Modified : /trunk/MgDev/Common/MdfParser/IOAttributeRelate.cpp Modified : /trunk/MgDev/Common/MdfParser/IOBlockSymbol.cpp Modified : /trunk/MgDev/Common/MdfParser/IOCalculatedProperty.cpp Modified : /trunk/MgDev/Common/MdfParser/IOChannelBand.cpp Modified : /trunk/MgDev/Common/MdfParser/IODrawingLayerDefinition.cpp Modified : /trunk/MgDev/Common/MdfParser/IOExtension.cpp Modified : /trunk/MgDev/Common/MdfParser/IOFeatureSource.cpp Modified : /trunk/MgDev/Common/MdfParser/IOFill.cpp Modified : /trunk/MgDev/Common/MdfParser/IOFontSymbol.cpp Modified : /trunk/MgDev/Common/MdfParser/IOGridColor.cpp Added : /trunk/MgDev/Common/MdfParser/IOGridColorBands.cpp Modified : /trunk/MgDev/Common/MdfParser/IOGridColorRule.cpp Modified : /trunk/MgDev/Common/MdfParser/IOGridColorStyle.cpp Modified : /trunk/MgDev/Common/MdfParser/IOGridLayerDefinition.cpp Modified : /trunk/MgDev/Common/MdfParser/IOGridScaleRange.cpp Modified : /trunk/MgDev/Common/MdfParser/IOGridSurfaceStyle.cpp Modified : /trunk/MgDev/Common/MdfParser/IOHillShade.cpp Modified : /trunk/MgDev/Common/MdfParser/IOImageSymbol.cpp Modified : /trunk/MgDev/Common/MdfParser/IOLabel.cpp Modified : /trunk/MgDev/Common/MdfParser/IOLineRule.cpp Modified : /trunk/MgDev/Common/MdfParser/IOLineSymbolization2D.cpp Modified : /trunk/MgDev/Common/MdfParser/IOLineTypeStyle.cpp Modified : /trunk/MgDev/Common/MdfParser/IOMarkSymbol.cpp Modified : /trunk/MgDev/Common/MdfParser/IONameStringPair.cpp Modified : /trunk/MgDev/Common/MdfParser/IOPointRule.cpp Modified : /trunk/MgDev/Common/MdfParser/IOPointSymbolization2D.cpp Modified : /trunk/MgDev/Common/MdfParser/IOPointTypeStyle.cpp Modified : /trunk/MgDev/Common/MdfParser/IORelateProperty.cpp Modified : /trunk/MgDev/Common/MdfParser/IOStroke.cpp Modified : /trunk/MgDev/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp Added : /trunk/MgDev/Common/MdfParser/IOUnknown.cpp Added : /trunk/MgDev/Common/MdfParser/IOUnknown.h Modified : /trunk/MgDev/Common/MdfParser/IOUtil.cpp Modified : /trunk/MgDev/Common/MdfParser/IOUtil.h Modified : /trunk/MgDev/Common/MdfParser/IOVectorLayerDefinition.cpp Modified : /trunk/MgDev/Common/MdfParser/IOVectorScaleRange.cpp Modified : /trunk/MgDev/Common/MdfParser/IOW2DSymbol.cpp Modified : /trunk/MgDev/Common/MdfParser/Makefile.am Modified : /trunk/MgDev/Common/MdfParser/MdfParser.vcproj Added : /trunk/MgDev/Common/MdfParser/SAX2ElementHandler.cpp Modified : /trunk/MgDev/Common/MdfParser/SAX2ElementHandler.h Modified : /trunk/MgDev/Common/MdfParser/SAX2Parser.cpp Modified : /trunk/MgDev/Common/MdfParser/SAX2Parser.h Modified : /trunk/MgDev/Common/Schema/FeatureSource-1.0.0.xsd Modified : /trunk/MgDev/Common/Schema/LayerDefinition-1.0.0.xsd Index: E:/MgDev/OS/Common/Schema/FeatureSource-1.0.0.xsd =================================================================== --- E:/MgDev/OS/Common/Schema/FeatureSource-1.0.0.xsd (revision 1037) +++ E:/MgDev/OS/Common/Schema/FeatureSource-1.0.0.xsd (revision 1038) @@ -54,9 +54,11 @@ The feature class that is being extended; this is the class whose attributes are used for joining other attribute classes + + @@ -79,6 +81,7 @@ Text for value of parameter + @@ -112,6 +115,7 @@ Expression for the property + @@ -126,6 +130,7 @@ Name of property (field) in attribute class + @@ -165,6 +170,7 @@ Force 1 : 1 in the case of 1 : many + @@ -182,6 +188,15 @@ Coordinate system used for this spatial context + - \ No newline at end of file + + + A type allocating space for future, additional, and validatable data for this feature source + + + + + + Index: E:/MgDev/OS/Common/Schema/LayerDefinition-1.0.0.xsd =================================================================== --- E:/MgDev/OS/Common/Schema/LayerDefinition-1.0.0.xsd (revision 1037) +++ E:/MgDev/OS/Common/Schema/LayerDefinition-1.0.0.xsd (revision 1038) @@ -90,6 +90,7 @@ The zoomed out part of the scale range. Assume application's maximum value if the value is not specified. Exclusive. + @@ -140,6 +141,7 @@ The stylization to be applied to the features for a given scale range. + @@ -188,6 +190,7 @@ + @@ -210,6 +213,7 @@ One or more PointRules defining the PointTypeStyle + @@ -235,6 +239,7 @@ + @@ -246,33 +251,36 @@ The different types of point geometries. - - - - Predefined shape such as square or circle. - - - - - Raster or image symbol. Note that these do not scale well, but sometimes this is all that you have. Supported formats are application specific. - - - - - Specify the symbol using a font character. - - - - - Vector symbol defined using a W2D stream. - - - - - Vector symbol specifed from a block. - - - + + + + + Predefined shape such as square or circle. + + + + + Raster or image symbol. Note that these do not scale well, but sometimes this is all that you have. Supported formats are application specific. + + + + + Specify the symbol using a font character. + + + + + Vector symbol defined using a W2D stream. + + + + + Vector symbol specifed from a block. + + + + + @@ -284,6 +292,7 @@ Rules to define a theme. + @@ -309,6 +318,7 @@ + @@ -333,6 +343,7 @@ The style of the polygon edge. + @@ -347,6 +358,7 @@ Rules to define a theme. + @@ -376,6 +388,7 @@ + @@ -392,6 +405,7 @@ Unit of measurement that the thickness is specified in + @@ -406,6 +420,7 @@ The background color. Not applicable to solid fills. + @@ -514,6 +529,7 @@ + @@ -583,6 +599,7 @@ No edge is drawin if not specified. + @@ -602,6 +619,7 @@ The name to show the end user. + @@ -623,32 +641,35 @@ - - - - Reference to the image. - - - - - - The reference to the resource. - - - - - If ResourceId specifies a library, this identifies the name of a library item. - - - - - - - - BinHex data for image. - - - + + + + + Reference to the image. + + + + + + The reference to the resource. + + + + + If ResourceId specifies a library, this identifies the name of a library item. + + + + + + + + BinHex data for image. + + + + + @@ -669,6 +690,7 @@ + @@ -711,6 +733,7 @@ If specified all text in the symbol is drawn in this color. + @@ -734,6 +757,7 @@ Static color. + @@ -760,6 +784,7 @@ + @@ -794,6 +819,7 @@ Default is 255. Range is 0:255. + @@ -810,15 +836,18 @@ The color to use for a grid rule. - - - - Explicit ARGB color. - - - - - + + + + + Explicit ARGB color. + + + + + + + @@ -841,6 +870,7 @@ + @@ -868,6 +898,7 @@ Default is 1. Applied to band prior to computing hillshade. + @@ -892,6 +923,7 @@ + @@ -919,6 +951,7 @@ The color that will show if there is no ColorStyle defined at a pixel. + @@ -947,6 +980,15 @@ When the user has zoomed in by this amount, a request for more detailed raster data is made. + + + + A type allocating space for future, additional, and validatable data for this feature source + + + + + Index: E:/MgDev/OS/Common/MdfParser/IOCalculatedProperty.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOCalculatedProperty.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOCalculatedProperty.cpp (revision 1038) @@ -22,6 +22,11 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, CalculatedProperty); +ELEM_MAP_ENTRY(2, Name); +ELEM_MAP_ENTRY(3, Expression); + IOCalculatedProperty::IOCalculatedProperty() : m_pCalculatedProperty(NULL), m_pExtension(NULL) { @@ -39,10 +44,21 @@ void IOCalculatedProperty::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"CalculatedProperty") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eCalculatedProperty: m_startElemName = name; m_pCalculatedProperty = new CalculatedProperty(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -58,6 +74,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_pCalculatedProperty->SetUnknownXml(UnknownXml()); + m_pExtension->GetCalculatedProperties()->Adopt(m_pCalculatedProperty); handlerStack->pop(); this->m_pCalculatedProperty = NULL; @@ -81,6 +100,12 @@ fd << EncodeString(pCalculatedProperty->GetExpression()); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!pCalculatedProperty->GetUnknownXml().empty()) + { + fd << toCString(pCalculatedProperty->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOPointTypeStyle.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOPointTypeStyle.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOPointTypeStyle.cpp (revision 1038) @@ -23,6 +23,12 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, PointTypeStyle); +ELEM_MAP_ENTRY(2, PointRule); +ELEM_MAP_ENTRY(3, DisplayAsText); +ELEM_MAP_ENTRY(4, AllowOverpost); + IOPointTypeStyle::IOPointTypeStyle() { this->_pointTypeStyle = NULL; @@ -42,17 +48,30 @@ void IOPointTypeStyle::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"PointTypeStyle") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case ePointTypeStyle: m_startElemName = name; this->_pointTypeStyle = new PointTypeStyle(); + break; + + case ePointRule: + { + IOPointRule *IO = new IOPointRule(this->_pointTypeStyle); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"PointRule") // NOXLATE - { - IOPointRule *IO = new IOPointRule(this->_pointTypeStyle); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOPointTypeStyle::ElementChars(const wchar_t *ch) @@ -67,6 +86,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_pointTypeStyle->SetUnknownXml(UnknownXml()); + this->scaleRange->GetFeatureTypeStyles()->Adopt(this->_pointTypeStyle); handlerStack->pop(); this->scaleRange = NULL; @@ -99,6 +121,12 @@ delete IO; } + // Write any previously found unknown XML + if (!pointTypeStyle->GetUnknownXml().empty()) + { + fd << toCString(pointTypeStyle->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/MdfParser.vcproj =================================================================== --- E:/MgDev/OS/Common/MdfParser/MdfParser.vcproj (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/MdfParser.vcproj (revision 1038) @@ -328,6 +328,10 @@ > + + @@ -536,6 +540,14 @@ > + + + + @@ -580,6 +592,10 @@ > + + Index: E:/MgDev/OS/Common/MdfParser/IOLabel.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOLabel.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOLabel.cpp (revision 1038) @@ -23,6 +23,29 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, Label); +ELEM_MAP_ENTRY(2, AdvancedPlacement); +ELEM_MAP_ENTRY(3, ScaleLimit); +ELEM_MAP_ENTRY(4, Text); +ELEM_MAP_ENTRY(5, FontName); +ELEM_MAP_ENTRY(6, ForegroundColor); +ELEM_MAP_ENTRY(7, BackgroundColor); +ELEM_MAP_ENTRY(8, BackgroundStyle); +ELEM_MAP_ENTRY(9, HorizontalAlignment); +ELEM_MAP_ENTRY(10, VerticalAlignment); +ELEM_MAP_ENTRY(11, Bold); +ELEM_MAP_ENTRY(12, Italic); +ELEM_MAP_ENTRY(13, Underlined); +ELEM_MAP_ENTRY(14, Unit); +ELEM_MAP_ENTRY(15, SizeContext); +ELEM_MAP_ENTRY(16, SizeX); +ELEM_MAP_ENTRY(17, SizeY); +ELEM_MAP_ENTRY(18, InsertionPointX); +ELEM_MAP_ENTRY(19, InsertionPointY); +ELEM_MAP_ENTRY(20, Rotation); +ELEM_MAP_ENTRY(21, MaintainAspect); + IOLabel::IOLabel() { this->_label = NULL; @@ -44,16 +67,30 @@ void IOLabel::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"Label") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eLabel: m_startElemName = name; this->_label = new Label(); + break; + + case eAdvancedPlacement: + if (this->_label) + { + this->_label->GetSymbol()->SetAdvancedPlacement(true); + this->m_handlingPlacement = true; + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"AdvancedPlacement" && this->_label) // NOXLATE - { - this->_label->GetSymbol()->SetAdvancedPlacement(true); - this->m_handlingPlacement = true; - } } void IOLabel::ElementChars(const wchar_t *ch) @@ -126,6 +163,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_label->SetUnknownXml(UnknownXml()); + this->rule->AdoptLabel(this->_label); handlerStack->pop(); this->rule= NULL; @@ -231,6 +271,12 @@ fd << tab() << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!label->GetUnknownXml().empty()) + { + fd << toCString(label->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOBlockSymbol.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOBlockSymbol.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOBlockSymbol.cpp (revision 1038) @@ -25,13 +25,41 @@ // When a BlockSymbol is successfully parsed by this class, it must be accessed by the // parent class and then managed appropriately. It will not be deleted by this class. +CREATE_ELEMENT_MAP; +// Inherited Symbol Elements +ELEM_MAP_ENTRY(1, Unit); +ELEM_MAP_ENTRY(2, SizeContext); +ELEM_MAP_ENTRY(3, SizeX); +ELEM_MAP_ENTRY(4, SizeY); +ELEM_MAP_ENTRY(5, InsertionPointX); +ELEM_MAP_ENTRY(6, InsertionPointY); +ELEM_MAP_ENTRY(7, Rotation); +ELEM_MAP_ENTRY(8, MaintainAspect); +// Local Elements +ELEM_MAP_ENTRY(9, Block); +ELEM_MAP_ENTRY(10, DrawingName); +ELEM_MAP_ENTRY(11, BlockName); +ELEM_MAP_ENTRY(12, BlockColor); +ELEM_MAP_ENTRY(13, LayerColor); + void IOBlockSymbol::StartElement(const wchar_t *name, HandlerStack *handlerStack) { this->m_currElemName = name; - if (this->m_currElemName == L"Block") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eBlock: this->m_startElemName = name; this->m_symbol = new BlockSymbol(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -54,6 +82,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_symbol->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->m_startElemName = L""; } @@ -92,6 +123,12 @@ fd << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!symbol->GetUnknownXml().empty()) + { + fd << toCString(symbol->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IONameStringPair.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IONameStringPair.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IONameStringPair.cpp (revision 1038) @@ -22,6 +22,12 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, PropertyMapping); +ELEM_MAP_ENTRY(2, Parameter); +ELEM_MAP_ENTRY(3, Name); +ELEM_MAP_ENTRY(4, Value); + IONameStringPair::IONameStringPair() : _nameStringPair(NULL), layer(NULL), featureSource(NULL) { @@ -46,21 +52,32 @@ void IONameStringPair::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (NULL != layer) + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { - if (m_currElemName == L"PropertyMapping") // NOXLATE + case ePropertyMapping: + if (NULL != layer) { m_startElemName = name; this->_nameStringPair = new NameStringPair(L"", L""); } - } - else if (NULL != featureSource) - { - if (m_currElemName == L"Parameter") // NOXLATE + break; + + case eParameter: + if (NULL != featureSource) { m_startElemName = name; this->_nameStringPair = new NameStringPair(L"", L""); } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -76,6 +93,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_nameStringPair->SetUnknownXml(UnknownXml()); + if (NULL != this->layer) this->layer->GetPropertyMappings()->Adopt(this->_nameStringPair); else if (NULL != this->featureSource) @@ -101,4 +121,10 @@ fd << tab() << ""; // NOXLATE fd << EncodeString(nameStringPair->GetValue()); fd << "" << std::endl; // NOXLATE + + // Write any previously found unknown XML + if (!nameStringPair->GetUnknownXml().empty()) + { + fd << toCString(nameStringPair->GetUnknownXml()); + } } Index: E:/MgDev/OS/Common/MdfParser/IOVectorScaleRange.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOVectorScaleRange.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOVectorScaleRange.cpp (revision 1038) @@ -26,6 +26,14 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, VectorScaleRange); +ELEM_MAP_ENTRY(2, AreaTypeStyle); +ELEM_MAP_ENTRY(3, LineTypeStyle); +ELEM_MAP_ENTRY(4, PointTypeStyle); +ELEM_MAP_ENTRY(5, MinScale); +ELEM_MAP_ENTRY(6, MaxScale); + IOVectorScaleRange::IOVectorScaleRange() { this->_scaleRange = NULL; @@ -45,29 +53,46 @@ void IOVectorScaleRange::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"VectorScaleRange") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eVectorScaleRange: m_startElemName = name; this->_scaleRange = new VectorScaleRange(); + break; + + case eAreaTypeStyle: + { + IOAreaTypeStyle *IO = new IOAreaTypeStyle(this->_scaleRange); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eLineTypeStyle: + { + IOLineTypeStyle *IO = new IOLineTypeStyle(this->_scaleRange); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case ePointTypeStyle: + { + IOPointTypeStyle *IO = new IOPointTypeStyle(this->_scaleRange); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"AreaTypeStyle") // NOXLATE - { - IOAreaTypeStyle *IO = new IOAreaTypeStyle(this->_scaleRange); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"LineTypeStyle") // NOXLATE - { - IOLineTypeStyle *IO = new IOLineTypeStyle(this->_scaleRange); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"PointTypeStyle") // NOXLATE - { - IOPointTypeStyle *IO = new IOPointTypeStyle(this->_scaleRange); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOVectorScaleRange::ElementChars(const wchar_t *ch) @@ -82,6 +107,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_scaleRange->SetUnknownXml(UnknownXml()); + this->layer->GetScaleRanges()->Adopt(this->_scaleRange); handlerStack->pop(); this->layer = NULL; @@ -135,6 +163,12 @@ } } + // Write any previously found unknown XML + if (!scaleRange->GetUnknownXml().empty()) + { + fd << toCString(scaleRange->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOGridLayerDefinition.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridLayerDefinition.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOGridLayerDefinition.cpp (revision 1038) @@ -23,6 +23,15 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, GridLayerDefinition); +ELEM_MAP_ENTRY(2, GridScaleRange); +ELEM_MAP_ENTRY(3, ResourceId); +ELEM_MAP_ENTRY(4, FeatureName); +ELEM_MAP_ENTRY(5, Geometry); +ELEM_MAP_ENTRY(6, Filter); +ELEM_MAP_ENTRY(7, Opacity); + IOGridLayerDefinition::IOGridLayerDefinition():_layer(NULL) { } @@ -38,16 +47,29 @@ void IOGridLayerDefinition::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"GridLayerDefinition") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eGridLayerDefinition: m_startElemName = name; + break; + + case eGridScaleRange: + { + IOGridScaleRange *IO = new IOGridScaleRange(this->_layer); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"GridScaleRange") // NOXLATE - { - IOGridScaleRange *IO = new IOGridScaleRange(this->_layer); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOGridLayerDefinition::ElementChars(const wchar_t *ch) @@ -68,6 +90,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_layer->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->_layer = NULL; m_startElemName = L""; @@ -122,6 +147,12 @@ delete IO; } + // Write any previously found unknown XML + if (!gridLayer->GetUnknownXml().empty()) + { + fd << toCString(gridLayer->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE Index: E:/MgDev/OS/Common/MdfParser/IOGridColorBands.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridColorBands.cpp (revision 0) +++ E:/MgDev/OS/Common/MdfParser/IOGridColorBands.cpp (revision 1038) @@ -0,0 +1,146 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#include "stdafx.h" +#include "IOGridColor.h" +#include "IOChannelBand.h" +#include "IOExtra.h" + +using namespace XERCES_CPP_NAMESPACE; +using namespace MDFMODEL_NAMESPACE; +using namespace MDFPARSER_NAMESPACE; + +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, Bands); +ELEM_MAP_ENTRY(2, RedBand); +ELEM_MAP_ENTRY(3, GreenBand); +ELEM_MAP_ENTRY(4, BlueBand); + +// +// IOGridColorBands +// +IOGridColorBands::IOGridColorBands():color(NULL),redChannel(NULL), greenChannel(NULL), blueChannel(NULL) +{ +} + +IOGridColorBands::IOGridColorBands(GridColorRule * colorRule): IOGridColor(colorRule),color(NULL), + redChannel(NULL), greenChannel(NULL), blueChannel(NULL) +{ +} + +IOGridColorBands::~IOGridColorBands() +{ + +} + +void IOGridColorBands::StartElement(const wchar_t *name, HandlerStack *handlerStack) +{ + m_currElemName = name; + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) + { + case eBands: + m_startElemName = name; + this->color = new GridColorBands(); + break; + + case eRedBand: + { + redChannel = new ChannelBand(); + IOChannelBand* pIO = new IOChannelBand(redChannel, m_currElemName); + handlerStack->push(pIO); + pIO->StartElement(name, handlerStack); + } + break; + + case eGreenBand: + { + greenChannel = new ChannelBand(); + IOChannelBand* pIO = new IOChannelBand(greenChannel, m_currElemName); + handlerStack->push(pIO); + pIO->StartElement(name, handlerStack); + } + break; + + case eBlueBand: + { + blueChannel = new ChannelBand(); + IOChannelBand* pIO = new IOChannelBand(blueChannel, m_currElemName); + handlerStack->push(pIO); + pIO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; + } +} + +void IOGridColorBands::ElementChars(const wchar_t *ch) +{ + +} + +void IOGridColorBands::EndElement(const wchar_t *name, HandlerStack *handlerStack) +{ + if (m_startElemName == name) + { + if (!UnknownXml().empty()) + this->color->SetUnknownXml(UnknownXml()); + + this->color->SetRedBand(*redChannel); + this->color->SetGreenBand(*greenChannel); + this->color->SetBlueBand(*blueChannel); + this->colorRule->AdoptGridColor(color); + handlerStack->pop(); + this->colorRule = NULL; + this->color = NULL; + m_startElemName = L""; + delete this; + } +} + +void IOGridColorBands::Write(MdfStream &fd, GridColorBands * pColor) +{ + fd << tab() << "" << std::endl; // NOXLATE + inctab(); + + std::auto_ptr spIO; + + spIO.reset(new IOChannelBand(L"RedBand")); // NOXLATE + spIO->Write(fd, &(pColor->GetRedBand())); + + spIO.reset(new IOChannelBand(L"GreenBand")); // NOXLATE + spIO->Write(fd, &(pColor->GetGreenBand())); + + spIO.reset(new IOChannelBand(L"BlueBand")); // NOXLATE + spIO->Write(fd, &(pColor->GetBlueBand())); + + // Write any previously found unknown XML + if (!pColor->GetUnknownXml().empty()) + { + fd << toCString(pColor->GetUnknownXml()); + } + + dectab(); + fd << tab() << "" << std::endl; // NOXLATE +} Property changes on: E:\MgDev\OS\Common\MdfParser\IOGridColorBands.cpp ___________________________________________________________________ Name: svn:eol-style + native Index: E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.cpp (revision 0) +++ E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.cpp (revision 1038) @@ -0,0 +1,32 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#include "stdafx.h" +#include "SAX2ElementHandler.h" +#include "IOUnknown.h" + +using namespace XERCES_CPP_NAMESPACE; +using namespace MDFMODEL_NAMESPACE; +using namespace MDFPARSER_NAMESPACE; + +void SAX2ElementHandler::ParseUnknownXml(const wchar_t *name, HandlerStack *handlerStack) +{ + IOUnknown *IO = new IOUnknown(&m_unknownXml); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); +} + Property changes on: E:\MgDev\OS\Common\MdfParser\SAX2ElementHandler.cpp ___________________________________________________________________ Name: svn:eol-style + native Index: E:/MgDev/OS/Common/MdfParser/IOGridColorStyle.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridColorStyle.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOGridColorStyle.cpp (revision 1038) @@ -25,6 +25,14 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, ColorStyle); +ELEM_MAP_ENTRY(2, HillShade); +ELEM_MAP_ENTRY(3, ColorRule); +ELEM_MAP_ENTRY(4, TransparencyColor); +ELEM_MAP_ENTRY(5, BrightnessFactor); +ELEM_MAP_ENTRY(6, ContrastFactor); + IOGridColorStyle::IOGridColorStyle():colorStyle(NULL), scaleRange(NULL) { } @@ -40,23 +48,38 @@ void IOGridColorStyle::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"ColorStyle") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eColorStyle: m_startElemName = name; this->colorStyle = new GridColorStyle(); + break; + + case eHillShade: + { + IOHillShade *IO = new IOHillShade(this->colorStyle); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eColorRule: + { + IOGridColorRule *IO = new IOGridColorRule(this->colorStyle); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"HillShade") // NOXLATE - { - IOHillShade *IO = new IOHillShade(this->colorStyle); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"ColorRule") // NOXLATE - { - IOGridColorRule *IO = new IOGridColorRule(this->colorStyle); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOGridColorStyle::ElementChars(const wchar_t *ch) @@ -73,6 +96,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->colorStyle->SetUnknownXml(UnknownXml()); + this->scaleRange->AdoptColorStyle(this->colorStyle); handlerStack->pop(); this->scaleRange = NULL; @@ -132,6 +158,12 @@ } } + // Write any previously found unknown XML + if (!pColorStyle->GetUnknownXml().empty()) + { + fd << toCString(pColorStyle->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/SAX2Parser.h =================================================================== --- E:/MgDev/OS/Common/MdfParser/SAX2Parser.h (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/SAX2Parser.h (revision 1038) @@ -69,18 +69,13 @@ // Unfortunately, the SAX2 Parser doesn't necessarily send all the // characters that appear inside a tag in one call of characters()- // for example with escape characters it separates them into separate calls. - // Therefore, m_strbuffer is used to accumulate the characters, openTag and - // prevOpenTag are used to determine if we're still reading characters in the - // same open tag, and tagOpen and charsInTag are used in the case when you have - // no characters in between a tag (i.e. ) to make sure - // that whitespace or line returns don't get assigned to it instead. + // Therefore, m_strbuffer is used to accumulate the characters. tagOpen is + // used in the case when you have characters outside a tag (i.e. ) + // to make sure that whitespace or line returns don't get assigned to it instead. std::wstring m_strbuffer; + bool m_tagOpen; - std::wstring m_openTag; - std::wstring m_prevOpenTag; MdfString m_strParserError; - bool m_tagOpen; - bool m_charsInTag; void WriteDefinition(MdfStream &fd, MapDefinition* map, Index: E:/MgDev/OS/Common/MdfParser/IOLineTypeStyle.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOLineTypeStyle.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOLineTypeStyle.cpp (revision 1038) @@ -23,6 +23,10 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, LineTypeStyle); +ELEM_MAP_ENTRY(2, LineRule); + IOLineTypeStyle::IOLineTypeStyle() { this->_lineTypeStyle = NULL; @@ -42,17 +46,30 @@ void IOLineTypeStyle::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"LineTypeStyle") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eLineTypeStyle: m_startElemName = name; - this->_lineTypeStyle = new LineTypeStyle(); // NOXLATE + this->_lineTypeStyle = new LineTypeStyle(); + break; + + case eLineRule: + { + IOLineRule *IO = new IOLineRule(this->_lineTypeStyle); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"LineRule") // NOXLATE - { - IOLineRule *IO = new IOLineRule(this->_lineTypeStyle); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOLineTypeStyle::ElementChars(const wchar_t *ch) @@ -64,6 +81,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_lineTypeStyle->SetUnknownXml(UnknownXml()); + this->scaleRange->GetFeatureTypeStyles()->Adopt(this->_lineTypeStyle); handlerStack->pop(); this->scaleRange = NULL; @@ -86,6 +106,12 @@ delete IO; } + // Write any previously found unknown XML + if (!lineTypeStyle->GetUnknownXml().empty()) + { + fd << toCString(lineTypeStyle->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOFeatureSource.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOFeatureSource.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOFeatureSource.cpp (revision 1038) @@ -26,6 +26,16 @@ #include "IOExtension.h" #include "IOSupplementalSpatialContextInfo.h" +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, FeatureSource); +ELEM_MAP_ENTRY(2, Parameter); +ELEM_MAP_ENTRY(3, Extension); +ELEM_MAP_ENTRY(4, SupplementalSpatialContextInfo); +ELEM_MAP_ENTRY(5, Provider); +ELEM_MAP_ENTRY(6, ConfigurationDocument); +ELEM_MAP_ENTRY(7, LongTransaction); + + IOFeatureSource::IOFeatureSource() : m_pFeatureSource(NULL) { @@ -43,32 +53,45 @@ void IOFeatureSource::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"FeatureSource") // NOXLATE - { - m_startElemName = name; + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eFeatureSource: + m_startElemName = name; + break; + + case eParameter: + { + IONameStringPair *IO = new IONameStringPair(this->m_pFeatureSource); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eExtension: + { + IOExtension *IO = new IOExtension(this->m_pFeatureSource); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eSupplementalSpatialContextInfo: + { + IOSupplementalSpatialContextInfo *IO = + new IOSupplementalSpatialContextInfo(this->m_pFeatureSource); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else - { - if (m_currElemName == L"Parameter") // NOXLATE - { - IONameStringPair *IO = new IONameStringPair(this->m_pFeatureSource); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"Extension") // NOXLATE - { - IOExtension *IO = new IOExtension(this->m_pFeatureSource); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"SupplementalSpatialContextInfo") // NOXLATE - { - IOSupplementalSpatialContextInfo *IO = - new IOSupplementalSpatialContextInfo(this->m_pFeatureSource); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - } } void IOFeatureSource::ElementChars(const wchar_t *ch) @@ -85,6 +108,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_pFeatureSource->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->m_pFeatureSource = NULL; m_startElemName = L""; @@ -141,7 +167,14 @@ spIO->Write(fd, pFeatureSource->GetExtensions()->GetAt(x)); } + // Write any previously found unknown XML + if (!pFeatureSource->GetUnknownXml().empty()) + { + fd << toCString(pFeatureSource->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } + Index: E:/MgDev/OS/Common/MdfParser/IORelateProperty.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IORelateProperty.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IORelateProperty.cpp (revision 1038) @@ -22,6 +22,11 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, RelateProperty); +ELEM_MAP_ENTRY(2, FeatureClassProperty); +ELEM_MAP_ENTRY(3, AttributeClassProperty); + IORelateProperty::IORelateProperty() : m_pRelateProperty(NULL), m_pAttributeRelate(NULL) { @@ -39,10 +44,21 @@ void IORelateProperty::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"RelateProperty") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eRelateProperty: m_startElemName = name; m_pRelateProperty = new RelateProperty(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -65,6 +81,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_pRelateProperty->SetUnknownXml(UnknownXml()); + m_pAttributeRelate->GetRelateProperties()->Adopt(m_pRelateProperty); handlerStack->pop(); this->m_pRelateProperty = NULL; @@ -89,7 +108,14 @@ fd << EncodeString(pRelateProperty->GetAttributeClassProperty()); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!pRelateProperty->GetUnknownXml().empty()) + { + fd << toCString(pRelateProperty->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } + Index: E:/MgDev/OS/Common/MdfParser/IOUtil.h =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOUtil.h (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOUtil.h (revision 1038) @@ -73,5 +73,8 @@ return false; } + std::string startStr(const std::string elementName); + std::string endStr(const std::string elementName); + END_NAMESPACE_MDFPARSER #endif // _IOUTIL_H Index: E:/MgDev/OS/Common/MdfParser/IOAreaSymbolization2D.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOAreaSymbolization2D.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOAreaSymbolization2D.cpp (revision 1038) @@ -24,6 +24,11 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, AreaSymbolization2D); +ELEM_MAP_ENTRY(2, Fill); +ELEM_MAP_ENTRY(3, Stroke); + IOAreaSymbolization2D::IOAreaSymbolization2D() { this->_areaSymbolization = NULL; @@ -43,28 +48,43 @@ void IOAreaSymbolization2D::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"AreaSymbolization2D") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eAreaSymbolization2D: m_startElemName = name; this->_areaSymbolization = new AreaSymbolization2D(); // delete the fill and edge that are created by default - recreate if present when parsing delete this->_areaSymbolization->OrphanFill(); delete this->_areaSymbolization->OrphanEdge(); + break; + + case eFill: + { + this->_areaSymbolization->AdoptFill(new Fill()); + IOFill *IO = new IOFill(this->_areaSymbolization->GetFill()); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eStroke: + { + this->_areaSymbolization->AdoptEdge(new Stroke()); + IOStroke *IO = new IOStroke(this->_areaSymbolization->GetEdge(), m_currElemName); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"Fill") // NOXLATE - { - this->_areaSymbolization->AdoptFill(new Fill()); - IOFill *IO = new IOFill(this->_areaSymbolization->GetFill()); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"Stroke") // NOXLATE - { - this->_areaSymbolization->AdoptEdge(new Stroke()); - IOStroke *IO = new IOStroke(this->_areaSymbolization->GetEdge(), m_currElemName); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOAreaSymbolization2D::ElementChars(const wchar_t *ch) @@ -76,6 +96,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_areaSymbolization->SetUnknownXml(UnknownXml()); + if (this->_areaSymbolization != NULL) this->areaRule->AdoptSymbolization(this->_areaSymbolization); handlerStack->pop(); @@ -99,6 +122,12 @@ if (areaSymbolization != NULL && areaSymbolization->GetEdge() != NULL) IOStroke::Write(fd, areaSymbolization->GetEdge(), "Stroke"); // NOXLATE + // Write any previously found unknown XML + if (!areaSymbolization->GetUnknownXml().empty()) + { + fd << toCString(areaSymbolization->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOGridColor.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridColor.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOGridColor.cpp (revision 1038) @@ -24,6 +24,12 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, Color); +ELEM_MAP_ENTRY(2, Bands); +ELEM_MAP_ENTRY(3, ExplicitColor); +ELEM_MAP_ENTRY(4, Band); + IOGridColor::IOGridColor():colorRule(NULL) { } @@ -39,16 +45,29 @@ void IOGridColor::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"Color") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eColor: m_startElemName = name; + break; + + case eBands: + { + IOGridColorBands* pIO = new IOGridColorBands(colorRule); + handlerStack->push(pIO); + pIO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"Bands") // NOXLATE - { - IOGridColorBands* pIO = new IOGridColorBands(colorRule); - handlerStack->push(pIO); - pIO->StartElement(name, handlerStack); - } } void IOGridColor::ElementChars(const wchar_t *ch) @@ -71,6 +90,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->colorRule->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->colorRule = NULL; m_startElemName = L""; @@ -107,95 +129,13 @@ delete pIO; } - dectab(); - fd << tab() << "" << std::endl; // NOXLATE -} - -// -// IOGridColorBands -// -IOGridColorBands::IOGridColorBands():color(NULL),redChannel(NULL), greenChannel(NULL), blueChannel(NULL) -{ -} - -IOGridColorBands::IOGridColorBands(GridColorRule * colorRule): IOGridColor(colorRule),color(NULL), - redChannel(NULL), greenChannel(NULL), blueChannel(NULL) -{ -} - -IOGridColorBands::~IOGridColorBands() -{ - -} - -void IOGridColorBands::StartElement(const wchar_t *name, HandlerStack *handlerStack) -{ - m_currElemName = name; - if (m_currElemName == L"Bands") // NOXLATE + // Write any previously found unknown XML + if (!pColor->GetUnknownXml().empty()) { - m_startElemName = name; - this->color = new GridColorBands(); + fd << toCString(pColor->GetUnknownXml()); } - else if (m_currElemName == L"RedBand") // NOXLATE - { - redChannel = new ChannelBand(); - IOChannelBand* pIO = new IOChannelBand(redChannel, m_currElemName); - handlerStack->push(pIO); - pIO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"GreenBand") // NOXLATE - { - greenChannel = new ChannelBand(); - IOChannelBand* pIO = new IOChannelBand(greenChannel, m_currElemName); - handlerStack->push(pIO); - pIO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"BlueBand") // NOXLATE - { - blueChannel = new ChannelBand(); - IOChannelBand* pIO = new IOChannelBand(blueChannel, m_currElemName); - handlerStack->push(pIO); - pIO->StartElement(name, handlerStack); - } -} -void IOGridColorBands::ElementChars(const wchar_t *ch) -{ - -} - -void IOGridColorBands::EndElement(const wchar_t *name, HandlerStack *handlerStack) -{ - if (m_startElemName == name) - { - this->color->SetRedBand(*redChannel); - this->color->SetGreenBand(*greenChannel); - this->color->SetBlueBand(*blueChannel); - this->colorRule->AdoptGridColor(color); - handlerStack->pop(); - this->colorRule = NULL; - this->color = NULL; - m_startElemName = L""; - delete this; - } -} - -void IOGridColorBands::Write(MdfStream &fd, GridColorBands * pColor) -{ - fd << tab() << "" << std::endl; // NOXLATE - inctab(); - - std::auto_ptr spIO; - - spIO.reset(new IOChannelBand(L"RedBand")); // NOXLATE - spIO->Write(fd, &(pColor->GetRedBand())); - - spIO.reset(new IOChannelBand(L"GreenBand")); // NOXLATE - spIO->Write(fd, &(pColor->GetGreenBand())); - - spIO.reset(new IOChannelBand(L"BlueBand")); // NOXLATE - spIO->Write(fd, &(pColor->GetBlueBand())); - dectab(); - fd << tab() << "" << std::endl; // NOXLATE + fd << tab() << "" << std::endl; // NOXLATE } + Index: E:/MgDev/OS/Common/MdfParser/IOFill.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOFill.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOFill.cpp (revision 1038) @@ -22,6 +22,12 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, Fill); +ELEM_MAP_ENTRY(2, FillPattern); +ELEM_MAP_ENTRY(3, ForegroundColor); +ELEM_MAP_ENTRY(4, BackgroundColor); + IOFill::IOFill() { this->_fill = NULL; @@ -39,8 +45,21 @@ void IOFill::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"Fill") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) + { + case eFill: m_startElemName = name; + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; + } } void IOFill::ElementChars(const wchar_t *ch) @@ -57,6 +76,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_fill->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->_fill = NULL; m_startElemName = L""; @@ -84,6 +106,12 @@ fd << EncodeString(fill->GetBackgroundColor()); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!fill->GetUnknownXml().empty()) + { + fd << toCString(fill->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOAreaTypeStyle.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOAreaTypeStyle.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOAreaTypeStyle.cpp (revision 1038) @@ -23,6 +23,10 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, AreaTypeStyle); +ELEM_MAP_ENTRY(2, AreaRule); + IOAreaTypeStyle::IOAreaTypeStyle() { this->_areaTypeStyle = NULL; @@ -42,17 +46,30 @@ void IOAreaTypeStyle::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"AreaTypeStyle") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eAreaTypeStyle: m_startElemName = name; this->_areaTypeStyle = new AreaTypeStyle(); + break; + + case eAreaRule: + { + IOAreaRule *IO = new IOAreaRule(this->_areaTypeStyle); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"AreaRule") // NOXLATE - { - IOAreaRule *IO = new IOAreaRule(this->_areaTypeStyle); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOAreaTypeStyle::ElementChars(const wchar_t *ch) @@ -64,6 +81,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_areaTypeStyle->SetUnknownXml(UnknownXml()); + this->scaleRange->GetFeatureTypeStyles()->Adopt(this->_areaTypeStyle); handlerStack->pop(); this->scaleRange = NULL; @@ -86,6 +106,12 @@ delete IO; } + // Write any previously found unknown XML + if (!areaTypeStyle->GetUnknownXml().empty()) + { + fd << toCString(areaTypeStyle->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOHillShade.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOHillShade.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOHillShade.cpp (revision 1038) @@ -22,6 +22,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, HillShade); +ELEM_MAP_ENTRY(2, Band); +ELEM_MAP_ENTRY(3, Azimuth); +ELEM_MAP_ENTRY(4, Altitude); +ELEM_MAP_ENTRY(5, ScaleFactor); + IOHillShade::IOHillShade():colorStyle(NULL),hillShade(NULL) { } @@ -37,10 +44,21 @@ void IOHillShade::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"HillShade") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eHillShade: m_startElemName = name; this->hillShade = new HillShade(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -60,6 +78,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->hillShade->SetUnknownXml(UnknownXml()); + this->colorStyle->AdoptHillShade(this->hillShade); handlerStack->pop(); this->colorStyle = NULL; @@ -97,6 +118,12 @@ fd << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!pHillShade->GetUnknownXml().empty()) + { + fd << toCString(pHillShade->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOChannelBand.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOChannelBand.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOChannelBand.cpp (revision 1038) @@ -22,6 +22,18 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +// From Grid Color - Start Elements +ELEM_MAP_ENTRY(1, RedBand); +ELEM_MAP_ENTRY(2, GreenBand); +ELEM_MAP_ENTRY(3, BlueBand); +// Local Elements +ELEM_MAP_ENTRY(4, Band); +ELEM_MAP_ENTRY(5, LowBand); +ELEM_MAP_ENTRY(6, HighBand); +ELEM_MAP_ENTRY(7, LowChannel); +ELEM_MAP_ENTRY(8, HighChannel); + IOChannelBand::IOChannelBand(const std::wstring &strElemName) : m_pChannel(NULL), m_strElemName(strElemName) { @@ -39,11 +51,24 @@ void IOChannelBand::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == m_strElemName) + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eRedBand: + case eGreenBand: + case eBlueBand: m_startElemName = name; if (NULL == this->m_pChannel) m_pChannel = new ChannelBand(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -70,6 +95,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_pChannel->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->m_pChannel = NULL; m_startElemName = L""; @@ -115,6 +143,11 @@ fd << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!pChannel->GetUnknownXml().empty()) + { + fd << toCString(pChannel->GetUnknownXml()); + } dectab(); fd << tab() << "m_strElemName) << '>' << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOAreaRule.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOAreaRule.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOAreaRule.cpp (revision 1038) @@ -24,6 +24,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, AreaRule); +ELEM_MAP_ENTRY(2, AreaSymbolization2D); +ELEM_MAP_ENTRY(3, Label); +ELEM_MAP_ENTRY(4, LegendLabel); +ELEM_MAP_ENTRY(5, Filter); + IOAreaRule::IOAreaRule() { this->_areaRule = NULL; @@ -43,24 +50,38 @@ void IOAreaRule::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"AreaRule") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eAreaRule: m_startElemName = name; this->_areaRule = new AreaRule(); + break; + case eAreaSymbolization2D: + { + IOAreaSymbolization2D *IO = new IOAreaSymbolization2D(this->_areaRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eLabel: + { + IOLabel *IO = new IOLabel(this->_areaRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"AreaSymbolization2D") // NOXLATE - { - IOAreaSymbolization2D *IO = new IOAreaSymbolization2D(this->_areaRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"Label") // NOXLATE - { - IOLabel *IO = new IOLabel(this->_areaRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOAreaRule::ElementChars(const wchar_t *ch) @@ -75,6 +96,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_areaRule->SetUnknownXml(UnknownXml()); + this->areaTypeStyle->GetRules()->Adopt(this->_areaRule); handlerStack->pop(); this->areaTypeStyle= NULL; @@ -116,6 +140,12 @@ IO->Write(fd, symbolization); delete IO; + // Write any previously found unknown XML + if (!areaRule->GetUnknownXml().empty()) + { + fd << toCString(areaRule->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IODrawingLayerDefinition.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IODrawingLayerDefinition.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IODrawingLayerDefinition.cpp (revision 1038) @@ -23,6 +23,15 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, DrawingLayerDefinition); +ELEM_MAP_ENTRY(2, Opacity); +ELEM_MAP_ENTRY(3, ResourceId); +ELEM_MAP_ENTRY(4, Sheet); +ELEM_MAP_ENTRY(5, LayerFilter); +ELEM_MAP_ENTRY(6, MinScale); +ELEM_MAP_ENTRY(7, MaxScale); + IODrawingLayerDefinition::IODrawingLayerDefinition() { this->_layer = NULL; @@ -40,9 +49,20 @@ void IODrawingLayerDefinition::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"DrawingLayerDefinition") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eDrawingLayerDefinition: m_startElemName = name; + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -66,6 +86,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_layer->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->_layer = NULL; m_startElemName = L""; @@ -123,6 +146,12 @@ fd << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!drawingLayer->GetUnknownXml().empty()) + { + fd << toCString(drawingLayer->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE Index: E:/MgDev/OS/Common/MdfParser/IOPointSymbolization2D.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOPointSymbolization2D.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOPointSymbolization2D.cpp (revision 1038) @@ -28,6 +28,14 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, PointSymbolization2D); +ELEM_MAP_ENTRY(2, Mark); +ELEM_MAP_ENTRY(3, Image); +ELEM_MAP_ENTRY(4, Font); +ELEM_MAP_ENTRY(5, W2D); +ELEM_MAP_ENTRY(6, Block); + IOPointSymbolization2D::IOPointSymbolization2D() { this->_PointSymbolization2D = NULL; @@ -49,23 +57,37 @@ void IOPointSymbolization2D::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"PointSymbolization2D") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + if (m_currElemId == ePointSymbolization2D) { m_startElemName = name; this->_PointSymbolization2D = new PointSymbolization2D(); } + else if (m_currElemId == eUnknown) + { + ParseUnknownXml(name, handlerStack); + } else { - if (m_currElemName == L"Mark") // NOXLATE + switch (m_currElemId) + { + case eMark: this->ioSymbol = new IOMarkSymbol(); - else if (m_currElemName == L"Image") // NOXLATE + break; + case eImage: this->ioSymbol = new IOImageSymbol(); - else if (m_currElemName == L"Font") // NOXLATE + break; + case eFont: this->ioSymbol = new IOFontSymbol(); - else if (m_currElemName == L"W2D") // NOXLATE + break; + case eW2D: this->ioSymbol = new IOW2DSymbol(); - else if (m_currElemName == L"Block") // NOXLATE + break; + case eBlock: this->ioSymbol = new IOBlockSymbol(); + break; + } if (this->ioSymbol) { handlerStack->push(this->ioSymbol); @@ -84,6 +106,9 @@ { if (this->_PointSymbolization2D != NULL) { + if (!UnknownXml().empty()) + this->_PointSymbolization2D->SetUnknownXml(UnknownXml()); + this->pointRule->AdoptSymbolization(this->_PointSymbolization2D); if (this->ioSymbol != NULL) { @@ -122,6 +147,12 @@ else if (blockSymbol) IOBlockSymbol::Write(fd, blockSymbol); + // Write any previously found unknown XML + if (!PointSymbolization2D->GetUnknownXml().empty()) + { + fd << toCString(PointSymbolization2D->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOExtension.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOExtension.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOExtension.cpp (revision 1038) @@ -24,6 +24,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, Extension); +ELEM_MAP_ENTRY(2, CalculatedProperty); +ELEM_MAP_ENTRY(3, AttributeRelate); +ELEM_MAP_ENTRY(4, Name); +ELEM_MAP_ENTRY(5, FeatureClass); + IOExtension::IOExtension() : m_pExtension(NULL), m_pFeatureSource(NULL) { @@ -41,26 +48,37 @@ void IOExtension::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"Extension") // NOXLATE - { - m_startElemName = name; - m_pExtension = new Extension(); + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eExtension: + m_startElemName = name; + m_pExtension = new Extension(); + break; + + case eCalculatedProperty: + { + IOCalculatedProperty *IO = new IOCalculatedProperty(this->m_pExtension); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eAttributeRelate: + { + IOAttributeRelate *IO = new IOAttributeRelate(this->m_pExtension); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else - { - if (m_currElemName == L"CalculatedProperty") // NOXLATE - { - IOCalculatedProperty *IO = new IOCalculatedProperty(this->m_pExtension); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"AttributeRelate") // NOXLATE - { - IOAttributeRelate *IO = new IOAttributeRelate(this->m_pExtension); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - } } void IOExtension::ElementChars(const wchar_t *ch) @@ -75,6 +93,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + m_pExtension->SetUnknownXml(UnknownXml()); + m_pFeatureSource->GetExtensions()->Adopt(m_pExtension); handlerStack->pop(); this->m_pExtension = NULL; @@ -112,7 +133,14 @@ spIO->Write(fd, pExtension->GetAttributeRelates()->GetAt(x)); } + // Write any previously found unknown XML + if (!pExtension->GetUnknownXml().empty()) + { + fd << toCString(pExtension->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } + Index: E:/MgDev/OS/Common/MdfParser/IOGridColorRule.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridColorRule.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOGridColorRule.cpp (revision 1038) @@ -25,6 +25,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, ColorRule); +ELEM_MAP_ENTRY(2, Color); +ELEM_MAP_ENTRY(3, Label); +ELEM_MAP_ENTRY(4, LegendLabel); +ELEM_MAP_ENTRY(5, Filter); + IOGridColorRule::IOGridColorRule():colorStyle(NULL), colorRule(NULL) { } @@ -40,23 +47,38 @@ void IOGridColorRule::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"ColorRule") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eColorRule: m_startElemName = name; this->colorRule = new GridColorRule(); + break; + + case eColor: + { + IOGridColor *IO = new IOGridColor(this->colorRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eLabel: + { + IOLabel *IO = new IOLabel(this->colorRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"Color") // NOXLATE - { - IOGridColor *IO = new IOGridColor(this->colorRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"Label") // NOXLATE - { - IOLabel *IO = new IOLabel(this->colorRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOGridColorRule::ElementChars(const wchar_t *ch) @@ -71,6 +93,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->colorRule->SetUnknownXml(UnknownXml()); + this->colorStyle->GetRules()->Adopt(this->colorRule); handlerStack->pop(); this->colorStyle = NULL; @@ -110,6 +135,12 @@ pIO->Write(fd, pColorRule->GetGridColor()); delete pIO; + // Write any previously found unknown XML + if (!pColorRule->GetUnknownXml().empty()) + { + fd << toCString(pColorRule->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOUtil.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOUtil.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOUtil.cpp (revision 1038) @@ -159,4 +159,20 @@ return std::string("false"); // NOXLATE } +std::string startStr(const std::string elementName) +{ + std::string out("<"); // NOXLATE + out.append(elementName); + out.append(">"); // NOXLATE + return out; +} + +std::string endStr(const std::string elementName) +{ + std::string out(""); // NOXLATE + return out; +} + END_NAMESPACE_MDFPARSER Index: E:/MgDev/OS/Common/MdfParser/IOLineRule.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOLineRule.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOLineRule.cpp (revision 1038) @@ -24,6 +24,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, LineRule); +ELEM_MAP_ENTRY(2, LineSymbolization2D); +ELEM_MAP_ENTRY(3, Label); +ELEM_MAP_ENTRY(4, LegendLabel); +ELEM_MAP_ENTRY(5, Filter); + IOLineRule::IOLineRule() { this->_lineRule = NULL; @@ -43,23 +50,38 @@ void IOLineRule::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"LineRule") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eLineRule: m_startElemName = name; this->_lineRule = new LineRule(); + break; + + case eLineSymbolization2D: + { + IOLineSymbolization2D *IO = new IOLineSymbolization2D(this->_lineRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eLabel: + { + IOLabel *IO = new IOLabel(this->_lineRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"LineSymbolization2D") // NOXLATE - { - IOLineSymbolization2D *IO = new IOLineSymbolization2D(this->_lineRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"Label") // NOXLATE - { - IOLabel *IO = new IOLabel(this->_lineRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOLineRule::ElementChars(const wchar_t *ch) @@ -74,6 +96,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_lineRule->SetUnknownXml(UnknownXml()); + this->lineTypeStyle->GetRules()->Adopt(this->_lineRule); handlerStack->pop(); this->lineTypeStyle= NULL; @@ -116,6 +141,12 @@ delete IO; } + // Write any previously found unknown XML + if (!lineRule->GetUnknownXml().empty()) + { + fd << toCString(lineRule->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOW2DSymbol.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOW2DSymbol.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOW2DSymbol.cpp (revision 1038) @@ -25,6 +25,23 @@ // When a W2DSymbol is successfully parsed by this class, it must be accessed by the // parent class and then managed appropriately. It will not be deleted by this class. +CREATE_ELEMENT_MAP; +// Inherited Symbol Elements +ELEM_MAP_ENTRY(1, Unit); +ELEM_MAP_ENTRY(2, SizeContext); +ELEM_MAP_ENTRY(3, SizeX); +ELEM_MAP_ENTRY(4, SizeY); +ELEM_MAP_ENTRY(5, InsertionPointX); +ELEM_MAP_ENTRY(6, InsertionPointY); +ELEM_MAP_ENTRY(7, Rotation); +ELEM_MAP_ENTRY(8, MaintainAspect); +// Local Elements +ELEM_MAP_ENTRY(9, W2D); +ELEM_MAP_ENTRY(10, W2DSymbol); +ELEM_MAP_ENTRY(11, FillColor); +ELEM_MAP_ENTRY(12, LineColor); +ELEM_MAP_ENTRY(13, TextColor); + IOW2DSymbol::IOW2DSymbol() : IOSymbol() { this->m_ioResourceRef = NULL; @@ -33,17 +50,30 @@ void IOW2DSymbol::StartElement(const wchar_t *name, HandlerStack *handlerStack) { this->m_currElemName = name; - if (this->m_currElemName == L"W2D") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eW2D: this->m_startElemName = name; this->m_symbol = new W2DSymbol(L"", L""); + break; + + case eW2DSymbol: + { + this->m_ioResourceRef = new IOResourceRef(name); + handlerStack->push(this->m_ioResourceRef); + this->m_ioResourceRef->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (this->m_currElemName == L"W2DSymbol") // NOXLATE - { - this->m_ioResourceRef = new IOResourceRef(name); - handlerStack->push(this->m_ioResourceRef); - this->m_ioResourceRef->StartElement(name, handlerStack); - } } void IOW2DSymbol::ElementChars(const wchar_t *ch) @@ -63,6 +93,9 @@ { if (this->m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_symbol->SetUnknownXml(UnknownXml()); + // copy the values found by the IOResourceRef into our symbol W2DSymbol* symbol = static_cast(this->m_symbol); if (this->m_ioResourceRef) @@ -112,6 +145,12 @@ fd << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!symbol->GetUnknownXml().empty()) + { + fd << toCString(symbol->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOFontSymbol.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOFontSymbol.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOFontSymbol.cpp (revision 1038) @@ -25,13 +25,43 @@ // When a FontSymbol is successfully parsed by this class, it must be accessed by the // parent class and then managed appropriately. It will not be deleted by this class. +CREATE_ELEMENT_MAP; +// Inherited Symbol Elements +ELEM_MAP_ENTRY(1, Unit); +ELEM_MAP_ENTRY(2, SizeContext); +ELEM_MAP_ENTRY(3, SizeX); +ELEM_MAP_ENTRY(4, SizeY); +ELEM_MAP_ENTRY(5, InsertionPointX); +ELEM_MAP_ENTRY(6, InsertionPointY); +ELEM_MAP_ENTRY(7, Rotation); +ELEM_MAP_ENTRY(8, MaintainAspect); +// Local Elements +ELEM_MAP_ENTRY(9, Font); +ELEM_MAP_ENTRY(10, FontName); +ELEM_MAP_ENTRY(11, Character); +ELEM_MAP_ENTRY(12, Bold); +ELEM_MAP_ENTRY(13, Italic); +ELEM_MAP_ENTRY(14, Underlined); +ELEM_MAP_ENTRY(15, ForegroundColor); + void IOFontSymbol::StartElement(const wchar_t *name, HandlerStack *handlerStack) { this->m_currElemName = name; - if (this->m_currElemName == L"Font") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eFont: this->m_startElemName = name; this->m_symbol = new FontSymbol(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -58,6 +88,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_symbol->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->m_startElemName = L""; } @@ -112,6 +145,12 @@ fd << EncodeString(symbol->GetForegroundColor()); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!symbol->GetUnknownXml().empty()) + { + fd << toCString(symbol->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOLineSymbolization2D.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOLineSymbolization2D.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOLineSymbolization2D.cpp (revision 1038) @@ -23,6 +23,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, LineSymbolization2D); +ELEM_MAP_ENTRY(2, LineStyle); +ELEM_MAP_ENTRY(3, Thickness); +ELEM_MAP_ENTRY(4, Color); +ELEM_MAP_ENTRY(5, Unit); + IOLineSymbolization2D::IOLineSymbolization2D() { this->_lineSymbolization = NULL; @@ -42,10 +49,21 @@ void IOLineSymbolization2D::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"LineSymbolization2D") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eLineSymbolization2D: m_startElemName = name; this->_lineSymbolization = new LineSymbolization2D(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -68,6 +86,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_lineSymbolization->SetUnknownXml(UnknownXml()); + this->lineRule->GetSymbolizations()->Adopt(this->_lineSymbolization); handlerStack->pop(); this->lineRule= NULL; @@ -81,5 +102,38 @@ { //Property: Stroke if (lineSymbolization->GetStroke()) - IOStroke::Write(fd, lineSymbolization->GetStroke(), "LineSymbolization2D"); // NOXLATE + { + fd << tab() << startStr(sLineSymbolization2D) << std::endl; + inctab(); + + //Property: LineStyle + fd << tab() << startStr(sLineStyle); + fd << EncodeString(lineSymbolization->GetStroke()->GetLineStyle()); + fd << endStr(sLineStyle) << std::endl; + + //Property: Thickness + fd << tab() << startStr(sThickness); + fd << EncodeString(lineSymbolization->GetStroke()->GetThickness()); + fd << endStr(sThickness) << std::endl; + + //Property: ForegroundColor + fd << tab() << startStr(sColor); + fd << EncodeString(lineSymbolization->GetStroke()->GetColor()); + fd << endStr(sColor) << std::endl; + + //Property: Unit + fd << tab() << startStr(sUnit); + std::auto_ptr str(LengthConverter::UnitToEnglish(lineSymbolization->GetStroke()->GetUn it())); + fd << EncodeString(*str); + fd << endStr(sUnit) << std::endl; + + // Write any previously found unknown XML + if (!lineSymbolization->GetUnknownXml().empty()) + { + fd << toCString(lineSymbolization->GetUnknownXml()); + } + + dectab(); + fd << tab() << endStr(sLineSymbolization2D) << std::endl; + } } Index: E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.h =================================================================== --- E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.h (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.h (revision 1038) @@ -69,19 +69,14 @@ // Unfortunately, the SAX2 Parser doesn't necessarily send all the // characters that appear inside a tag in one call of characters()- // for example with escape characters it separates them into separate calls. - // Therefore, m_strbuffer is used to accumulate the characters, openTag and - // prevOpenTag are used to determine if we're still reading characters in the - // same open tag, and tagOpen and charsInTag are used in the case when you have - // no characters in between a tag (i.e. ) to make sure - // that whitespace or line returns don't get assigned to it instead. + // Therefore, m_strbuffer is used to accumulate the characters. tagOpen is + // used in the case when you have characters outside a tag (i.e. ) + // to make sure that whitespace or line returns don't get assigned to it instead. std::wstring m_strbuffer; - - std::wstring m_openTag; - std::wstring m_prevOpenTag; - MdfString m_strParserError; bool m_tagOpen; - bool m_charsInTag; + MdfString m_strParserError; + void WriteDefinition(FeatureSource *pFeatureSource, MdfStream &fd); // error handling override Index: E:/MgDev/OS/Common/MdfParser/IOUnknown.h =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOUnknown.h (revision 0) +++ E:/MgDev/OS/Common/MdfParser/IOUnknown.h (revision 1038) @@ -0,0 +1,43 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#ifndef _IOUNKNOWN_H +#define _IOUNKNOWN_H + +#include "SAX2ElementHandler.h" + +using namespace XERCES_CPP_NAMESPACE; +using namespace MDFMODEL_NAMESPACE; + +BEGIN_NAMESPACE_MDFPARSER + +class IOUnknown : public SAX2ElementHandler +{ + private: + std::wstring* _xml; + + public: + IOUnknown(std::wstring* xml); + ~IOUnknown(); + + virtual void StartElement(const wchar_t *name, HandlerStack *handlerStack); + virtual void ElementChars(const wchar_t *ch); + virtual void EndElement(const wchar_t *name, HandlerStack *handlerStack); +}; + +END_NAMESPACE_MDFPARSER +#endif // _IOUNKNOWN_H Property changes on: E:\MgDev\OS\Common\MdfParser\IOUnknown.h ___________________________________________________________________ Name: svn:eol-style + native Index: E:/MgDev/OS/Common/MdfParser/IOStroke.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOStroke.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOStroke.cpp (revision 1038) @@ -24,6 +24,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, Stroke); +ELEM_MAP_ENTRY(2, LineStyle); +ELEM_MAP_ENTRY(3, Thickness); +ELEM_MAP_ENTRY(4, Color); +ELEM_MAP_ENTRY(5, Unit); + IOStroke::IOStroke(std::wstring elementName) { this->_stroke = NULL; @@ -42,9 +49,25 @@ void IOStroke::StartElement(const wchar_t *name, HandlerStack *handlerStack) { + // Note: this->m_elementName is not part of the Element Map, so the + // eStroke value is substituted - but sStroke will not be the correct + // string, and cannot not be used in place of m_elementName. + m_currElemName = name; if (m_currElemName == this->m_elementName) + { + m_currElemId = eStroke; m_startElemName = name; + } + else + { + m_currElemId = _ElementIdFromName(name); + } + + if (eUnknown == m_currElemId) + { + ParseUnknownXml(name, handlerStack); + } } void IOStroke::ElementChars(const wchar_t *ch) @@ -66,6 +89,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_stroke->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->_stroke = NULL; m_startElemName = L""; @@ -99,6 +125,12 @@ fd << EncodeString(*str); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!stroke->GetUnknownXml().empty()) + { + fd << toCString(stroke->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOImageSymbol.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOImageSymbol.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOImageSymbol.cpp (revision 1038) @@ -25,6 +25,20 @@ // When a ImageSymbol is successfully parsed by this class, it must be accessed by the // parent class and then managed appropriately. It will not be deleted by this class. +CREATE_ELEMENT_MAP; +// Inherited Symbol Elements +ELEM_MAP_ENTRY(1, Unit); +ELEM_MAP_ENTRY(2, SizeContext); +ELEM_MAP_ENTRY(3, SizeX); +ELEM_MAP_ENTRY(4, SizeY); +ELEM_MAP_ENTRY(5, InsertionPointX); +ELEM_MAP_ENTRY(6, InsertionPointY); +ELEM_MAP_ENTRY(7, Rotation); +ELEM_MAP_ENTRY(8, MaintainAspect); +// Local Elements +ELEM_MAP_ENTRY(9, Image); +ELEM_MAP_ENTRY(10, Content); + IOImageSymbol::IOImageSymbol() : IOSymbol() { this->m_ioResourceRef = NULL; @@ -33,6 +47,8 @@ void IOImageSymbol::StartElement(const wchar_t *name, HandlerStack *handlerStack) { this->m_currElemName = name; + m_currElemId = _ElementIdFromName(name); + // it's a pain to have the "Image" element contain an "Image" element if (this->m_currElemName == L"Image" && this->m_startElemName != L"Image") // NOXLATE { @@ -45,6 +61,10 @@ handlerStack->push(this->m_ioResourceRef); this->m_ioResourceRef->StartElement(name, handlerStack); } + else if (eUnknown == m_currElemId) + { + ParseUnknownXml(name, handlerStack); + } } void IOImageSymbol::ElementChars(const wchar_t *ch) @@ -60,6 +80,9 @@ { if (this->m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_symbol->SetUnknownXml(UnknownXml()); + // copy the values found by the IOResourceRef into our symbol ImageSymbol* symbol = static_cast(this->m_symbol); if (this->m_ioResourceRef) @@ -95,6 +118,12 @@ fd << "" << std::endl; // NOXLATE } + // Write any previously found unknown XML + if (!symbol->GetUnknownXml().empty()) + { + fd << toCString(symbol->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOVectorLayerDefinition.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOVectorLayerDefinition.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOVectorLayerDefinition.cpp (revision 1038) @@ -24,11 +24,26 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, VectorLayerDefinition); +ELEM_MAP_ENTRY(2, PropertyMapping); +ELEM_MAP_ENTRY(3, VectorScaleRange); +ELEM_MAP_ENTRY(4, Opacity); +ELEM_MAP_ENTRY(5, ResourceId); +ELEM_MAP_ENTRY(6, FeatureName); +ELEM_MAP_ENTRY(7, FeatureNameType); +ELEM_MAP_ENTRY(8, Geometry); +ELEM_MAP_ENTRY(9, Url); +ELEM_MAP_ENTRY(10, ToolTip); +ELEM_MAP_ENTRY(11, Filter); + + IOVectorLayerDefinition::IOVectorLayerDefinition() { this->_layer = NULL; } + IOVectorLayerDefinition::IOVectorLayerDefinition(VectorLayerDefinition *layer) { this->_layer = layer; @@ -41,53 +56,88 @@ void IOVectorLayerDefinition::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"VectorLayerDefinition") // NOXLATE - { - m_startElemName = name; + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eVectorLayerDefinition: + m_startElemName = name; + break; + + case ePropertyMapping: + { + IONameStringPair *IO = new IONameStringPair(this->_layer); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eVectorScaleRange: + { + IOVectorScaleRange *IO = new IOVectorScaleRange(this->_layer); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"PropertyMapping") // NOXLATE - { - IONameStringPair *IO = new IONameStringPair(this->_layer); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"VectorScaleRange") // NOXLATE - { - IOVectorScaleRange *IO = new IOVectorScaleRange(this->_layer); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOVectorLayerDefinition::ElementChars(const wchar_t *ch) { - if (m_currElemName == L"Opacity") // NOXLATE - (this->_layer)->SetOpacity(wstrToDouble(ch)); - else if (m_currElemName == L"ResourceId") // NOXLATE - (this->_layer)->SetResourceID(ch); - else if (m_currElemName == L"FeatureName") // NOXLATE - (this->_layer)->SetFeatureName(ch); - else if (m_currElemName == L"FeatureNameType") // NOXLATE - { - if (::wcscmp(ch, L"FeatureClass") == 0) // NOXLATE - _layer->SetFeatureNameType(VectorLayerDefinition::FeatureClass); - else if (::wcscmp(ch, L"NamedExtension") == 0) // NOXLATE - _layer->SetFeatureNameType(VectorLayerDefinition::NamedExtension); + switch (m_currElemId) { + case eOpacity: + (this->_layer)->SetOpacity(wstrToDouble(ch)); + break; + + case eResourceId: + (this->_layer)->SetResourceID(ch); + break; + + case eFeatureName: + (this->_layer)->SetFeatureName(ch); + break; + + case eFeatureNameType: + if (::wcscmp(ch, L"FeatureClass") == 0) // NOXLATE + _layer->SetFeatureNameType(VectorLayerDefinition::FeatureClass); + else if (::wcscmp(ch, L"NamedExtension") == 0) // NOXLATE + _layer->SetFeatureNameType(VectorLayerDefinition::NamedExtension); + break; + + case eGeometry: + (this->_layer)->SetGeometry(ch); + break; + + case eUrl: + (this->_layer)->SetUrl(ch); + break; + + case eToolTip: + (this->_layer)->SetToolTip(ch); + break; + + case eFilter: + (this->_layer)->SetFilter(ch); + break; + + default: + break; } - else if (m_currElemName == L"Geometry") // NOXLATE - (this->_layer)->SetGeometry(ch); // NOXLATE - else if (m_currElemName == L"Url") // NOXLATE - (this->_layer)->SetUrl(ch); - else if (m_currElemName == L"ToolTip") // NOXLATE - (this->_layer)->SetToolTip(ch); - else if (m_currElemName == L"Filter") // NOXLATE - (this->_layer)->SetFilter(ch); } void IOVectorLayerDefinition::EndElement(const wchar_t *name, HandlerStack *handlerStack) { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_layer->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->_layer = NULL; m_startElemName = L""; @@ -100,74 +150,74 @@ fd << tab() << "" << std::endl; // NOXLATE inctab(); - fd << tab() << "" << std::endl; // NOXLATE + fd << tab() << startStr(sVectorLayerDefinition) << std::endl; inctab(); //Property: ResourceId - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sResourceId); fd << EncodeString(featureLayer->GetResourceID()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sResourceId) << std::endl; //Property: Opacity (optional) if (featureLayer->GetOpacity() != 1.0) { - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sOpacity); fd << DoubleToStr(featureLayer->GetOpacity()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sOpacity) << std::endl; } //Property: FeatureName - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sFeatureName); fd << EncodeString(featureLayer->GetFeatureName()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sFeatureName) << std::endl; //Property: FeatureNameType - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sFeatureNameType); if (featureLayer->GetFeatureNameType() == VectorLayerDefinition::FeatureClass) fd << "FeatureClass"; // NOXLATE else fd << "NamedExtension"; // NOXLATE - fd << "" << std::endl; // NOXLATE + fd << endStr(sFeatureNameType) << std::endl; //Property: Filter if (featureLayer->GetFilter().length() > 0) { - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sFilter); fd << EncodeString(featureLayer->GetFilter()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sFilter) << std::endl; } //Property: PropertyMappings for (int x = 0; x < featureLayer->GetPropertyMappings()->GetCount(); x++) { - fd << tab() << "" << std::endl; // NOXLATE + fd << tab() << startStr(sPropertyMapping) << std::endl; inctab(); IONameStringPair * IO = new IONameStringPair(); IO->Write(fd, featureLayer->GetPropertyMappings()->GetAt(x)); delete IO; dectab(); - fd << tab() << "" << std::endl; // NOXLATE + fd << tab() << endStr(sPropertyMapping) << std::endl; } //Property: Geometry - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sGeometry); fd << EncodeString(featureLayer->GetGeometry()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sGeometry) << std::endl; //Property: Url if (featureLayer->GetUrl().length() > 0) { - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sUrl); fd << EncodeString(featureLayer->GetUrl()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sUrl) << std::endl; } //Property: ToolTip if (featureLayer->GetToolTip().length() > 0) { - fd << tab() << ""; // NOXLATE + fd << tab() << startStr(sToolTip); fd << EncodeString(featureLayer->GetToolTip()); - fd << "" << std::endl; // NOXLATE + fd << endStr(sToolTip) << std::endl; } //Property: VectorScaleRange @@ -178,8 +228,14 @@ delete IO; } + // Write any previously found unknown XML + if (!featureLayer->GetUnknownXml().empty()) + { + fd << toCString(featureLayer->GetUnknownXml()); + } + dectab(); - fd << tab() << "" << std::endl; // NOXLATE + fd << tab() << endStr(sVectorLayerDefinition) << std::endl; // NOXLATE dectab(); fd << tab() << "" << std::endl; // NOXLATE Index: E:/MgDev/OS/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp (revision 1038) @@ -22,6 +22,10 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, SupplementalSpatialContextInfo); +ELEM_MAP_ENTRY(2, Name); +ELEM_MAP_ENTRY(3, CoordinateSystem); IOSupplementalSpatialContextInfo::IOSupplementalSpatialContextInfo() : _ssContextInfo(NULL), featureSource(NULL) @@ -40,13 +44,24 @@ void IOSupplementalSpatialContextInfo::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (NULL != featureSource) + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { - if (m_currElemName == L"SupplementalSpatialContextInfo") // NOXLATE + case eSupplementalSpatialContextInfo: + if (NULL != featureSource) { m_startElemName = name; this->_ssContextInfo = new SupplementalSpatialContextInfo(L"", L""); } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -62,6 +77,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_ssContextInfo->SetUnknownXml(UnknownXml()); + if (NULL != this->featureSource) this->featureSource->GetSupplementalSpatialContextInfo()->Adopt(this->_s sContextInfo); @@ -83,4 +101,10 @@ fd << tab() << ""; // NOXLATE fd << EncodeString(ssContextInfo->GetCoordinateSystem()); fd << "" << std::endl; // NOXLATE + + // Write any previously found unknown XML + if (!ssContextInfo->GetUnknownXml().empty()) + { + fd << toCString(ssContextInfo->GetUnknownXml()); + } } Index: E:/MgDev/OS/Common/MdfParser/IOGridScaleRange.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridScaleRange.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOGridScaleRange.cpp (revision 1038) @@ -27,6 +27,14 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, GridScaleRange); +ELEM_MAP_ENTRY(2, SurfaceStyle); +ELEM_MAP_ENTRY(3, ColorStyle); +ELEM_MAP_ENTRY(4, MinScale); +ELEM_MAP_ENTRY(5, MaxScale); +ELEM_MAP_ENTRY(6, RebuildFactor); + IOGridScaleRange::IOGridScaleRange():_scaleRange(NULL), layer(NULL) { } @@ -42,25 +50,37 @@ void IOGridScaleRange::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"GridScaleRange") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eGridScaleRange: m_startElemName = name; this->_scaleRange = new GridScaleRange(); - } - else - { - if (m_currElemName == L"SurfaceStyle") // NOXLATE + break; + + case eSurfaceStyle: { IOGridSurfaceStyle *IO = new IOGridSurfaceStyle(this->_scaleRange); handlerStack->push(IO); IO->StartElement(name, handlerStack); } - else if (m_currElemName == L"ColorStyle") // NOXLATE + break; + + case eColorStyle: { IOGridColorStyle *IO = new IOGridColorStyle(this->_scaleRange); handlerStack->push(IO); IO->StartElement(name, handlerStack); } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -78,6 +98,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_scaleRange->SetUnknownXml(UnknownXml()); + this->layer->GetScaleRanges()->Adopt(this->_scaleRange); handlerStack->pop(); this->layer = NULL; @@ -131,6 +154,12 @@ fd << DoubleToStr(scaleRange->GetRebuildFactor()); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!scaleRange->GetUnknownXml().empty()) + { + fd << toCString(scaleRange->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOGridSurfaceStyle.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOGridSurfaceStyle.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOGridSurfaceStyle.cpp (revision 1038) @@ -23,6 +23,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, SurfaceStyle); +ELEM_MAP_ENTRY(2, Band); +ELEM_MAP_ENTRY(3, ZeroValue); +ELEM_MAP_ENTRY(4, ScaleFactor); +ELEM_MAP_ENTRY(5, DefaultColor); + IOGridSurfaceStyle::IOGridSurfaceStyle():surfaceStyle(NULL), scaleRange(NULL) { } @@ -38,10 +45,21 @@ void IOGridSurfaceStyle::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"SurfaceStyle") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eSurfaceStyle: m_startElemName = name; this->surfaceStyle = new GridSurfaceStyle(); + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -61,7 +79,10 @@ { if (m_startElemName == name) { - //this->scaleRange->GetGridStyles()->Adopt(this->surfaceStyle); + if (!UnknownXml().empty()) + this->surfaceStyle->SetUnknownXml(UnknownXml()); + + //this->scaleRange->GetGridStyles()->Adopt(this->surfaceStyle); this->scaleRange->AdoptSurfaceStyle(this->surfaceStyle); handlerStack->pop(); this->scaleRange = NULL; @@ -102,6 +123,12 @@ fd << EncodeString(pSurfaceStyle->GetDefaultColor()); fd << "" << std::endl; // NOXLATE + // Write any previously found unknown XML + if (!pSurfaceStyle->GetUnknownXml().empty()) + { + fd << toCString(pSurfaceStyle->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOMarkSymbol.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOMarkSymbol.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOMarkSymbol.cpp (revision 1038) @@ -27,6 +27,23 @@ // When a MarkSymbol is successfully parsed by this class, it must be accessed by the // parent class and then managed appropriately. It will not be deleted by this class. +CREATE_ELEMENT_MAP; +// Inherited Symbol Elements +ELEM_MAP_ENTRY(1, Unit); +ELEM_MAP_ENTRY(2, SizeContext); +ELEM_MAP_ENTRY(3, SizeX); +ELEM_MAP_ENTRY(4, SizeY); +ELEM_MAP_ENTRY(5, InsertionPointX); +ELEM_MAP_ENTRY(6, InsertionPointY); +ELEM_MAP_ENTRY(7, Rotation); +ELEM_MAP_ENTRY(8, MaintainAspect); +// Local Elements +ELEM_MAP_ENTRY(9, Mark); +ELEM_MAP_ENTRY(10, Fill); +ELEM_MAP_ENTRY(11, Edge); +ELEM_MAP_ENTRY(12, Shape); + + IOMarkSymbol::IOMarkSymbol() : IOSymbol() { this->m_ioStroke = NULL; @@ -36,30 +53,47 @@ void IOMarkSymbol::StartElement(const wchar_t *name, HandlerStack *handlerStack) { this->m_currElemName = name; - if (this->m_currElemName == L"Mark") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { - this->m_startElemName = name; - MarkSymbol* markSymbol = new MarkSymbol(MarkSymbol::Square); - delete markSymbol->OrphanFill(); - delete markSymbol->OrphanEdge(); - this->m_symbol = markSymbol; + case eMark: + { + this->m_startElemName = name; + MarkSymbol* markSymbol = new MarkSymbol(MarkSymbol::Square); + delete markSymbol->OrphanFill(); + delete markSymbol->OrphanEdge(); + this->m_symbol = markSymbol; + } + break; + + case eFill: + { + MarkSymbol* symbol = static_cast(this->m_symbol); + symbol->AdoptFill(new Fill()); + this->m_ioFill = new IOFill(symbol->GetFill()); + handlerStack->push(this->m_ioFill); + this->m_ioFill->StartElement(name, handlerStack); + } + break; + + case eEdge: + { + MarkSymbol* symbol = static_cast(this->m_symbol); + symbol->AdoptEdge(new Stroke()); + this->m_ioStroke = new IOStroke(symbol->GetEdge(), this->m_currElemName); + handlerStack->push(this->m_ioStroke); + this->m_ioStroke->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (this->m_currElemName == L"Fill") // NOXLATE - { - MarkSymbol* symbol = static_cast(this->m_symbol); - symbol->AdoptFill(new Fill()); - this->m_ioFill = new IOFill(symbol->GetFill()); - handlerStack->push(this->m_ioFill); - this->m_ioFill->StartElement(name, handlerStack); - } - else if (this->m_currElemName == L"Edge") // NOXLATE - { - MarkSymbol* symbol = static_cast(this->m_symbol); - symbol->AdoptEdge(new Stroke()); - this->m_ioStroke = new IOStroke(symbol->GetEdge(), this->m_currElemName); - handlerStack->push(this->m_ioStroke); - this->m_ioStroke->StartElement(name, handlerStack); - } } void IOMarkSymbol::ElementChars(const wchar_t *ch) @@ -88,6 +122,9 @@ { if (this->m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_symbol->SetUnknownXml(UnknownXml()); + handlerStack->pop(); this->m_startElemName = L""; } @@ -124,6 +161,12 @@ if (symbol->GetEdge() != NULL) IOStroke::Write(fd, symbol->GetEdge(), "Edge"); // NOXLATE + // Write any previously found unknown XML + if (!symbol->GetUnknownXml().empty()) + { + fd << toCString(symbol->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/IOPointRule.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOPointRule.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOPointRule.cpp (revision 1038) @@ -24,6 +24,13 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, PointRule); +ELEM_MAP_ENTRY(2, PointSymbolization2D); +ELEM_MAP_ENTRY(3, Label); +ELEM_MAP_ENTRY(4, LegendLabel); +ELEM_MAP_ENTRY(5, Filter); + IOPointRule::IOPointRule() { this->_pointRule = NULL; @@ -43,23 +50,38 @@ void IOPointRule::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"PointRule") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case ePointRule: m_startElemName = name; this->_pointRule = new PointRule(); + break; + + case ePointSymbolization2D: + { + IOPointSymbolization2D *IO = new IOPointSymbolization2D(this->_pointRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eLabel: + { + IOLabel *IO = new IOLabel(this->_pointRule); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } - else if (m_currElemName == L"PointSymbolization2D") // NOXLATE - { - IOPointSymbolization2D *IO = new IOPointSymbolization2D(this->_pointRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } - else if (m_currElemName == L"Label") // NOXLATE - { - IOLabel *IO = new IOLabel(this->_pointRule); - handlerStack->push(IO); - IO->StartElement(name, handlerStack); - } } void IOPointRule::ElementChars(const wchar_t *ch) @@ -74,6 +96,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->_pointRule->SetUnknownXml(UnknownXml()); + this->pointTypeStyle->GetRules()->Adopt(this->_pointRule); handlerStack->pop(); this->pointTypeStyle= NULL; @@ -117,6 +142,12 @@ delete IO; } + // Write any previously found unknown XML + if (!pointRule->GetUnknownXml().empty()) + { + fd << toCString(pointRule->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/FSDSAX2Parser.cpp (revision 1038) @@ -28,6 +28,8 @@ { FSDSAX2Parser::FSDSAX2Parser() { + m_tagOpen = false; + Flush(); Initialize(); } @@ -61,7 +63,6 @@ m_Parser->setFeature(XMLUni::fgSAX2CoreValidation, false); m_Parser->setContentHandler(this); m_Parser->setErrorHandler(this); - m_prevOpenTag = L""; m_strbuffer = L""; } @@ -171,7 +172,9 @@ const Attributes& attributes) { std::wstring str = X2W(localname); - m_openTag = str; + m_strbuffer = L""; // discard any text between start tags + m_tagOpen = true; + // If the stack is empty, then check to see if we've encountered the // start of one of the below definitions. Allocate space for the object // we will be creating, create the appropriate IO object, passing in the reference @@ -193,29 +196,15 @@ { (m_HandlerStack->top())->StartElement(str.c_str(), m_HandlerStack); } - m_tagOpen = true; - m_charsInTag = false; } void FSDSAX2Parser::characters(const XMLCh* const chars , const unsigned int length) { - if (m_openTag.compare(m_prevOpenTag) != 0) - { - if (!m_HandlerStack->empty()) - { - if (m_charsInTag) - (m_HandlerStack->top())->ElementChars(m_strbuffer.c_str()); - m_strbuffer = L""; - } - } - - m_strbuffer += X2W(chars); - - m_prevOpenTag = m_openTag; - + // The character data may be split into multiple calls, so just store it for now. + // Also, do not record text outside of start/end tags if (m_tagOpen) - m_charsInTag = true; + m_strbuffer += X2W(chars); } void FSDSAX2Parser::endElement(const XMLCh* const uri, @@ -223,9 +212,15 @@ const XMLCh* const qname) { m_tagOpen = false; - m_prevOpenTag = L""; if (!m_HandlerStack->empty()) { + // Now is the time to make the ElementChars() call. + if (!m_strbuffer.empty()) + { + (m_HandlerStack->top())->ElementChars(m_strbuffer.c_str()); + m_strbuffer = L""; + } + (m_HandlerStack->top())->EndElement(X2W(localname), m_HandlerStack); } } Index: E:/MgDev/OS/Common/MdfParser/IOUnknown.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOUnknown.cpp (revision 0) +++ E:/MgDev/OS/Common/MdfParser/IOUnknown.cpp (revision 1038) @@ -0,0 +1,71 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#include "stdafx.h" +#include "IOUnknown.h" + +using namespace XERCES_CPP_NAMESPACE; +using namespace MDFPARSER_NAMESPACE; + + +IOUnknown::IOUnknown(std::wstring* xml) +{ + _xml = xml; + m_startElemName.clear(); +} + +IOUnknown::~IOUnknown() +{ +} + +void IOUnknown::StartElement(const wchar_t *name, HandlerStack *handlerStack) +{ + + if (m_startElemName.empty()) + { + m_startElemName = name; + + _xml->append(L"<"); // NOXLATE + _xml->append(name); + _xml->append(L">"); // NOXLATE + } + else + { + IOUnknown *IO = new IOUnknown(_xml); + handlerStack->push(IO); + IO->StartElement(name, handlerStack); + } +} + +void IOUnknown::ElementChars(const wchar_t *ch) +{ + _xml->append(ch); +} + +void IOUnknown::EndElement(const wchar_t *name, HandlerStack *handlerStack) +{ + _xml->append(L"append(name); + _xml->append(L">"); // NOXLATE + + if (m_startElemName == name) + { + handlerStack->pop(); + delete this; + } +} + Property changes on: E:\MgDev\OS\Common\MdfParser\IOUnknown.cpp ___________________________________________________________________ Name: svn:eol-style + native Index: E:/MgDev/OS/Common/MdfParser/Makefile.am =================================================================== --- E:/MgDev/OS/Common/MdfParser/Makefile.am (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/Makefile.am (revision 1038) @@ -27,6 +27,7 @@ IOFill.cpp \ IOFontSymbol.cpp \ IOGridColor.cpp \ + IOGridColorBands.cpp \ IOGridColorRule.cpp \ IOGridColorStyle.cpp \ IOGridLayerDefinition.cpp \ @@ -53,11 +54,13 @@ IOStroke.cpp \ IOSupplementalSpatialContextInfo.cpp \ IOSymbol.cpp \ + IOUnknown.cpp \ IOUtil.cpp \ IOVectorLayerDefinition.cpp \ IOVectorScaleRange.cpp \ IOW2DSymbol.cpp \ MdfParser.cpp \ + SAX2ElementHandler.cpp \ SAX2Parser.cpp noinst_HEADERS = \ @@ -105,6 +108,7 @@ IOStroke.h \ IOSupplementalSpatialContextInfo.h \ IOSymbol.h \ + IOUnknown.h \ IOUtil.h \ IOVectorLayerDefinition.h \ IOVectorScaleRange.h \ Index: E:/MgDev/OS/Common/MdfParser/IOAttributeRelate.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/IOAttributeRelate.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/IOAttributeRelate.cpp (revision 1038) @@ -24,6 +24,16 @@ using namespace MDFMODEL_NAMESPACE; using namespace MDFPARSER_NAMESPACE; +CREATE_ELEMENT_MAP; +ELEM_MAP_ENTRY(1, AttributeRelate); +ELEM_MAP_ENTRY(2, RelateProperty); +ELEM_MAP_ENTRY(3, AttributeClass); +ELEM_MAP_ENTRY(4, ResourceId); +ELEM_MAP_ENTRY(5, Name); +ELEM_MAP_ENTRY(6, AttributeNameDelimiter); +ELEM_MAP_ENTRY(7, RelateType); +ELEM_MAP_ENTRY(8, ForceOneToOne); + IOAttributeRelate::IOAttributeRelate() : m_pAttributeRelate(NULL), m_pExtension(NULL) { @@ -41,19 +51,29 @@ void IOAttributeRelate::StartElement(const wchar_t *name, HandlerStack *handlerStack) { m_currElemName = name; - if (m_currElemName == L"AttributeRelate") // NOXLATE + m_currElemId = _ElementIdFromName(name); + + switch (m_currElemId) { + case eAttributeRelate: m_startElemName = name; m_pAttributeRelate = new AttributeRelate(); - } - else - { - if (m_currElemName == L"RelateProperty") // NOXLATE + break; + + case eRelateProperty: { IORelateProperty *IO = new IORelateProperty(this->m_pAttributeRelate); handlerStack->push(IO); IO->StartElement(name, handlerStack); } + break; + + case eUnknown: + ParseUnknownXml(name, handlerStack); + break; + + default: + break; } } @@ -77,6 +97,9 @@ { if (m_startElemName == name) { + if (!UnknownXml().empty()) + this->m_pAttributeRelate->SetUnknownXml(UnknownXml()); + m_pExtension->GetAttributeRelates()->Adopt(m_pAttributeRelate); handlerStack->pop(); this->m_pAttributeRelate = NULL; @@ -127,6 +150,12 @@ spIO->Write(fd, pAttributeRelate->GetRelateProperties()->GetAt(x)); } + // Write any previously found unknown XML + if (!pAttributeRelate->GetUnknownXml().empty()) + { + fd << toCString(pAttributeRelate->GetUnknownXml()); + } + dectab(); fd << tab() << "" << std::endl; // NOXLATE } Index: E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.h =================================================================== --- E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.h (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/SAX2ElementHandler.h (revision 1038) @@ -20,7 +20,9 @@ #include #include +#include #include "MdfParser.h" +#include "UnicodeString.h" using namespace XERCES_CPP_NAMESPACE; using namespace MDFMODEL_NAMESPACE; @@ -44,20 +46,57 @@ class MDFPARSER_API SAX2ElementHandler { public: - virtual ~SAX2ElementHandler() {}; + virtual ~SAX2ElementHandler() {} virtual void StartElement(const wchar_t *name, HandlerStack *handlerStack) = 0; virtual void ElementChars(const wchar_t *ch) = 0; virtual void EndElement(const wchar_t *name, HandlerStack *handlerStack) = 0; protected: + void ParseUnknownXml(const wchar_t *name, HandlerStack *handlerStack); + std::wstring& UnknownXml() { return m_unknownXml; } + + std::wstring m_unknownXml; + // m_startElemName stores the name of the XML tag that initiated // the creation of this SAX2ElementHandler object. std::wstring m_startElemName; // m_currElemName stores the name of the last XML start tag. std::wstring m_currElemName; + int m_currElemId; }; +// For each element type, the following macros define a method, _ElementIdFromName() +// and two variables, eElementName - an integer ID which can be used in case +// statements, and sElementName - a std::string which can be used in serialization. +// CREATE_ELEMENT_MAP is called first, and then ELEM_MAP_ENTRY for each element +// type. The IDs provided to ELEM_MAP_ENTRY must be consecutive, starting from 1. +// +#define CREATE_ELEMENT_MAP \ + static std::vector _elementMap; \ + static std::string _CreateMapEntry(const wchar_t* wName, const char* sName) \ + { \ + _elementMap.push_back(wName); \ + return sName; \ + } \ + static int _ElementIdFromName(const wchar_t* name) \ + { \ + std::vector::const_iterator iter = _elementMap.begin(); \ + int id = 1; \ + for (iter++; iter != _elementMap.end(); iter++) \ + { \ + if (0 == ::wcscmp(iter->c_str(), name)) \ + return id; \ + id++; \ + } \ + return 0; \ + } \ + ELEM_MAP_ENTRY(0, Unknown) + +#define ELEM_MAP_ENTRY(ID, NAME) \ + static const std::string s##NAME = _CreateMapEntry(L###NAME, #NAME); \ + static const int e##NAME = ID + END_NAMESPACE_MDFPARSER #endif // _SAX2ELEMENTHANDLER_H Index: E:/MgDev/OS/Common/MdfParser/SAX2Parser.cpp =================================================================== --- E:/MgDev/OS/Common/MdfParser/SAX2Parser.cpp (revision 1037) +++ E:/MgDev/OS/Common/MdfParser/SAX2Parser.cpp (revision 1038) @@ -50,7 +50,6 @@ m_Parser = NULL; m_HandlerStack = NULL; m_tagOpen = false; - m_charsInTag = false; Flush(); Initialize(); @@ -95,7 +94,6 @@ m_Parser->setFeature(XMLUni::fgXercesSchemaFullChecking, false); m_Parser->setFeature(XMLUni::fgSAX2CoreValidation, false); // true for validation m_Parser->setContentHandler(this); - m_prevOpenTag = L""; m_strbuffer = L""; } @@ -341,7 +339,9 @@ const Attributes& attributes) { std::wstring str = X2W(localname); - m_openTag = str; + m_strbuffer = L""; // discard any text between start tags + m_tagOpen = true; + // If the stack is empty, then check to see if we've encountered the // start of one of the below definitions. Allocate space for the object // we will be creating, create the appropriate IO object, passing in the reference @@ -386,30 +386,16 @@ { (m_HandlerStack->top())->StartElement(str.c_str(), m_HandlerStack); } - m_tagOpen = true; - m_charsInTag = false; } void SAX2Parser::characters(const XMLCh* const chars, const unsigned int length) { - if (m_openTag.compare(m_prevOpenTag) != 0) - { - if (!m_HandlerStack->empty()) - { - if (m_charsInTag) - (m_HandlerStack->top())->ElementChars(m_strbuffer.c_str()); - m_strbuffer = L""; - } - } - - m_strbuffer += X2W(chars); - - m_prevOpenTag = m_openTag; - + // The character data may be split into multiple calls, so just store it for now. + // Also, do not record text outside of start/end tags if (m_tagOpen) - m_charsInTag = true; + m_strbuffer += X2W(chars); } @@ -418,9 +404,15 @@ const XMLCh* const qname) { m_tagOpen = false; - m_prevOpenTag = L""; if (!m_HandlerStack->empty()) { + // Now is the time to make the ElementChars() call. + if (!m_strbuffer.empty()) + { + (m_HandlerStack->top())->ElementChars(m_strbuffer.c_str()); + m_strbuffer = L""; + } + (m_HandlerStack->top())->EndElement(X2W(localname), m_HandlerStack); } } Index: E:/MgDev/OS/Common/MdfModel/MdfRootObject.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/MdfRootObject.h (revision 0) +++ E:/MgDev/OS/Common/MdfModel/MdfRootObject.h (revision 1038) @@ -0,0 +1,54 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#ifndef MDFROOTOBJECT_H_ +#define MDFROOTOBJECT_H_ + +#include "MdfModel.h" + +BEGIN_NAMESPACE_MDFMODEL + + //---------------------------------------------------------------------- --- + // DESCRIPTION: + // Common base class for all MdfModel classes. Provides support for + // round-tripping unknown XML data from/to future schema versions. + //---------------------------------------------------------------------- --- + class MDFMODEL_API MdfRootObject + { + public: + // Destruction + virtual ~MdfRootObject() {} + + // Operations + // Property : UnknownXml + const MdfString& GetUnknownXml() const; + void SetUnknownXml(const MdfString& pstrUnknownXml); + + protected: + // Construction, initialization + // Default constructor is protected to make this class abstract. + MdfRootObject() {} + + private: + // Data members + // Cache for parser, keeping unknown XML for round-tripping. + MdfString m_strUnknownXml; + + }; + +END_NAMESPACE_MDFMODEL +#endif //MDFROOTOBJECT_H_ Property changes on: E:\MgDev\OS\Common\MdfModel\MdfRootObject.h ___________________________________________________________________ Name: svn:eol-style + native Index: E:/MgDev/OS/Common/MdfModel/Stroke.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Stroke.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Stroke.h (revision 1038) @@ -21,6 +21,7 @@ #include "MdfModel.h" #include "SizeContexts.h" #include "LengthConverter.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -30,7 +31,7 @@ // concrete classes are used by LineSymbolization and AreaSymbolization to // define the stylization for lines and polygon outlines. //---------------------------------------------------------------------- --- - class MDFMODEL_API Stroke + class MDFMODEL_API Stroke : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/FeatureSource.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/FeatureSource.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/FeatureSource.h (revision 1038) @@ -22,6 +22,7 @@ #include "NameStringPair.h" #include "Extension.h" #include "SupplementalSpatialContextInfo.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -31,7 +32,7 @@ // needed to connect to a feature source. It also contains extensions that // contain joins for the feature classes in the feature source. //---------------------------------------------------------------------- --- - class MDFMODEL_API FeatureSource +class MDFMODEL_API FeatureSource : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/GridColor.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/GridColor.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/GridColor.h (revision 1038) @@ -20,6 +20,7 @@ #include #include "ChannelBand.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -29,7 +30,7 @@ // The grid color is used to stylize the pixel using the given or calculated // color. //---------------------------------------------------------------------- --- - class MDFMODEL_API GridColor + class MDFMODEL_API GridColor : public MdfRootObject { public: virtual ~GridColor(); Index: E:/MgDev/OS/Common/MdfModel/Fill.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Fill.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Fill.h (revision 1038) @@ -19,6 +19,7 @@ #define FILL_H_ #include "MdfModel.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -27,7 +28,7 @@ // Class Fill is an abstract base that defines how to color/paint // feature geometry. //--------------------------------------------------------------------- - class MDFMODEL_API Fill + class MDFMODEL_API Fill : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/MdfRootObject.cpp =================================================================== --- E:/MgDev/OS/Common/MdfModel/MdfRootObject.cpp (revision 0) +++ E:/MgDev/OS/Common/MdfModel/MdfRootObject.cpp (revision 1038) @@ -0,0 +1,52 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +//--------------------------------------------------------------------- ---- +// DESCRIPTION: +// The MdfRootObject class implementation. MdfRootObject is an abstract class. +//--------------------------------------------------------------------- ---- + +#include "stdafx.h" +#include "MdfRootObject.h" +#include "Base64.h" + +using namespace MDFMODEL_NAMESPACE; + +//--------------------------------------------------------------------- ---- +// PURPOSE: Accessor for the UnknownXml property cached by an XML Parser. +// The Xml stream is then serialized when writing to a future +// schema version - to support round-tripping. +// RETURNS: +//--------------------------------------------------------------------- ---- +const MdfString& MdfRootObject::GetUnknownXml()const +{ + return this->m_strUnknownXml; +} + +//--------------------------------------------------------------------- ---- +// PURPOSE: Accessor to the UnknownXml property cached in this MdfRootObject +// by an Xml Parser. It is stored here in case it is needed +// during serialization. +// PARAMETERS: +// Input: +// pstrUnknownXml - an Xml stream containing unknown elements. +//--------------------------------------------------------------------- ---- +void MdfRootObject::SetUnknownXml(const MdfString& strUnknownXml) +{ + this->m_strUnknownXml = strUnknownXml; +} + Property changes on: E:\MgDev\OS\Common\MdfModel\MdfRootObject.cpp ___________________________________________________________________ Name: svn:eol-style + native Index: E:/MgDev/OS/Common/MdfModel/Extension.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Extension.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Extension.h (revision 1038) @@ -21,6 +21,7 @@ #include "MdfModel.h" #include "AttributeRelate.h" #include "CalculatedProperty.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -28,7 +29,7 @@ // DESCRIPTION: // Extension class defines the joins between feature classes //---------------------------------------------------------------------- --- - class MDFMODEL_API Extension +class MDFMODEL_API Extension : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/Label.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Label.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Label.h (revision 1038) @@ -20,6 +20,7 @@ #include "MdfModel.h" #include "TextSymbol.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -31,7 +32,7 @@ // text label. Other types of Symbols can be used by themselves, or in // combination, to create more intricate labels. //---------------------------------------------------------------------- --- - class MDFMODEL_API Label + class MDFMODEL_API Label : public MdfRootObject { public: // Orientation Enum is used to control the orientation of a Label with Index: E:/MgDev/OS/Common/MdfModel/NameStringPair.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/NameStringPair.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/NameStringPair.h (revision 1038) @@ -20,6 +20,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -28,7 +29,7 @@ // Class NameStringPair represents a pair of strings. The first is the // name and the second is the associated text. // ------------------------------------------------------------------------ - class MDFMODEL_API NameStringPair +class MDFMODEL_API NameStringPair : public MdfRootObject { public: //Constructors, Index: E:/MgDev/OS/Common/MdfModel/LayerDefinition.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/LayerDefinition.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/LayerDefinition.h (revision 1038) @@ -19,6 +19,7 @@ #define LAYERDEFINITION_H_ #include "MdfModel.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -31,7 +32,7 @@ // LayerDefinitions are encapsulated by MapLayer objects that make up a Map. They // are referenced primarily by their Uri. //---------------------------------------------------------------------- --- - class MDFMODEL_API LayerDefinition +class MDFMODEL_API LayerDefinition : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/VectorScaleRange.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/VectorScaleRange.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/VectorScaleRange.h (revision 1038) @@ -21,6 +21,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" #include "FeatureTypeStyle.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -33,7 +34,7 @@ // collection. Each will result in the drawing of some of the layer's geometric // primitives and/or their labels. //---------------------------------------------------------------------- --- - class MDFMODEL_API VectorScaleRange +class MDFMODEL_API VectorScaleRange : public MdfRootObject { public: // Represents the maximum value for the map scale. Index: E:/MgDev/OS/Common/MdfModel/Symbolization.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Symbolization.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Symbolization.h (revision 1038) @@ -19,6 +19,7 @@ #define SYMBOLIZATION_H_ #include "MdfModel.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -29,7 +30,7 @@ // Class Fill is an abstract base that defines how to color/paint // feature geometry. //--------------------------------------------------------------------- - class MDFMODEL_API Symbolization + class MDFMODEL_API Symbolization : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/MdfModel.vcproj =================================================================== --- E:/MgDev/OS/Common/MdfModel/MdfModel.vcproj (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/MdfModel.vcproj (revision 1038) @@ -514,6 +514,14 @@ > + + + + Index: E:/MgDev/OS/Common/MdfModel/SupplementalSpatialContextInfo.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/SupplementalSpatialContextInfo.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/SupplementalSpatialContextInfo.h (revision 1038) @@ -20,6 +20,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -29,7 +30,7 @@ // for a spatial context when the coordinate system is missing from the // feature source. // ------------------------------------------------------------------------ - class MDFMODEL_API SupplementalSpatialContextInfo +class MDFMODEL_API SupplementalSpatialContextInfo : public MdfRootObject { public: //Constructors, Index: E:/MgDev/OS/Common/MdfModel/GridScaleRange.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/GridScaleRange.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/GridScaleRange.h (revision 1038) @@ -23,6 +23,7 @@ #include "GridSurfaceStyle.h" #include "GridColorStyle.h" #include +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -35,7 +36,7 @@ // collection. Each will result in the drawing of some of the layer's geometric // primitives and/or their labels. //---------------------------------------------------------------------- --- - class MDFMODEL_API GridScaleRange + class MDFMODEL_API GridScaleRange : public MdfRootObject { public: // Represents the maximum value for the map scale. Index: E:/MgDev/OS/Common/MdfModel/RelateProperty.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/RelateProperty.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/RelateProperty.h (revision 1038) @@ -20,6 +20,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" +#include "MdfRootObject.h" namespace MdfModel { @@ -29,7 +30,7 @@ // RelateProperty class defines the calculated properties from attributes // from the same feature class //---------------------------------------------------------------------- --- - class MDFMODEL_API RelateProperty + class MDFMODEL_API RelateProperty : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/ChannelBand.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/ChannelBand.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/ChannelBand.h (revision 1038) @@ -19,6 +19,7 @@ #define CHANNELBAND_H_ #include +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -27,7 +28,7 @@ // Class ChannelBand is used to map the band's value to a valid color channel value. // It defines how to scale numbers into a color channel. //---------------------------------------------------------------------- ------- - class MDFMODEL_API ChannelBand + class MDFMODEL_API ChannelBand : public MdfRootObject { public: ChannelBand(); Index: E:/MgDev/OS/Common/MdfModel/HillShade.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/HillShade.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/HillShade.h (revision 1038) @@ -19,6 +19,7 @@ #define HILLSHADE_H_ #include +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -27,7 +28,7 @@ // Class HillShade is used to specify how to shade given a band and a light // source. //---------------------------------------------------------------------- --- - class MDFMODEL_API HillShade + class MDFMODEL_API HillShade : public MdfRootObject { public: HillShade(); Index: E:/MgDev/OS/Common/MdfModel/AttributeRelate.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/AttributeRelate.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/AttributeRelate.h (revision 1038) @@ -20,6 +20,7 @@ #include "MdfModel.h" #include "RelateProperty.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -28,7 +29,7 @@ // AttributeRelate class defines the attribute class in the target feature // source //---------------------------------------------------------------------- --- - class MDFMODEL_API AttributeRelate +class MDFMODEL_API AttributeRelate : public MdfRootObject { public: Index: E:/MgDev/OS/Common/MdfModel/Symbol.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Symbol.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Symbol.h (revision 1038) @@ -21,6 +21,7 @@ #include "MdfModel.h" #include "SizeContexts.h" #include "LengthConverter.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -32,7 +33,7 @@ // point geometric primitives. Its use of expressions for its properties // allows it to support multivariate theming. Symbol is an abstract class. //---------------------------------------------------------------------- --- - class MDFMODEL_API Symbol + class MDFMODEL_API Symbol : public MdfRootObject { public: Index: E:/MgDev/OS/Common/MdfModel/CalculatedProperty.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/CalculatedProperty.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/CalculatedProperty.h (revision 1038) @@ -20,6 +20,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -28,7 +29,7 @@ // CalculatedProperty class defines the calculated properties from attributes // from the same feature class //---------------------------------------------------------------------- --- - class MDFMODEL_API CalculatedProperty +class MDFMODEL_API CalculatedProperty : public MdfRootObject { public: // Construction, destruction, initialization Index: E:/MgDev/OS/Common/MdfModel/Rule.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/Rule.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Rule.h (revision 1038) @@ -21,6 +21,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" #include "Label.h" +#include "MdfRootObject.h" namespace MdfParser { @@ -39,7 +40,7 @@ // Filtering criteria takes the form of a tree that uses logical operators // to combine attribute-based and geometry-based filters. //---------------------------------------------------------------------- --- - class MDFMODEL_API Rule +class MDFMODEL_API Rule : public MdfRootObject { friend class MdfParser::IOAreaRule; friend class MdfParser::IOLineRule; Index: E:/MgDev/OS/Common/MdfModel/FeatureTypeStyle.h =================================================================== --- E:/MgDev/OS/Common/MdfModel/FeatureTypeStyle.h (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/FeatureTypeStyle.h (revision 1038) @@ -21,6 +21,7 @@ #include "MdfModel.h" #include "MdfOwnerCollection.h" #include "Rule.h" +#include "MdfRootObject.h" BEGIN_NAMESPACE_MDFMODEL @@ -35,7 +36,7 @@ // It is possible for FeatureTypeStyle's concrete classes to contain // only Labels. //---------------------------------------------------------------------- --- - class MDFMODEL_API FeatureTypeStyle + class MDFMODEL_API FeatureTypeStyle : public MdfRootObject { public: // Construction, destruction, initialization. Index: E:/MgDev/OS/Common/MdfModel/Makefile.am =================================================================== --- E:/MgDev/OS/Common/MdfModel/Makefile.am (revision 1037) +++ E:/MgDev/OS/Common/MdfModel/Makefile.am (revision 1038) @@ -43,6 +43,7 @@ MapLayerGroupCommon.cpp \ MarkSymbol.cpp \ MdfModel.cpp \ + MdfRootObject.cpp \ NameStringPair.cpp \ PointRule.cpp \ PointSymbolization2D.cpp \ @@ -104,6 +105,7 @@ MarkSymbol.h \ MdfModel.h \ MdfOwnerCollection.h \ + MdfRootObject.h \ NameStringPair.h \ PointRule.h \ PointSymbolization2D.h \ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/bf52c4df/attachment-0001.html From tom.fukushima at autodesk.com Mon Jan 8 23:38:43 2007 From: tom.fukushima at autodesk.com (Tom Fukushima) Date: Tue Jan 9 00:36:06 2007 Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Message-ID: Hi Trevor, Thanks for suggesting this fix. Unfortunately, as this is an enhancement and does not fall under defect fix, I don't think that it can go into RC2. Unless someone sees different, let's hold off on this one. Thanks, Tom _____ From: Trevor Wekel Sent: Monday, January 08, 2007 10:22 AM To: Tom Fukushima; 'mapguide_dev@lists.osgeo.org' Subject: RE: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi Tom, The check went into trunk as part of a much larger submission. After some testing, I have noticed that this code does not correctly detect the difference between a garbled stream and a stream of the wrong version. They are all detected as wrong version so I will need to add some additional logic to discriminate between the two cases. Here are the relevant lines of code from the original submission: >From StreamParser::ParseStreamHeader Index: StreamParser.cpp =================================================================== --- StreamParser.cpp (revision 737) +++ StreamParser.cpp (revision 1028) @@ -77,6 +77,12 @@ ret = true; } } + + if (ret == false || MgStreamParser::StreamVersion != pStreamData->GetVersion()) + { + throw new MgStreamIoException(L"MgStreamParser.ParseStreamHeader", __LINE__, __WFILE__, NULL, L"MgInvalidTC PProtocol", NULL); + } + } return ret; >From MgCommand::GetResponse Index: Command.cpp =================================================================== --- Command.cpp (revision 770) +++ Command.cpp (revision 1028) @@ -141,6 +141,12 @@ // Get the stream header i.e. stream_start, stream_data etc. ptrStream->GetStreamHeader(msh); + + if (MgStreamParser::mshStreamStart != msh.m_streamStart || MgStreamParser::StreamVersion != msh.m_streamVersion) + { + throw new MgStreamIoException(L"MgCommand.GetResponse", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NUL L); + } + // Get the operation response header ptrStream->GetOperationResponseHeader(morp); // Process the result based on eCode. In case of exception, it would throw the exception _____ From: Tom Fukushima Sent: Monday, January 08, 2007 10:00 AM To: Trevor Wekel; 'mapguide_dev@lists.osgeo.org' Subject: RE: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi Trevor, I would like to get an idea of the risk and size of the change. Can you give me the revision numbers for the submissions for this to the trunk? Thanks Tom _____ From: Trevor Wekel Sent: Monday, January 08, 2007 9:42 AM To: Tom Fukushima; mapguide_dev@lists.osgeo.org Subject: RE: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi Tom, I would like to put a TCP/IP stream version check in the 1.1.0 release to help catch versioning issues between the Web Extensions and Server code bases. Over time, improvements in the TCP/IP protocol will be made. Some of these improvements could break compatibility with older releases. Thanks, Trevor _____ From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Tom Fukushima Sent: Sunday, January 07, 2007 9:26 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] MapGuide Open Source 1.1.0 RC2 Hi, I would like to release MapGuide Open Source 1.1.0 RC2 in a couple of weeks. This means that approved defect submissions to the 1.1.0 stream need to be made by next weekend. If you have a defect fix that you would like to submit, please send it to this list for review. If it is a security related defect fix, please send it to me directly for review. Thanks Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/13161ae1/attachment.html From rbray at robertbray.net Tue Jan 9 00:32:34 2007 From: rbray at robertbray.net (Robert Bray) Date: Tue Jan 9 01:30:19 2007 Subject: [Mapguide_dev] Motion for a vote to either accept or rejectMapGuide RFC 3 - Session Affinity In-Reply-To: <8E468917B01800408B91984428BE03DD05852FC6@starfish.nanaimo.ca> References: <8E468917B01800408B91984428BE03DD05852FC6@starfish.nanaimo.ca> Message-ID: <45A328F2.4090703@robertbray.net> An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070108/370addb9/attachment.html From rbray at robertbray.net Wed Jan 10 02:03:29 2007 From: rbray at robertbray.net (Robert Bray) Date: Wed Jan 10 03:00:58 2007 Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. Message-ID: <45A48FC1.1030500@robertbray.net> All, I finally found some time tonight to fix the broken links on the site. Not 100% sure I got them all but I know I got quite a few. If you find any please fix them if you can or send me an e-mail and I'll deal with it. The Release Notes still contain links to Project Tracker which need to be fixed when the defects are imported into Trac. I have to say that Drupal is still a bit of a mystery to me, but I am starting to get the hang of it. I cannot figure out how to add an image to fix the broken image in the gallary. If anyone knows how, please let me know. Once the LDAP integration into Drupal is done I would like to consider moving the PSC content and RFCs from the Wiki into Drupal. Again if anyone has suggestions for how to do that I am all ears. Finally I come to the mailing lists. The "Mapguide_???" names are driving me nuts. One one hand it's just a name on the other I know deep down "Mapguide_users" should be "mapguide-users" and so on. So the question I put to you is should we bite the bullet and fix them (making everyone fix their rules again) or live with the names permanently? Bob From amorsell at spatialgis.com Wed Jan 10 10:34:08 2007 From: amorsell at spatialgis.com (Andy Morsell) Date: Wed Jan 10 11:30:10 2007 Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. In-Reply-To: <45A48FC1.1030500@robertbray.net> Message-ID: <012c01c734cc$c560b2d0$6401a8c0@SPINAJM> Hi Bob, Did you by any chance run across the MapGuide Developers Guide sample code anywhere? The file is MapGuideDevGuideSamples.zip. Once it is found, it should probably be placed in the www/docs folder. If you do that I can fix the links to it on the 1.1.0RC1 and 1.0.x docs pages. Personally, the Mapguide_users and so on names don't bother me, but wouldn't cause me any pain if they changed either. Thanks. Andy -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Robert Bray Sent: Tuesday, January 09, 2007 11:03 PM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. All, I finally found some time tonight to fix the broken links on the site. Not 100% sure I got them all but I know I got quite a few. If you find any please fix them if you can or send me an e-mail and I'll deal with it. The Release Notes still contain links to Project Tracker which need to be fixed when the defects are imported into Trac. I have to say that Drupal is still a bit of a mystery to me, but I am starting to get the hang of it. I cannot figure out how to add an image to fix the broken image in the gallary. If anyone knows how, please let me know. Once the LDAP integration into Drupal is done I would like to consider moving the PSC content and RFCs from the Wiki into Drupal. Again if anyone has suggestions for how to do that I am all ears. Finally I come to the mailing lists. The "Mapguide_???" names are driving me nuts. One one hand it's just a name on the other I know deep down "Mapguide_users" should be "mapguide-users" and so on. So the question I put to you is should we bite the bullet and fix them (making everyone fix their rules again) or live with the names permanently? Bob _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev From trevor.wekel at autodesk.com Wed Jan 10 12:35:22 2007 From: trevor.wekel at autodesk.com (Trevor Wekel) Date: Wed Jan 10 13:32:42 2007 Subject: [Mapguide_dev] Re: MapGuide RFC 11 - Stateless Http GETTILEIMAGE request Message-ID: Hello all, Based on feedback I have received though the list and internally at Autodesk, I am going to post an update to the RFC with the following modifications: - Write a server log entry whenever the map cache is flushed. - Change the SCALE parameter to SCALEINDEX for clarity. - Add a "RenderOnly" parameter to serverconfig.ini for the TileService. This allows MapGuide to be used in a render-only mode and makes it easier to integrate with 3rd party caching software like Squid. I will wait another day or so for additional feedback before sending the RFC to the PSC for approval. Thanks everyone, Trevor -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070110/0a947fed/attachment.html From Jason.Birch at nanaimo.ca Wed Jan 10 14:46:43 2007 From: Jason.Birch at nanaimo.ca (Jason Birch) Date: Wed Jan 10 15:43:59 2007 Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. Message-ID: <8E468917B01800408B91984428BE03DD05852FFD@starfish.nanaimo.ca> I'd like to bite the bullet and change the names. I'd prefer: mapguide-users == Mapguide_Users mapguide-dev == Mapguide developers & PSC We should also consider dumping the lists that we are not using (_commits and _issues) until SVN and Trac are set up, and then re-creating them at that point. I'm working on cleaning up some links on the website today. Are we meeting tomorrow? Jason -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Robert Bray Sent: Tuesday, January 09, 2007 23:03 To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. All, I finally found some time tonight to fix the broken links on the site. Not 100% sure I got them all but I know I got quite a few. If you find any please fix them if you can or send me an e-mail and I'll deal with it. The Release Notes still contain links to Project Tracker which need to be fixed when the defects are imported into Trac. I have to say that Drupal is still a bit of a mystery to me, but I am starting to get the hang of it. I cannot figure out how to add an image to fix the broken image in the gallary. If anyone knows how, please let me know. Once the LDAP integration into Drupal is done I would like to consider moving the PSC content and RFCs from the Wiki into Drupal. Again if anyone has suggestions for how to do that I am all ears. Finally I come to the mailing lists. The "Mapguide_???" names are driving me nuts. One one hand it's just a name on the other I know deep down "Mapguide_users" should be "mapguide-users" and so on. So the question I put to you is should we bite the bullet and fix them (making everyone fix their rules again) or live with the names permanently? Bob _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev From dmorissette at mapgears.com Wed Jan 10 14:53:02 2007 From: dmorissette at mapgears.com (Daniel Morissette) Date: Wed Jan 10 15:50:28 2007 Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. In-Reply-To: <8E468917B01800408B91984428BE03DD05852FFD@starfish.nanaimo.ca> References: <8E468917B01800408B91984428BE03DD05852FFD@starfish.nanaimo.ca> Message-ID: <45A5441E.5070602@mapgears.com> I have a preference for mapguide-users and mapguide-dev too. Daniel Jason Birch wrote: > I'd like to bite the bullet and change the names. > > I'd prefer: > > mapguide-users == Mapguide_Users > mapguide-dev == Mapguide developers & PSC > > We should also consider dumping the lists that we are not using > (_commits and _issues) until SVN and Trac are set up, and then > re-creating them at that point. > > I'm working on cleaning up some links on the website today. > > Are we meeting tomorrow? > > Jason > > -----Original Message----- > From: mapguide_dev-bounces@lists.osgeo.org > [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Robert Bray > Sent: Tuesday, January 09, 2007 23:03 > To: mapguide_dev@lists.osgeo.org > Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. > > All, > > I finally found some time tonight to fix the broken links on the site. > Not 100% sure I got them all but I know I got quite a few. If you find > any please fix them if you can or send me an e-mail and I'll deal with > it. The Release Notes still contain links to Project Tracker which need > to be fixed when the defects are imported into Trac. I have to say that > Drupal is still a bit of a mystery to me, but I am starting to get the > hang of it. I cannot figure out how to add an image to fix the broken > image in the gallary. If anyone knows how, please let me know. > > Once the LDAP integration into Drupal is done I would like to consider > moving the PSC content and RFCs from the Wiki into Drupal. Again if > anyone has suggestions for how to do that I am all ears. > > Finally I come to the mailing lists. The "Mapguide_???" names are > driving me nuts. One one hand it's just a name on the other I know deep > down "Mapguide_users" should be "mapguide-users" and so on. So the > question I put to you is should we bite the bullet and fix them (making > everyone fix their rules again) or live with the names permanently? > > Bob > > > _______________________________________________ > Mapguide_dev mailing list > Mapguide_dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide_dev > _______________________________________________ > Mapguide_dev mailing list > Mapguide_dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide_dev -- Daniel Morissette http://www.mapgears.com/ From bruce.dechant at autodesk.com Wed Jan 10 14:55:15 2007 From: bruce.dechant at autodesk.com (Bruce Dechant) Date: Wed Jan 10 15:52:30 2007 Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. Message-ID: I suggest we fix them sooner rather then later. :) Bruce -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Robert Bray Sent: January 10, 2007 12:03 AM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] PSC: Site Migration Links, Etc. All, I finally found some time tonight to fix the broken links on the site. Not 100% sure I got them all but I know I got quite a few. If you find any please fix them if you can or send me an e-mail and I'll deal with it. The Release Notes still contain links to Project Tracker which need to be fixed when the defects are imported into Trac. I have to say that Drupal is still a bit of a mystery to me, but I am starting to get the hang of it. I cannot figure out how to add an image to fix the broken image in the gallary. If anyone knows how, please let me know. Once the LDAP integration into Drupal is done I would like to consider moving the PSC content and RFCs from the Wiki into Drupal. Again if anyone has suggestions for how to do that I am all ears. Finally I come to the mailing lists. The "Mapguide_???" names are driving me nuts. One one hand it's just a name on the other I know deep down "Mapguide_users" should be "mapguide-users" and so on. So the question I put to you is should we bite the bullet and fix them (making everyone fix their rules again) or live with the names permanently? Bob _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev From rbray at robertbray.net Thu Jan 11 01:56:13 2007 From: rbray at robertbray.net (Robert Bray) Date: Thu Jan 11 02:53:30 2007 Subject: [Mapguide_dev] [Fwd: [SAC] Mailing List Change Request] Message-ID: <45A5DF8D.6000005@robertbray.net> An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070110/3bf78b43/attachment.html -------------- next part -------------- _______________________________________________ Sac mailing list Sac@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/sac From chris.claydon at autodesk.com Thu Jan 11 10:38:53 2007 From: chris.claydon at autodesk.com (Chris Claydon) Date: Thu Jan 11 11:36:08 2007 Subject: [Mapguide_dev] svn commit: r1040 - RFC3 Session Affinity Message-ID: <73BD5EF42E005C47988D1624D128BC7E055659CC@msgusawmb03.ads.autodesk.com> Revision: 1040 Author: chrisclaydon Date: 8:55:32 AM, January 11, 2007 Message: RFC3 - Session Affinity ---- Modified : /trunk/MgDev/Common/MapGuideCommon/Controller/DwfController.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/Makefile.am Modified : /trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.h Modified : /trunk/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj Modified : /trunk/MgDev/Common/MapGuideCommon/MapGuideCommonBuild.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h Modified : /trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/Services/Site.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/Services/Site.h Modified : /trunk/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp Added : /trunk/MgDev/Common/MapGuideCommon/Services/SiteInfo.cpp Added : /trunk/MgDev/Common/MapGuideCommon/Services/SiteInfo.h Added : /trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp Added : /trunk/MgDev/Common/MapGuideCommon/Services/SiteManager.h Modified : /trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonClassId.h Modified : /trunk/MgDev/Common/MapGuideCommon/System/MapGuideCommonFactory.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp Modified : /trunk/MgDev/Common/MapGuideCommon/System/UserInformation.h Modified : /trunk/MgDev/Server/src/Common/Manager/SessionCache.cpp Modified : /trunk/MgDev/Server/src/Services/Site/ServerSiteService.cpp Modified : /trunk/MgDev/Server/src/UnitTesting/Makefile.am Added : /trunk/MgDev/Server/src/UnitTesting/TestSiteManager.cpp Added : /trunk/MgDev/Server/src/UnitTesting/TestSiteManager.h Modified : /trunk/MgDev/Server/src/UnitTesting/UnitTesting.cpp Modified : /trunk/MgDev/Server/src/UnitTesting/UnitTesting.vcproj Modified : /trunk/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp Modified : /trunk/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp Modified : /trunk/MgDev/Web/src/HttpHandler/HttpWmsGetCapabilities.cpp Modified : /trunk/MgDev/Web/src/HttpHandler/WmsMapUtil.cpp Modified : /trunk/MgDev/Web/src/MapGuideApi/MapGuideApiGen.xml Modified : /trunk/MgDev/Web/src/mapadmin/about.php Modified : /trunk/MgDev/Web/src/mapadmin/displaypackagelog.php Modified : /trunk/MgDev/Web/src/mapadmin/loadpackage.php Modified : /trunk/MgDev/Web/src/mapadmin/login.php Modified : /trunk/MgDev/Web/src/mapadmin/makepackage.php Modified : /trunk/MgDev/Web/src/mapadmin/packagemanagement.php Modified : /trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php Modified : /trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php Modified : /trunk/MgDev/Web/src/mapadmin/servermanagement.php Modified : /trunk/MgDev/Web/src/mapadmin/serverproperties.php Modified : /trunk/MgDev/Web/src/mapadmin/servicesproperties.php Index: Common/MapGuideCommon/Services/SiteManager.h =================================================================== --- Common/MapGuideCommon/Services/SiteManager.h (revision 0) +++ Common/MapGuideCommon/Services/SiteManager.h (revision 1040) @@ -0,0 +1,78 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +#include "MapGuideCommon.h" + +#ifndef MG_SITEMANAGER_H_ +#define MG_SITEMANAGER_H_ + +class MgSiteInfo; +typedef std::vector MgSiteVector; + +class MG_MAPGUIDE_API MgSiteManager : public MgGuardDisposable +{ +DECLARE_CLASSNAME(MgSiteManager) + +public: + +/// Constructors/Destructor + + virtual ~MgSiteManager(); + +private: + + MgSiteManager(); + +/// Methods + +public: + + virtual void Dispose(); + static MgSiteManager* GetInstance(); + + MgConnectionProperties* GetConnectionProperties(MgUserInformation* userInfo, + MgSiteInfo* siteInfo, + MgSiteInfo::MgPortType type); + + MgConnectionProperties* GetConnectionProperties(MgUserInformation* userInfo, + MgSiteInfo::MgPortType type, + bool useSessionIP); + + MgConnectionProperties* GetSupportServerConnectionProperties(CREFSTRING supportServer, + MgUserInformation* userInfo, + MgSiteInfo::MgPortType type); + + MgSiteInfo* GetSiteInfo(INT32 index); + MgSiteInfo* GetSiteInfo(STRING target, INT32 port); + MgSiteInfo* GetNextSite(); + INT32 GetSiteCount(); + +private: + void Initialize(); + void ClearSiteInfo(); + +/// Data Members + +private: + MgConfiguration* m_configuration; + static Ptr sm_siteManager; + static ACE_Recursive_Thread_Mutex sm_siteManagerMutex; + + UINT16 m_index; + MgSiteVector m_sites; +}; + +#endif // MG_SITEMANAGER_H_ Index: Common/MapGuideCommon/Services/Site.h =================================================================== --- Common/MapGuideCommon/Services/Site.h (revision 1039) +++ Common/MapGuideCommon/Services/Site.h (revision 1040) @@ -338,7 +338,7 @@ /// \exception MgConnectionFailedException /// void Open(MgUserInformation* userInformation); - + void Open(MgUserInformation* userInformation, MgSiteInfo* siteInfo); //////////////////////////////////////////////////////////////////////// /////////// /// \brief /// Closes the current Site Server connection. @@ -350,17 +350,7 @@ /// void Close(); - //////////////////////////////////////////////////////////////////////// /////////// /// \brief - /// Gets the address of the Site Server. This value may be used in ServerAdmin to open a connection to the - /// Site Server for administration purposes. - /// - /// \return - /// Returns the site server address. - /// - STRING GetSiteServerAddress(); - - /// \brief /// HasWarning() method reports if there is a current warning. /// /// \return @@ -772,6 +762,10 @@ /// void RemoveServer(CREFSTRING name); + MgSiteInfo* GetSiteServerInfo(INT32 index); + INT32 GetSiteServerCount(); + STRING GetCurrentSiteAddress(); + INTERNAL_API: //////////////////////////////////////////////////////////////////////// /// @@ -796,6 +790,9 @@ /// /// \param userInformation /// User information to authenticate against. + /// \param siteInfo + /// Used to specify which site server to connect to. If NULL, the next + /// available site server is used. /// \param requiredRoles /// Required roles to validate against. /// \param returnAssignedRoles @@ -810,6 +807,7 @@ /// \exception MgUnauthorizedAccessException /// MgStringCollection* Authenticate(MgUserInformation* userInformation, + MgSiteInfo* siteInfo, MgStringCollection* requiredRoles, bool returnAssignedRoles); protected: Index: Common/MapGuideCommon/Services/SiteInfo.cpp =================================================================== --- Common/MapGuideCommon/Services/SiteInfo.cpp (revision 0) +++ Common/MapGuideCommon/Services/SiteInfo.cpp (revision 1040) @@ -0,0 +1,210 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +#include "MapGuideCommon.h" + +IMPLEMENT_DYNCREATE(MgSiteInfo); + +///-------------------------------------------------------------------- -------- +/// +/// Constructs the object. +/// +///-------------------------------------------------------------------- -------- + +MgSiteInfo::MgSiteInfo(CREFSTRING target, INT32 sitePort, INT32 clientPort, INT32 adminPort) : + m_clientPort(clientPort), + m_sitePort(sitePort), + m_adminPort(adminPort), + m_target(target), + m_status(Ok) +{ +} + +///-------------------------------------------------------------------- -------- +/// +/// Constructs the object. +/// +///-------------------------------------------------------------------- -------- + +MgSiteInfo::MgSiteInfo() : + m_clientPort(0), + m_sitePort(0), + m_adminPort(0), + m_target(L""), + m_status(Uninitialized) +{ +} + +///-------------------------------------------------------------------- -------- +/// +/// Constructs the object. +/// +///-------------------------------------------------------------------- -------- + +MgSiteInfo::MgSiteInfo(CREFSTRING hexString) : + m_clientPort(0), + m_sitePort(0), + m_adminPort(0), + m_target(L""), + m_status(Uninitialized) +{ + if(hexString.length() >= HexStringLength) + { + UINT32 n1, n2, n3, n4; + + // Read the IP parts into their variables + if(::swscanf(hexString.c_str(), L"%2X%2X%2X%2X%4X%4X%4X", &n1, &n2, &n3, &n4, &m_sitePort, &m_clientPort, &m_adminPort) == 7) + { + // Write the 4 'n' values into an IP string + wchar_t buffer[20]; + swprintf(buffer, 20, L"%u.%u.%u.%u", n1, n2, n3, n4); + m_target = buffer; + m_status = Ok; + } + } +} + +///-------------------------------------------------------------------- -------- +/// +/// Destructs the object. +/// +///-------------------------------------------------------------------- -------- + +MgSiteInfo::~MgSiteInfo() +{ +} + +///-------------------------------------------------------------------- -------- +/// +/// Disposes the object. +/// +///-------------------------------------------------------------------- -------- + +void MgSiteInfo::Dispose() +{ + delete this; +} + +///////////////////////////////////////////////////////////////// +/// +/// Returns the classId. +/// +INT32 MgSiteInfo::GetClassId() +{ + return m_cls_id; +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Serialize data to TCP/IP stream. +/// +void MgSiteInfo::Serialize(MgStream* stream) +{ + stream->WriteString(m_target); + stream->WriteInt32(m_sitePort); + stream->WriteInt32(m_clientPort); + stream->WriteInt32(m_adminPort); + stream->WriteInt32((INT32)m_status); +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Deserialize data from TCP/IP stream. +/// +void MgSiteInfo::Deserialize(MgStream* stream) +{ + stream->GetString(m_target); + stream->GetInt32(m_sitePort); + stream->GetInt32(m_clientPort); + stream->GetInt32(m_adminPort); + INT32 statusVal; + stream->GetInt32(statusVal); + m_status = (MgSiteStatus)statusVal; +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Returns the hex string representation of the target and ports +/// +STRING MgSiteInfo::ToHexString() +{ + STRING hexString; + UINT32 n1, n2, n3, n4; + wchar_t buffer[30]; + if (4 == ::swscanf(m_target.c_str(), L"%u.%u.%u.%u", &n1, &n2, &n3, &n4)) + { + swprintf(buffer, 30, L"%.2X%.2X%.2X%.2X%.4X%.4X%.4X", n1, n2, n3, n4, m_sitePort, m_clientPort, m_adminPort); + hexString = buffer; + } + return hexString; +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Returns the IP target +/// +STRING MgSiteInfo::GetTarget() +{ + return m_target; +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Returns the port for the specified connection type +/// +INT32 MgSiteInfo::GetPort(MgPortType type) +{ + INT32 port = 0; + switch(type) + { + case Client: + { + port = m_clientPort; + break; + } + case Site: + { + port = m_sitePort; + break; + } + case Admin: + { + port = m_adminPort; + break; + } + }; + return port; +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Returns the status of this site server connection +/// +MgSiteInfo::MgSiteStatus MgSiteInfo::GetStatus() +{ + return m_status; +} + +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Sets the status of this site server connection +/// +void MgSiteInfo::SetStatus(MgSiteStatus status) +{ + m_status = status; +} + + Index: Common/MapGuideCommon/Services/SiteConnection.cpp =================================================================== --- Common/MapGuideCommon/Services/SiteConnection.cpp (revision 1039) +++ Common/MapGuideCommon/Services/SiteConnection.cpp (revision 1040) @@ -118,10 +118,16 @@ m_connProp = new MgConnectionProperties(userInformation, L"", 0); } // Site connection properties for web-tier or server-2-server interaction - else if (m_isWebTier || m_isServer) + else if (m_isWebTier) { - m_connProp = GetSiteConnectionProperties(userInformation); + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + m_connProp = siteManager->GetConnectionProperties(userInformation, MgSiteInfo::Client, true); } + else if(m_isServer) + { + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + m_connProp = siteManager->GetConnectionProperties(userInformation, MgSiteInfo::Client, false); + } if (m_connProp == NULL) { @@ -303,7 +309,8 @@ IsServiceLocal(MgServiceType::MappingService) || IsServiceLocal(MgServiceType::RenderingService) || IsServiceLocal(MgServiceType::ResourceService) || - IsServiceLocal(MgServiceType::TileService) ) + IsServiceLocal(MgServiceType::TileService) || + IsServiceLocal(MgServiceType::KmlService) ) { isServer = true; } @@ -502,51 +509,6 @@ return connProp.Detach(); } -/// -/// Gets the site ipaddress and port# for connection -/// - -MgConnectionProperties* MgSiteConnection::GetSiteConnectionProperties( - MgUserInformation* userInformation) -{ - Ptr connProp; - STRING target = L""; - INT32 port = 0; - - try - { - // Get ip address for site server - m_config->GetStringValue( MgConfigProperties::SiteConnectionPropertiesSection, - MgConfigProperties::SiteConnectionPropertyIpAddress, - target, - MgConfigProperties::DefaultSiteConnectionPropertyIpAddress); - - // Get the client port - m_config->GetIntValue( MgConfigProperties::ClientConnectionPropertiesSection, - MgConfigProperties::ClientConnectionPropertyPort, - port, - MgConfigProperties::DefaultClientConnectionPropertyPort); - - // Use the client port for Server/Web Tier communications. - connProp = new MgConnectionProperties(userInformation, target, port); - - } - catch (MgException* me) - { - // Site property address/client port not found, invalid config.ini - SAFE_RELEASE(me); - - MgStringCollection arguments; - arguments.Add(m_config->GetFileName()); - - throw new MgConfigurationException( - L"MgSiteConnection.GetSiteConnectionProperties", - __LINE__, __WFILE__, &arguments, L"", NULL); - } - - return connProp.Detach(); -} - //////////////////////////////////////////////////////////////////////// /////// /// /// Authenticates a user. Index: Common/MapGuideCommon/Services/SiteManager.cpp =================================================================== --- Common/MapGuideCommon/Services/SiteManager.cpp (revision 0) +++ Common/MapGuideCommon/Services/SiteManager.cpp (revision 1040) @@ -0,0 +1,346 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +#include "MapGuideCommon.h" + +// Process-wide MgSiteManager +Ptr MgSiteManager::sm_siteManager = (MgSiteManager*)NULL; +ACE_Recursive_Thread_Mutex MgSiteManager::sm_siteManagerMutex; + +#define MIN(x,y) ((x) < (y) ? (x) : (y)) + +///-------------------------------------------------------------------- -------- +/// +/// Constructs the object. +/// +///-------------------------------------------------------------------- -------- + +MgSiteManager::MgSiteManager() +{ + m_configuration = MgConfiguration::GetInstance(); + assert(NULL != m_configuration); + + Initialize(); +} + +///-------------------------------------------------------------------- -------- +/// +/// Destructs the object. +/// +///-------------------------------------------------------------------- -------- + +MgSiteManager::~MgSiteManager() +{ + MG_TRY() + + ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) MgSiteManager::~MgSiteManager()\n"))); + + ClearSiteInfo(); + + MG_CATCH(L"MgSiteManager.~MgSiteManager") +} + +///-------------------------------------------------------------------- -------- +/// +/// Disposes the object. +/// +///-------------------------------------------------------------------- -------- + +void MgSiteManager::Dispose() +{ + delete this; +} + +///-------------------------------------------------------------------- -------- +/// +/// Releases the stored site information +/// +///-------------------------------------------------------------------- -------- + +void MgSiteManager::ClearSiteInfo() +{ + for(MgSiteVector::iterator iter = m_sites.begin(); iter != m_sites.end(); iter++) + { + SAFE_RELEASE(*iter); + } + m_sites.clear(); +} + +///-------------------------------------------------------------------- -------- +/// +/// Returns the pointer to a process-wide MgSiteManager. +/// +///-------------------------------------------------------------------- -------- + +MgSiteManager* MgSiteManager::GetInstance() +{ + MG_TRY() + + ACE_TRACE("MgSiteManager::GetInstance"); + + if (MgSiteManager::sm_siteManager == NULL) + { + // Perform Double-Checked Locking Optimization. + ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance(), NULL)); + + if (MgSiteManager::sm_siteManager == NULL) + { + MgSiteManager::sm_siteManager = new MgSiteManager(); + } + } + + MG_CATCH_AND_THROW(L"MgSiteManager.GetInstance") + + // To avoid overheads and maintain thread safety, + // do not assign this returned static singleton to a Ptr object. + return MgSiteManager::sm_siteManager; +} + +///-------------------------------------------------------------------- -------- +/// +/// Intializes the site manager. +/// +///-------------------------------------------------------------------- -------- + +void MgSiteManager::Initialize() +{ + ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sm_siteManagerMutex)); + + MG_TRY() + + ACE_DEBUG((LM_DEBUG, ACE_TEXT( "(%P|%t) MgSiteManager::Initialize()\n"))); + + ClearSiteInfo(); + MgConfiguration* configuration = MgConfiguration::GetInstance(); + assert(NULL != configuration); + + // Get the IP address and port for the site server. + + STRING targets; + STRING sitePorts; + STRING clientPorts; + STRING adminPorts; + + configuration->GetStringValue( + MgConfigProperties::SiteConnectionPropertiesSection, + MgConfigProperties::SiteConnectionPropertyIpAddress, + targets, + MgConfigProperties::DefaultSiteConnectionPropertyIpAddress); + + configuration->GetStringValue( + MgConfigProperties::SiteConnectionPropertiesSection, + MgConfigProperties::SiteConnectionPropertyPort, + sitePorts, + L""); + + configuration->GetStringValue( + MgConfigProperties::ClientConnectionPropertiesSection, + MgConfigProperties::ClientConnectionPropertyPort, + clientPorts, + L""); + + configuration->GetStringValue( + MgConfigProperties::AdministrativeConnectionPropertiesSection, + MgConfigProperties::AdministrativeConnectionPropertyPort, + adminPorts, + L""); + + Ptr targetValues = MgStringCollection::ParseCollection(targets, L","); + Ptr sitePortValues = MgStringCollection::ParseCollection(sitePorts, L","); + Ptr clientPortValues = MgStringCollection::ParseCollection(clientPorts, L","); + Ptr adminPortValues = MgStringCollection::ParseCollection(adminPorts, L","); + + INT32 defaultSitePort = sitePortValues->GetCount() > 0 ? MgUtil::StringToInt32(sitePortValues->GetItem(0)) : MgConfigProperties::DefaultSiteConnectionPropertyPort; + INT32 defaultClientPort = clientPortValues->GetCount() > 0 ? MgUtil::StringToInt32(clientPortValues->GetItem(0)) : MgConfigProperties::DefaultClientConnectionPropertyPort; + INT32 defaultAdminPort = adminPortValues->GetCount() > 0 ? MgUtil::StringToInt32(adminPortValues->GetItem(0)) : MgConfigProperties::DefaultAdministrativeConnectionPropertyPort; + + int numTargets = targetValues->GetCount(); + for(int i = 0; i < numTargets; i++) + { + INT32 sitePort = sitePortValues->GetCount() > i ? MgUtil::StringToInt32(sitePortValues->GetItem(i)) : defaultSitePort; + INT32 clientPort = clientPortValues->GetCount() > i ? MgUtil::StringToInt32(clientPortValues->GetItem(i)) : defaultClientPort; + INT32 adminPort = adminPortValues->GetCount() > i ? MgUtil::StringToInt32(adminPortValues->GetItem(i)) : defaultAdminPort; + + STRING targetIP; + MgIpUtil::HostNameToAddress(targetValues->GetItem(i), targetIP); + Ptr siteInfo = new MgSiteInfo(targetIP, + sitePort, clientPort, adminPort); + m_sites.push_back(SAFE_ADDREF((MgSiteInfo*)siteInfo)); + } + + MG_CATCH_AND_THROW(L"MgSiteManager.Initialize") +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves connection properties for a site server. If useSessionIP is true +/// and the userInfo contains a session ID, the connection properties will be +/// generated for the site that contains that session. +/// +///-------------------------------------------------------------------- -------- + +MgConnectionProperties* MgSiteManager::GetConnectionProperties(MgUserInformation* userInfo, + MgSiteInfo::MgPortType type, + bool useSessionIP) +{ + MgConnectionProperties* connProps = NULL; + + // Determine if the user info contains a session ID + STRING sessionId = userInfo->GetMgSessionId(); + if(useSessionIP && !sessionId.empty()) + { + size_t length = sessionId.length(); + if(length > MgSiteInfo::HexStringLength) + { + STRING siteHexString = sessionId.substr(length - MgSiteInfo::HexStringLength, MgSiteInfo::HexStringLength); + Ptr siteInfo = new MgSiteInfo(siteHexString); + if(siteInfo->GetStatus() == MgSiteInfo::Ok) + { + connProps = GetConnectionProperties(userInfo, siteInfo, type); + } + } + } + else + { + Ptr nextSite = GetNextSite(); + if(nextSite != NULL) + { + connProps = GetConnectionProperties(userInfo, nextSite, type); + } + } + + return connProps; +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves connection properties for the site specified in the siteInfo object +/// +///-------------------------------------------------------------------- -------- +MgConnectionProperties* MgSiteManager::GetConnectionProperties(MgUserInformation* userInfo, + MgSiteInfo* siteInfo, + MgSiteInfo::MgPortType type) +{ + MgConnectionProperties* connProps = NULL; + if(siteInfo != NULL) + { + connProps = new MgConnectionProperties(userInfo, siteInfo->GetTarget(), siteInfo->GetPort(type)); + } + return connProps; +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves connection properties for a support server. If useSessionIP is true +/// and the userInfo contains a session ID, the connection properties will be +/// generated for the site that contains that session. +/// +///-------------------------------------------------------------------- -------- +MgConnectionProperties* MgSiteManager::GetSupportServerConnectionProperties(CREFSTRING supportServer, + MgUserInformation* userInfo, + MgSiteInfo::MgPortType type) +{ + MgConnectionProperties* supportConnProps = NULL; + + // Session Affinity: Retrieve the site server corresponding to this user info + MgConnectionProperties* siteConnProps = GetConnectionProperties(userInfo, type, true); + if(siteConnProps != NULL) + { + // Create support server connection props using the specified IP target and the same admin port + // used by the site server + supportConnProps = new MgConnectionProperties(userInfo, supportServer, siteConnProps->GetPort()); + } + return supportConnProps; +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves site info for the next site server that has an Ok status. +/// +///-------------------------------------------------------------------- -------- +MgSiteInfo* MgSiteManager::GetNextSite() +{ + MgSiteInfo* nextSite = NULL; + + int numSites = (int)m_sites.size(); + for(int siteIndex = 0; siteIndex < numSites; siteIndex++) + { + int siteToTry = (m_index + siteIndex) % numSites; + MgSiteInfo* siteInfo = m_sites.at(siteToTry); + if(siteInfo->GetStatus() == MgSiteInfo::Ok) + { + nextSite = siteInfo; + m_index = siteToTry + 1; + break; + } + } + + return SAFE_ADDREF(nextSite); +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves the number of configured site servers +/// +///-------------------------------------------------------------------- -------- +INT32 MgSiteManager::GetSiteCount() +{ + return (INT32)m_sites.size(); +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves site info for the site server corresponding to the specified index +/// +///-------------------------------------------------------------------- -------- +MgSiteInfo* MgSiteManager::GetSiteInfo(INT32 index) +{ + MgSiteInfo* siteInfo = NULL; + if((UINT32)index < m_sites.size()) + { + siteInfo = m_sites.at(index); + } + return SAFE_ADDREF(siteInfo); +} + +///-------------------------------------------------------------------- -------- +/// +/// Retrieves site info for the site server matching the specified target and port +/// +///-------------------------------------------------------------------- -------- +MgSiteInfo* MgSiteManager::GetSiteInfo(STRING target, INT32 port) +{ + Ptr matchingSiteInfo; + matchingSiteInfo = NULL; + + for(int i = 0; i < GetSiteCount(); i++) + { + Ptr siteInfo = GetSiteInfo(i); + if(siteInfo->GetTarget() == target) + { + INT32 sitePort = siteInfo->GetPort(MgSiteInfo::Site); + INT32 clientPort = siteInfo->GetPort(MgSiteInfo::Client); + INT32 adminPort = siteInfo->GetPort(MgSiteInfo::Admin); + if(port == sitePort || port == clientPort || port == adminPort) + { + matchingSiteInfo = siteInfo; + break; + } + } + } + + return SAFE_ADDREF((MgSiteInfo*)matchingSiteInfo); +} Index: Common/MapGuideCommon/Services/ServerAdmin.h =================================================================== --- Common/MapGuideCommon/Services/ServerAdmin.h (revision 1039) +++ Common/MapGuideCommon/Services/ServerAdmin.h (revision 1040) @@ -69,6 +69,21 @@ //////////////////////////////////////////////////////////////////////// /////////// /// \brief + /// Opens a connection to a Server. + /// + /// \param userInformation + /// User information - credentials, locale, session identifier + /// + /// \return + /// Nothing + /// + /// \exception MgServerNotFoundException + /// \exception MgConnectionFailedException + /// + void Open(MgUserInformation* userInformation); + + //////////////////////////////////////////////////////////////////////// /////////// + /// \brief /// Closes the current Server connection. /// /// \return Index: Common/MapGuideCommon/Services/SiteInfo.h =================================================================== --- Common/MapGuideCommon/Services/SiteInfo.h (revision 0) +++ Common/MapGuideCommon/Services/SiteInfo.h (revision 1040) @@ -0,0 +1,106 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +#include "MapGuideCommon.h" + +#ifndef MG_SITEINFO_H_ +#define MG_SITEINFO_H_ + +class MG_MAPGUIDE_API MgSiteInfo : public MgSerializable +{ + DECLARE_DYNCREATE_COREDATA(); + DECLARE_CLASSNAME(MgSiteInfo) + +EXTERNAL_API: + + enum MgSiteStatus + { + Ok, + UnableToConnect, + TimedOut, + Uninitialized + }; + + enum MgPortType + { + Client, + Site, + Admin + }; + + +/// Constructors/Destructor + + MgSiteInfo(); + MgSiteInfo(CREFSTRING target, INT32 sitePort, INT32 clientPort, INT32 adminPort); + virtual ~MgSiteInfo(); + +/// Methods + + STRING GetTarget(); + INT32 GetPort(MgPortType type); + MgSiteStatus GetStatus(); + void SetStatus(MgSiteStatus); + +INTERNAL_API: + + ////////////////////////////////////////////////////////////////// + /// \brief + /// Serialize data to TCP/IP stream + /// + /// \param stream + /// Stream + /// + virtual void Serialize(MgStream* stream); + + ////////////////////////////////////////////////////////////////// + /// \brief + /// Deserialize data from TCP/IP stream + /// + /// \param stream + /// Stream + /// + virtual void Deserialize(MgStream* stream); + + // Create a new MgSiteInfo instance, and initialize it from a hex string + MgSiteInfo(CREFSTRING hexString); + + // Retrieve a hex string that encodes the site info connection params + STRING ToHexString(); + + static const INT32 HexStringLength = 20; + +protected: + + INT32 GetClassId(); + virtual void Dispose(); + +/// Data Members + +private: + + STRING m_target; + INT32 m_clientPort; + INT32 m_sitePort; + INT32 m_adminPort; + MgSiteStatus m_status; + +CLASS_ID: + static const INT32 m_cls_id = MapGuide_Service_SiteInfo; + +}; + +#endif // MG_SITEINFO_H_ Index: Common/MapGuideCommon/Services/ServerAdmin.cpp =================================================================== --- Common/MapGuideCommon/Services/ServerAdmin.cpp (revision 1039) +++ Common/MapGuideCommon/Services/ServerAdmin.cpp (revision 1040) @@ -52,18 +52,33 @@ //////////////////////////////////////////////////////////////////////// /////////// /// -/// Opens a connection to a specified Server. +/// Opens a connection to a specified support Server. /// /// Server IP address or DNS name. /// /// -// +/// /// UserCredentials to authenticate against /// -/// -/// Administrator's locale. Server should honor all operations on this connection -/// using the Administrator's locale. In the first revision, this may only apply to -/// error and warning messages. +/// +/// Nothing +/// +/// +/// EXCEPTIONS: +/// MgServerNotFoundException +/// MgConnectionFailedException +void MgServerAdmin::Open(CREFSTRING supportServer, MgUserInformation* userInformation) +{ + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + m_connProp = siteManager->GetSupportServerConnectionProperties(supportServer, userInformation, MgSiteInfo::Admin); +} + +/////////////////////////////////////////////////////////////////////// //////////// +/// +/// Opens a connection to a server. +/// +/// +/// UserCredentials to authenticate against /// /// /// Nothing @@ -72,18 +87,10 @@ /// EXCEPTIONS: /// MgServerNotFoundException /// MgConnectionFailedException -void MgServerAdmin::Open(CREFSTRING server, MgUserInformation* userInformation) +void MgServerAdmin::Open(MgUserInformation* userInformation) { - INT32 adminPort; - //get the port for administration connection - MgConfiguration* config = MgConfiguration::GetInstance(); - config->GetIntValue(MgConfigProperties::AdministrativeConnectionProperti esSection, - MgConfigProperties::AdministrativeConnectionPropertyPort, - adminPort, - MgConfigProperties::DefaultAdministrativeConnectionPropertyPort); - - - m_connProp = new MgConnectionProperties(userInformation, server, adminPort); + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + m_connProp = siteManager->GetConnectionProperties(userInformation, MgSiteInfo::Admin, true); } //////////////////////////////////////////////////////////////////////// /////////// Index: Common/MapGuideCommon/Services/ServerConnection.cpp =================================================================== --- Common/MapGuideCommon/Services/ServerConnection.cpp (revision 1039) +++ Common/MapGuideCommon/Services/ServerConnection.cpp (revision 1040) @@ -88,13 +88,19 @@ void MgServerConnection::Open(MgUserInformation* userInformation, MgConnectionProperties* connProp) { m_connProp = SAFE_ADDREF(connProp); - bool connected = m_serverConnImp->Connect((MgUtil::WideCharToMultiByte(m_connProp->GetTar get())).c_str(), m_connProp->GetPort()); + bool connected = m_serverConnImp->Connect(( + MgUtil::WideCharToMultiByte(m_connProp->GetTarget())).c_str(), + m_connProp->GetPort()); // Could not connect if (!connected) + { throw new MgConnectionFailedException(L"MgServerConnection.Open", __LINE__, __WFILE__, NULL, L"", NULL); - - m_isOpen = true; + } + else + { + m_isOpen = true; + } } ////////////////////////////////////////////////////////////////// Index: Common/MapGuideCommon/Services/Site.cpp =================================================================== --- Common/MapGuideCommon/Services/Site.cpp (revision 1039) +++ Common/MapGuideCommon/Services/Site.cpp (revision 1040) @@ -78,7 +78,7 @@ //////////////////////////////////////////////////////////////////////// /////// /// -/// Opens a connection to the Site Server. +/// Opens a connection to a Site Server. /// void MgSite::Open(MgUserInformation* userInformation) @@ -87,11 +87,27 @@ // Authenticate the user. - Authenticate(userInformation, NULL, false); + Authenticate(userInformation, NULL, NULL, false); MG_SITE_CATCH_AND_THROW(L"MgSite.Open") } +/////////////////////////////////////////////////////////////////////// //////// +/// +/// Opens a connection to the specified Site Server. +/// + +void MgSite::Open(MgUserInformation* userInformation, MgSiteInfo* siteInfo) +{ + MG_SITE_TRY() + + // Authenticate the user. + + Authenticate(userInformation, siteInfo, NULL, false); + + MG_SITE_CATCH_AND_THROW(L"MgSite.Open") +} + //////////////////////////////////////////////////////////////////////// /////////// /// /// Closes the current Site Server connection. @@ -109,31 +125,43 @@ //////////////////////////////////////////////////////////////////////// /////////// /// -/// Gets the address of the Site Server. This value may be used in ServerAdmin to open a connection to the -/// Site Server for administration purposes. +/// Gets the addresses of the Site Servers. /// /// /// Returns the site server address. /// /// -STRING MgSite::GetSiteServerAddress() +MgSiteInfo* MgSite::GetSiteServerInfo(INT32 index) { - STRING address = L""; + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + return siteManager->GetSiteInfo(index); +} - MG_SITE_TRY() +/////////////////////////////////////////////////////////////////////// //////////// +/// +/// Gets the addresses of the Site Servers. +/// +/// +/// Returns the site server address. +/// +/// +INT32 MgSite::GetSiteServerCount() +{ + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + return siteManager->GetSiteCount(); +} - // Get Site Server Address - MgConfiguration* pConfig = MgConfiguration::GetInstance(); - pConfig->GetStringValue( MgConfigProperties::SiteConnectionPropertiesSection, - MgConfigProperties::SiteConnectionPropertyIpAddress, - address, - MgConfigProperties::DefaultSiteConnectionPropertyIpAddress); +STRING MgSite::GetCurrentSiteAddress() +{ + STRING target = L""; + if(m_connProp != NULL) + { + target = m_connProp->GetTarget(); + } + return target; +} - MG_SITE_CATCH_AND_THROW( L"MgSite::GetSiteServerAddress" ) - return address; -} - //////////////////////////////////////////////////////////////////////// /////////// /// /// Create a session for the user and return the unique session identifier. For the @@ -1186,7 +1214,7 @@ } MgStringCollection* MgSite::Authenticate(MgUserInformation* userInformation, - MgStringCollection* requiredRoles, bool returnAssignedRoles) + MgSiteInfo* siteInfo, MgStringCollection* requiredRoles, bool returnAssignedRoles) { MgCommand cmd; @@ -1197,24 +1225,18 @@ MgConfiguration* configuration = MgConfiguration::GetInstance(); assert(NULL != configuration); - // Get the IP address and port for the site server. - - STRING target; - INT32 port = 0; - - configuration->GetStringValue( - MgConfigProperties::SiteConnectionPropertiesSection, - MgConfigProperties::SiteConnectionPropertyIpAddress, - target, - MgConfigProperties::DefaultSiteConnectionPropertyIpAddress); - configuration->GetIntValue( - MgConfigProperties::SiteConnectionPropertiesSection, - MgConfigProperties::SiteConnectionPropertyPort, - port, - MgConfigProperties::DefaultSiteConnectionPropertyPort); - assert(m_connProp == NULL); - m_connProp = new MgConnectionProperties(userInformation, target, port); + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + if(siteInfo != NULL) + { + m_connProp = siteManager->GetConnectionProperties(userInformation, + siteInfo, MgSiteInfo::Site); + } + else + { + m_connProp = siteManager->GetConnectionProperties(userInformation, + MgSiteInfo::Site, true); + } cmd.ExecuteCommand(m_connProp, // Connection MgCommand::knObject, // Return type Index: Common/MapGuideCommon/Controller/DwfController.cpp =================================================================== --- Common/MapGuideCommon/Controller/DwfController.cpp (revision 1039) +++ Common/MapGuideCommon/Controller/DwfController.cpp (revision 1040) @@ -44,6 +44,17 @@ MgByteReader* MgDwfController::GetMap(MgResourceIdentifier* mapDefinition, CREFSTRING dwfVersion, CREFSTRING eMapVersion, MgPropertyCollection* mapViewCommands) { + //create a session id to associate with this map + STRING sessionId; + Ptr userInfo = m_siteConn->GetUserInfo(); + if (userInfo.p != NULL) sessionId = userInfo->GetMgSessionId(); + if (sessionId.empty()) + { + Ptr site = m_siteConn->GetSite(); + sessionId = site->CreateSession(); + userInfo->SetMgSessionId(sessionId); + } + //get an instance of the resource service Ptr resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService); @@ -56,17 +67,6 @@ //apply commands ApplyMapViewCommands(map, mapViewCommands); - //create a session id to associate with this map - STRING sessionId; - Ptr userInfo = m_siteConn->GetUserInfo(); - if (userInfo.p != NULL) sessionId = userInfo->GetMgSessionId(); - if (sessionId.empty()) - { - Ptr site = m_siteConn->GetSite(); - sessionId = site->CreateSession(); - userInfo->SetMgSessionId(sessionId); - } - //save the map state in the session repository Ptr resId = new MgResourceIdentifier(L"Session:" + sessionId + L"//" + mapDefinition->GetName() + L"." + MgResourceType::Map); map->Save((MgResourceService*)resourceService, (MgResourceIdentifier*)resId); Index: Common/MapGuideCommon/System/UserInformation.cpp =================================================================== --- Common/MapGuideCommon/System/UserInformation.cpp (revision 1039) +++ Common/MapGuideCommon/System/UserInformation.cpp (revision 1040) @@ -221,6 +221,29 @@ /////////////////////////////// /// +///Create a sessionid, and encode the IP address of the site server that +///created it into the ID +/// +STRING MgUserInformation::CreateMgSessionId(MgSiteInfo* siteInfo) +{ + STRING id = CreateMgSessionId(); + + STRING hexAddress; + if(siteInfo != NULL) + { + hexAddress = siteInfo->ToHexString(); + if(!hexAddress.empty()) + { + id.append(L"_"); + id.append(hexAddress); + } + } + + return id; +} + +/////////////////////////////// +/// ///Clears the current sessionid /// void MgUserInformation::ClearMgSessionId() Index: Common/MapGuideCommon/System/UserInformation.h =================================================================== --- Common/MapGuideCommon/System/UserInformation.h (revision 1039) +++ Common/MapGuideCommon/System/UserInformation.h (revision 1040) @@ -37,7 +37,9 @@ class MgUserInformation; template class MG_MAPGUIDE_API Ptr; +class MgSiteInfo; + /// \defgroup MgUserInformation MgUserInformation /// \ingroup Common_Module /// \{ @@ -317,6 +319,7 @@ /// New session id /// STRING CreateMgSessionId(); + STRING CreateMgSessionId(MgSiteInfo* siteInfo); /////////////////////////////// /// \brief Index: Common/MapGuideCommon/System/MapGuideCommonFactory.cpp =================================================================== --- Common/MapGuideCommon/System/MapGuideCommonFactory.cpp (revision 1039) +++ Common/MapGuideCommon/System/MapGuideCommonFactory.cpp (revision 1040) @@ -94,6 +94,7 @@ fact->Register(MapGuide_Service_ServerInformation, MgServerInformation::CreateObject); fact->Register(MapGuide_Service_PackageStatusInformation, MgPackageStatusInformation::CreateObject); fact->Register(MapGuide_Service_UserInformation, MgUserInformation::CreateObject); + fact->Register(MapGuide_Service_SiteInfo, MgSiteInfo::CreateObject); fact->Register(PlatformBase_FeatureService_DataReader, MgProxyDataReader::CreateObject); fact->Register(PlatformBase_FeatureService_FeatureReader, MgProxyFeatureReader::CreateObject); fact->Register(PlatformBase_FeatureService_GwsFeatureReader, MgProxyGwsFeatureReader::CreateObject); Index: Common/MapGuideCommon/System/MapGuideCommonClassId.h =================================================================== --- Common/MapGuideCommon/System/MapGuideCommonClassId.h (revision 1039) +++ Common/MapGuideCommon/System/MapGuideCommonClassId.h (revision 1040) @@ -105,6 +105,7 @@ #define MapGuide_Service_Site MAPGUIDE_SERVICE_ID+5 #define MapGuide_Service_UserInformation MAPGUIDE_SERVICE_ID+6 #define MapGuide_Service_ServerAdmin MAPGUIDE_SERVICE_ID+7 +#define MapGuide_Service_SiteInfo MAPGUIDE_SERVICE_ID+8 // Drawing Service #define MapGuide_DrawingService_DrawingService MAPGUIDE_DRAWINGSERVICE_ID+0 Index: Common/MapGuideCommon/MapGuideCommonBuild.cpp =================================================================== --- Common/MapGuideCommon/MapGuideCommonBuild.cpp (revision 1039) +++ Common/MapGuideCommon/MapGuideCommonBuild.cpp (revision 1040) @@ -115,6 +115,8 @@ #include "Services/ServerConnectionStack.cpp" #include "Services/ServerInformation.cpp" #include "Services/Site.cpp" +#include "Services/SiteManager.cpp" +#include "Services/SiteInfo.cpp" #include "Services/SiteConnection.cpp" #include "Services/TileDefs.cpp" #include "Services/TileService.cpp" Index: Common/MapGuideCommon/MapGuideCommon.vcproj =================================================================== --- Common/MapGuideCommon/MapGuideCommon.vcproj (revision 1039) +++ Common/MapGuideCommon/MapGuideCommon.vcproj (revision 1040) @@ -1029,6 +1029,22 @@ > + + + + + + + + Index: Common/MapGuideCommon/Makefile.am =================================================================== --- Common/MapGuideCommon/Makefile.am (revision 1039) +++ Common/MapGuideCommon/Makefile.am (revision 1040) @@ -108,6 +108,8 @@ Services/ServerConnectionStack.cpp \ Services/ServerInformation.cpp \ Services/Site.cpp \ + Services/SiteManager.cpp \ + Services/SiteInfo.cpp \ Services/SiteConnection.cpp \ Services/TileDefs.cpp \ Services/TileService.cpp \ @@ -221,6 +223,8 @@ Services/ServerConnectionStack.h \ Services/ServerInformation.h \ Services/Site.h \ + Services/SiteManager.h \ + Services/SiteInfo.h \ Services/SiteConnection.h \ Services/TileDefs.h \ Services/TileService.h \ Index: Common/MapGuideCommon/MapGuideCommon.h =================================================================== --- Common/MapGuideCommon/MapGuideCommon.h (revision 1039) +++ Common/MapGuideCommon/MapGuideCommon.h (revision 1040) @@ -99,6 +99,8 @@ #include "Net/IOperationHandler.h" #include "Services/Command.h" #include "Services/Site.h" +#include "Services/SiteInfo.h" +#include "Services/SiteManager.h" #include "Services/ConnectionProperties.h" #include "Services/SiteConnection.h" #include "Services/DrawingDefs.h" Index: Server/src/Services/Site/ServerSiteService.cpp =================================================================== --- Server/src/Services/Site/ServerSiteService.cpp (revision 1039) +++ Server/src/Services/Site/ServerSiteService.cpp (revision 1040) @@ -720,7 +720,9 @@ if (session.empty()) { - session = currUserInfo->CreateMgSessionId(); + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + Ptr siteInfo = siteManager->GetSiteInfo(0); + session = currUserInfo->CreateMgSessionId(siteInfo); currUserInfo->SetMgSessionId(session); } else Index: Server/src/Common/Manager/SessionCache.cpp =================================================================== --- Server/src/Common/Manager/SessionCache.cpp (revision 1039) +++ Server/src/Common/Manager/SessionCache.cpp (revision 1040) @@ -144,6 +144,22 @@ MgSessionInfo* MgSessionCache::GetSessionInfo(CREFSTRING session, bool strict) const { +#ifdef _DEBUG + // Session Affinity: Check that the session was created by this server + if(!session.empty()) + { + STRING hexString = session.substr(session.length() - MgSiteInfo::HexStringLength); + Ptr sessionSiteInfo = new MgSiteInfo(hexString); + if(sessionSiteInfo->GetStatus() == MgSiteInfo::Ok) + { + MgSiteManager* siteManager = MgSiteManager::GetInstance(); + Ptr firstSite = siteManager->GetSiteInfo(0); + assert(sessionSiteInfo->GetTarget().compare(firstSite->GetTarget()) == 0); + assert(sessionSiteInfo->GetPort(MgSiteInfo::Site) == firstSite->GetPort(MgSiteInfo::Site)); + } + } +#endif //_DEBUG + MgSessionInfo* sessionInfo = NULL; MgSessionInfoMap::const_iterator i = m_sessionInfoMap.find(session); Index: Server/src/UnitTesting/UnitTesting.vcproj =================================================================== --- Server/src/UnitTesting/UnitTesting.vcproj (revision 1039) +++ Server/src/UnitTesting/UnitTesting.vcproj (revision 1040) @@ -277,6 +277,14 @@ > + + + + Index: Server/src/UnitTesting/TestSiteManager.h =================================================================== --- Server/src/UnitTesting/TestSiteManager.h (revision 0) +++ Server/src/UnitTesting/TestSiteManager.h (revision 1040) @@ -0,0 +1,59 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#ifndef _TestSiteManager_H +#define _TestSiteManager_H + +#include + +class TestSiteManager : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE(TestSiteManager); + CPPUNIT_TEST(TestStart); // This must be the very first unit test + + CPPUNIT_TEST(TestCase_ValidSiteManager); + CPPUNIT_TEST(TestCase_GetSiteConnectionProperties); + CPPUNIT_TEST(TestCase_GetSiteConnectionPropertiesWithSession); + CPPUNIT_TEST(TestCase_GetSiteConnectionPropertiesIgnoreSession); + CPPUNIT_TEST(TestCase_GetSpecificSiteConnectionProperties); + CPPUNIT_TEST(TestCase_GetSupportServerConnectionProperties); + CPPUNIT_TEST(TestCase_GetSiteInfo); + CPPUNIT_TEST(TestCase_GetSiteCount); + + CPPUNIT_TEST(TestEnd); // This must be the very last unit test + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp(); + void tearDown(); + void TestStart(); + void TestEnd(); + + void TestCase_ValidSiteManager(); + void TestCase_GetSiteConnectionProperties(); + void TestCase_GetSiteConnectionPropertiesWithSession(); + void TestCase_GetSiteConnectionPropertiesIgnoreSession(); + void TestCase_GetSpecificSiteConnectionProperties(); + void TestCase_GetSupportServerConnectionProperties(); + void TestCase_GetSiteInfo(); + void TestCase_GetSiteCount(); + +private: + static void TestWorkerThreads(); +}; + +#endif // _TestSiteManager_H Index: Server/src/UnitTesting/UnitTesting.cpp =================================================================== --- Server/src/UnitTesting/UnitTesting.cpp (revision 1039) +++ Server/src/UnitTesting/UnitTesting.cpp (revision 1040) @@ -55,6 +55,7 @@ runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestServerMana ger").makeTest()); runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestServiceMan ager").makeTest()); runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestSiteServic e").makeTest()); + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestSiteManage r").makeTest()); } else if(ACE_OS::strcasecmp(MG_WCHAR_TO_TCHAR(test), MG_WCHAR_TO_TCHAR(MgResources::ServerCmdTestListTests)) == 0) { @@ -75,6 +76,7 @@ ACE_OS::printf(" ServerManager\n"); ACE_OS::printf(" ServiceManager\n"); ACE_OS::printf(" SiteService\n"); + ACE_OS::printf(" SiteManager\n"); ACE_OS::printf("\n"); bRunTests = false; @@ -139,6 +141,11 @@ ACE_DEBUG((LM_INFO, ACE_TEXT(">>>>> Running only Site Service tests. <<<<<\n\n"))); runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestSiteServic e").makeTest()); } + else if(ACE_OS::strcasecmp(MG_WCHAR_TO_TCHAR(test), ACE_LIB_TEXT("SiteManager")) == 0) + { + ACE_DEBUG((LM_INFO, ACE_TEXT(">>>>> Running only Site Manager tests. <<<<<\n\n"))); + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestSiteManage r").makeTest()); + } else { // Test suite not found @@ -162,6 +169,7 @@ runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestServerMana ger").makeTest()); runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestServiceMan ager").makeTest()); runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestSiteServic e").makeTest()); + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry("TestSiteManage r").makeTest()); } if(bRunTests) Index: Server/src/UnitTesting/TestSiteManager.cpp =================================================================== --- Server/src/UnitTesting/TestSiteManager.cpp (revision 0) +++ Server/src/UnitTesting/TestSiteManager.cpp (revision 1040) @@ -0,0 +1,315 @@ +// +// Copyright (C) 2004-2006 Autodesk, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of version 2.1 of the GNU Lesser +// General Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +#include "MapGuideCommon.h" +#include "TestSiteManager.h" + +const STRING TEST_SESSION_ID = L"48cb0286-0000-1000-8001-005056c00008_en_6F7A8590045708AE0D05"; +const STRING TEST_TARGET = L"111.122.133.144"; +const STRING TEST_SUPPORT_SERVER = L"144.133.122.111"; +const INT32 TEST_SITE_PORT = 1111; +const INT32 TEST_CLIENT_PORT = 2222; +const INT32 TEST_ADMIN_PORT = 3333; +const STRING TEST_LOCALE = L"en"; + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(TestSiteManager, "TestSiteManager"); + +void TestSiteManager::setUp() +{ +} + +void TestSiteManager::tearDown() +{ +} + +void TestSiteManager::TestStart() +{ + ACE_DEBUG((LM_INFO, ACE_TEXT("\nRunning Site Manager tests.\n"))); +} + +void TestSiteManager::TestEnd() +{ + ACE_DEBUG((LM_INFO, ACE_TEXT("\nSite Manager tests completed.\n\n"))); +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// This test case checks to see if there is a valid MgSiteManager and that +/// there is only 1 MgSiteManager. +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_ValidSiteManager() +{ + MgSiteManager* pMgSiteManager = MgSiteManager::GetInstance(); + CPPUNIT_ASSERT(pMgSiteManager != NULL); + + MgSiteManager* pMgSiteManager2 = MgSiteManager::GetInstance(); + CPPUNIT_ASSERT(pMgSiteManager == pMgSiteManager2); +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get the MgConnectionProperties for a site connection +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSiteConnectionProperties() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Create admin user info + Ptr userInfo = new MgUserInformation(L"Administrator", L"admin"); + + // Get connection properties + Ptr connProps = pSiteManager->GetConnectionProperties(userInfo, MgSiteInfo::Site, false); + + // Verify that we received connection properties + CPPUNIT_ASSERT(connProps != NULL); + + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get the MgConnectionProperties for a site connection when the user info +/// contains a session ID +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSiteConnectionPropertiesWithSession() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Create admin user info + Ptr userInfo = new MgUserInformation(L"Administrator", L"admin"); + userInfo->SetMgSessionId(TEST_SESSION_ID); + + // Get connection properties, allowing overrides from the session ID + Ptr connPropsSite = pSiteManager->GetConnectionProperties(userInfo, MgSiteInfo::Site, true); + Ptr connPropsClient = pSiteManager->GetConnectionProperties(userInfo, MgSiteInfo::Client, true); + Ptr connPropsAdmin = pSiteManager->GetConnectionProperties(userInfo, MgSiteInfo::Admin, true); + + // Verify that the connection properties match those in the session ID + CPPUNIT_ASSERT(connPropsSite != NULL && connPropsClient != NULL && connPropsAdmin != NULL); + CPPUNIT_ASSERT(connPropsSite->GetTarget() == TEST_TARGET); + CPPUNIT_ASSERT(connPropsSite->GetPort() == TEST_SITE_PORT); + CPPUNIT_ASSERT(connPropsClient->GetPort() == TEST_CLIENT_PORT); + CPPUNIT_ASSERT(connPropsAdmin->GetPort() == TEST_ADMIN_PORT); + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get the MgConnectionProperties for a site connection when the user info +/// contains a session ID, but that ID is not to be used to override the +/// connection parameters +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSiteConnectionPropertiesIgnoreSession() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Create admin user info + Ptr userInfo = new MgUserInformation(L"Administrator", L"admin"); + userInfo->SetMgSessionId(TEST_SESSION_ID); + + // Get connection properties without allowing overrides from the session ID + Ptr connPropsSite = pSiteManager->GetConnectionProperties(userInfo, MgSiteInfo::Site, false); + + CPPUNIT_ASSERT(connPropsSite != NULL); + CPPUNIT_ASSERT(connPropsSite->GetTarget() != TEST_TARGET); + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get a connection to a site specified in an MgSiteInfo object +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSpecificSiteConnectionProperties() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Create admin user info + Ptr userInfo = new MgUserInformation(L"Administrator", L"admin"); + + // Create MgSiteInfo object + Ptr siteInfo = new MgSiteInfo(TEST_TARGET, TEST_SITE_PORT, TEST_CLIENT_PORT, TEST_ADMIN_PORT); + + // Get connection properties for the specified site + Ptr connPropsSite = pSiteManager->GetConnectionProperties(userInfo, siteInfo, MgSiteInfo::Admin); + + CPPUNIT_ASSERT(connPropsSite != NULL); + CPPUNIT_ASSERT(connPropsSite->GetTarget() == TEST_TARGET); + CPPUNIT_ASSERT(connPropsSite->GetPort() == TEST_ADMIN_PORT); + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get a connection to a support server. The support server IP is specified +/// in the request, but the port is the one used by the site server. +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSupportServerConnectionProperties() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Create admin user info + Ptr userInfo = new MgUserInformation(L"Administrator", L"admin"); + userInfo->SetMgSessionId(TEST_SESSION_ID); + + // Create MgSiteInfo object + Ptr siteInfo = new MgSiteInfo(TEST_TARGET, TEST_SITE_PORT, TEST_CLIENT_PORT, TEST_ADMIN_PORT); + + // Get connection properties for the specified site + Ptr connPropsSite = pSiteManager->GetSupportServerConnectionProperties(TEST_SUPPORT_SERVER, userInfo, MgSiteInfo::Site); + + // The port should come from the site stored in the session ID. The target should be the support server IP. + CPPUNIT_ASSERT(connPropsSite != NULL); + CPPUNIT_ASSERT(connPropsSite->GetTarget() == TEST_SUPPORT_SERVER); + CPPUNIT_ASSERT(connPropsSite->GetPort() == TEST_SITE_PORT); + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get an MgSiteInfo object representing the connection properties for this +/// site server +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSiteInfo() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Get the number of site servers + Ptr siteInfo = pSiteManager->GetSiteInfo(0); + + // Verify that we received a valid site info object + CPPUNIT_ASSERT(siteInfo != NULL); + CPPUNIT_ASSERT(siteInfo->GetTarget() != L""); + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + +///-------------------------------------------------------------------- -------- +/// Test Case Description: +/// +/// Get the number of site servers configured in the INI file. Should always be +/// 1 for serverconfig.ini. +///-------------------------------------------------------------------- -------- +void TestSiteManager::TestCase_GetSiteCount() +{ + try + { + // Get the site manager instance + MgSiteManager* pSiteManager = MgSiteManager::GetInstance(); + + // Get the number of site servers + INT32 numSites = pSiteManager->GetSiteCount(); + + // The number of sites should always be 1 on the server. + // It can be greater than 1 in the web tier. + CPPUNIT_ASSERT(numSites == 1); + } + catch(MgException* e) + { + STRING message = e->GetDetails(TEST_LOCALE); + SAFE_RELEASE(e); + CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str())); + } + catch(...) + { + throw; + } +} + Index: Server/src/UnitTesting/Makefile.am =================================================================== --- Server/src/UnitTesting/Makefile.am (revision 1039) +++ Server/src/UnitTesting/Makefile.am (revision 1040) @@ -38,6 +38,7 @@ TestServiceManager.cpp \ TestSiteService.cpp \ TestTileService.cpp \ + TestSiteManager.cpp \ UnitTesting.cpp noinst_HEADERS = \ @@ -55,6 +56,7 @@ TestServiceManager.h \ TestSiteService.h \ TestTileService.h \ + TestSiteManager.h \ UnitTesting.h libMgUnitTesting_la_LIBADD = -lcppunit Index: Web/src/MapGuideApi/MapGuideApiGen.xml =================================================================== --- Web/src/MapGuideApi/MapGuideApiGen.xml (revision 1039) +++ Web/src/MapGuideApi/MapGuideApiGen.xml (revision 1040) @@ -258,6 +258,7 @@
+
Index: Web/src/mapadmin/makepackage.php =================================================================== --- Web/src/mapadmin/makepackage.php (revision 1039) +++ Web/src/mapadmin/makepackage.php (revision 1040) @@ -28,9 +28,8 @@ global $site; global $userInfo; - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); // Make sure folder name begins with "Library://" and ends with "/" if ( ( strcasecmp( "Library", $folderName ) == 0 ) || ( strcasecmp( "Library:", $folderName ) == 0 ) ) Index: Web/src/mapadmin/serverdatafunctions.php =================================================================== --- Web/src/mapadmin/serverdatafunctions.php (revision 1039) +++ Web/src/mapadmin/serverdatafunctions.php (revision 1040) @@ -623,7 +623,7 @@ // Put Site Server in $targetTable. $serverRec = new ServerTableRecord( "Site Server", "" ); - $serverKey = $site->GetSiteServerAddress(); + $serverKey = $site->GetCurrentSiteAddress(); $targetTable[ $serverKey ] = $serverRec; $dbData = $site->EnumerateServers(); @@ -642,7 +642,6 @@ $targetTable[ $key ] = $val; // Get values for Online and Services fields - $siteServerAddress = $site->GetSiteServerAddress(); foreach ( $targetTable as $key => $val ) { try @@ -1789,9 +1788,8 @@ global $site; global $userInfo; - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); // Call server to get comprehensive list of packages. @@ -1836,9 +1834,8 @@ return false; // Delete the package - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); $serverAdmin->DeletePackage( $packageName ); $serverAdmin->Close(); @@ -1865,9 +1862,8 @@ $targetTable = array(); $packages = GetPackageList(); - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); $iPackage = -1; foreach ( $packages as $val ) @@ -1951,9 +1947,8 @@ global $errInvalidWMSFile; // Get WMS reader - $siteServer = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServer, $userInfo ); + $serverAdmin->Open( $userInfo ); $wmsReader = $serverAdmin->GetDocument( 'Wms:OgcWmsService.config' ); $serverAdmin->Close(); @@ -2008,9 +2003,8 @@ global $errInvalidWMSFile; // Get WMS reader - $siteServer = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServer, $userInfo ); + $serverAdmin->Open( $userInfo ); $wmsReader = $serverAdmin->GetDocument( 'Wms:OgcWmsService.config' ); // Set WMS metadata @@ -2111,9 +2105,8 @@ global $errInvalidWFSFile; // Get WFS reader - $siteServer = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServer, $userInfo ); + $serverAdmin->Open( $userInfo ); $wfsReader = $serverAdmin->GetDocument( 'Wfs:OgcWfsService.config' ); $serverAdmin->Close(); @@ -2168,9 +2161,8 @@ global $errInvalidWFSFile; // Get WFS reader - $siteServer = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServer, $userInfo ); + $serverAdmin->Open( $userInfo ); $wfsReader = $serverAdmin->GetDocument( 'Wfs:OgcWfsService.config' ); // Set WFS metadata Index: Web/src/mapadmin/servermanagement.php =================================================================== --- Web/src/mapadmin/servermanagement.php (revision 1039) +++ Web/src/mapadmin/servermanagement.php (revision 1040) @@ -65,8 +65,8 @@ $currPage = 1; - $siteServerAddress = $site->GetSiteServerAddress(); - + $siteServerAddress = $site->GetCurrentSiteAddress(); + if ( array_key_exists( $selectedServerID, $_POST ) ) { $selectedServer = $_POST[ $selectedServerID ]; Index: Web/src/mapadmin/login.php =================================================================== --- Web/src/mapadmin/login.php (revision 1039) +++ Web/src/mapadmin/login.php (revision 1040) @@ -29,10 +29,12 @@ $homePage = NULL; $adminID = ""; $adminIDID = 'adminID'; + $serverSelectionID = 'SiteServer'; $adminPassword = ""; $adminPasswordID = 'adminPassword'; $locale = "en"; // localizable string $errorMsg = ""; + $numSites = 0; if ( FirstTimeHere( $pageName ) ) { @@ -75,21 +77,57 @@ $userInfo->SetClientAgent( $clientAgent ); $clientIp = array_key_exists( 'REMOTE_ADDR', $_SERVER ) ? $_SERVER['REMOTE_ADDR'] : ""; $userInfo->SetClientIp( $clientIp ); - + // Create a Site object and open the Site Server. $site = new MgSite(); $site->Open( $userInfo ); - + // Check that we have Administrator permission. $servers = $site->EnumerateServers(); + + // Determine the available site servers + $numSites = $site->GetSiteServerCount(); + + if($numSites == 1) + { + // Create session + $adminSession = $site->CreateSession(); + + // Save session variables + SaveSessionVars(); + + // Success - switch to ServerManagement page. + header( 'Location: servermanagement.php?'.strip_tags(SID) ); + exit(); + } + else + { + $siteInfo = GetSiteServerSelection($serverSelectionID); + if($siteInfo != NULL) + { + // Close the existing site connection + if($site != NULL) + { + $site->Close(); + } + + // Determine the selected site + $site = new MgSite(); + + // Create a connection to the selected site + $site->Open($userInfo, $siteInfo); + + // Create a session + $adminSession = $site->CreateSession(); + $userInfo->SetMgSessionId($adminSession); - // Create session - $adminSession = $site->CreateSession(); - - // Success - switch to ServerManagement page. - SaveSessionVars(); - header( 'Location: servermanagement.php?'.strip_tags(SID) ); - exit(); + // Save the session variables. All requests will now be directed to + // our selected server since it hosts the current session. + SaveSessionVars(); + header( 'Location: servermanagement.php?'.strip_tags(SID) ); + exit(); + } + } } } catch ( MgException $e ) @@ -128,6 +166,15 @@ + 1) + { + echo '', "\n"; + echo '', "\n"; + } + ?> Index: Web/src/mapadmin/resizablepagecomponents.php =================================================================== --- Web/src/mapadmin/resizablepagecomponents.php (revision 1039) +++ Web/src/mapadmin/resizablepagecomponents.php (revision 1040) @@ -67,6 +67,7 @@ define( 'CONFIGURE_LOGS_TITLE', "Configure Logs" ); define( 'CONFIGURE_SERVICES_TITLE', "Configure Services" ); define( 'LOG_MANAGEMENT_TITLE', "Manage Logs" ); + define( 'SELECT_SITE_SERVER_TITLE', "Select Site Server" ); define( 'ADD_GROUP_TITLE', "Add Group" ); define( 'EDIT_GROUP_TITLE', "Edit Group" ); @@ -454,7 +455,64 @@ echo '
',"\n"; } } + + function DisplaySiteServerSelector( $selectedSiteServerID ) + { + global $site; + + echo '', "\n"; + } + + function GetSiteServerSelection( $selectedSiteServerID ) + { + global $site; + global $_POST; + global $_GET; + global $errNotFound; + $selectedSite = NULL; + $selectedSiteServerName = ""; + if ( array_key_exists( $selectedSiteServerID.NO_PERSISTENCE_FLAG, $_POST ) ) + { + $selectedSiteServerName = $_POST[ $selectedSiteServerID.NO_PERSISTENCE_FLAG ]; + } + else + { + if ( array_key_exists( $selectedSiteServerID, $_GET ) ) + $selectedSiteServerName = $_GET[ $selectedSiteServerID ]; + } + if($site != NULL && $selectedSiteServerName != "") + { + for($i = 0; $i < $site->GetSiteServerCount(); $i++) + { + $siteInfo = $site->GetSiteServerInfo($i); + if($siteInfo != NULL) + { + $target = $siteInfo->GetTarget(); + $port = $siteInfo->GetPort(MgSiteInfo_Admin); + $id = $target.":".strval($port); + if($id == $selectedSiteServerName) + { + $selectedSite = $siteInfo; + } + } + } + } + return $selectedSite; + } + class ToolbarButtonRecord { var $id; @@ -763,7 +821,8 @@ if ( $serviceSelector == NULL ) return; - if ( $serviceSelector->serverAddress == $site->GetSiteServerAddress() ) + $siteServerAddress = $site->GetCurrentSiteAddress(); + if ( $serviceSelector->serverAddress == $siteServerAddress ) { echo 'Site
', "\n"; echo 'Resource
', "\n"; Index: Web/src/mapadmin/packagemanagement.php =================================================================== --- Web/src/mapadmin/packagemanagement.php (revision 1039) +++ Web/src/mapadmin/packagemanagement.php (revision 1040) @@ -64,9 +64,9 @@ // Construct suggestedPackageName $dateData = getdate(); $dateStr = sprintf( "%04u%02u%02u", $dateData[ 'year' ], $dateData[ 'mon' ], $dateData[ 'mday' ] ); - $siteServer = $site->GetSiteServerAddress(); + $siteServer = $site->GetCurrentSiteAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServer, $userInfo ); + $serverAdmin->Open( $userInfo ); $genProps = new GeneralPropsRecord(); $genProps->GetProps( $serverAdmin ); $serverAdmin->Close(); Index: Web/src/mapadmin/loadpackage.php =================================================================== --- Web/src/mapadmin/loadpackage.php (revision 1039) +++ Web/src/mapadmin/loadpackage.php (revision 1040) @@ -28,9 +28,8 @@ global $site; global $userInfo; - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); set_time_limit(0); $serverAdmin->LoadPackage( $packageName ); Index: Web/src/mapadmin/servicesproperties.php =================================================================== --- Web/src/mapadmin/servicesproperties.php (revision 1039) +++ Web/src/mapadmin/servicesproperties.php (revision 1040) @@ -50,9 +50,8 @@ $pageEnabled = false; $bSiteServer = false; - // Get Server - $siteServerAddress = $site->GetSiteServerAddress(); + $siteServerAddress = $site->GetCurrentSiteAddress(); GetServerSelection( $selectedServerID, $selectedServer ); $serverRec = GetDataForServer( $selectedServer ); if ( $serverRec == NULL ) Index: Web/src/mapadmin/about.php =================================================================== --- Web/src/mapadmin/about.php (revision 1039) +++ Web/src/mapadmin/about.php (revision 1040) @@ -32,9 +32,8 @@ $appVersion = SITE_ADMINISTRATOR_VERSION; $errorMsg = ""; - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); $serverVersion = GetVersion( $serverAdmin ); } catch ( MgException $e ) Index: Web/src/mapadmin/displaypackagelog.php =================================================================== --- Web/src/mapadmin/displaypackagelog.php (revision 1039) +++ Web/src/mapadmin/displaypackagelog.php (revision 1040) @@ -30,9 +30,8 @@ global $site; global $userInfo; - $siteServerAddress = $site->GetSiteServerAddress(); $serverAdmin = new MgServerAdmin(); - $serverAdmin->Open( $siteServerAddress, $userInfo ); + $serverAdmin->Open( $userInfo ); $logReader = $serverAdmin->GetPackageLog( $packageName ); $serverAdmin->Close(); Index: Web/src/mapadmin/serverproperties.php =================================================================== --- Web/src/mapadmin/serverproperties.php (revision 1039) +++ Web/src/mapadmin/serverproperties.php (revision 1040) @@ -76,7 +76,7 @@ // Get Server - $siteServer = $site->GetSiteServerAddress(); + $siteServerAddress = $site->GetCurrentSiteAddress(); GetServerSelection( $selectedServerID, $selectedServer ); $serverRec = GetDataForServer( $selectedServer ); if ( $serverRec == NULL ) @@ -86,7 +86,7 @@ // Are we configuring the site or a support server? $pageEnabled = true; - $configuringSupportServer = $siteServer != $selectedServer; + $configuringSupportServer = $siteServerAddress != $selectedServer; // Is a refresh needed? if ( FirstTimeHere( $pageName ) ) Index: Web/src/HttpHandler/HttpGetSiteVersion.cpp =================================================================== --- Web/src/HttpHandler/HttpGetSiteVersion.cpp (revision 1039) +++ Web/src/HttpHandler/HttpGetSiteVersion.cpp (revision 1040) @@ -51,14 +51,9 @@ // Check common parameters ValidateCommonParameters(); - // Open connection to Mg server - Ptr mgSite = m_siteConn->GetSite(); - - STRING serverAddress = mgSite->GetSiteServerAddress(); - // Create ServerAdmin object Ptr serverAdmin = new MgServerAdmin(); - serverAdmin->Open(serverAddress, m_userInfo); + serverAdmin->Open(m_userInfo); // call the C++ APIs Ptr properties = serverAdmin->GetInformationProperties(); Index: Web/src/HttpHandler/HttpWmsGetCapabilities.cpp =================================================================== --- Web/src/HttpHandler/HttpWmsGetCapabilities.cpp (revision 1039) +++ Web/src/HttpHandler/HttpWmsGetCapabilities.cpp (revision 1040) @@ -47,13 +47,8 @@ { //TODO: Remove dependency on thread local storage MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo(); - Ptr mgSite; - mgSite = new MgSite(); - mgSite->Open(userInfo); - STRING serverAddress = mgSite->GetSiteServerAddress(); - Ptr serverAdmin = new MgServerAdmin(); - serverAdmin->Open(serverAddress,userInfo); + serverAdmin->Open(userInfo); Ptr brDoc; brDoc = serverAdmin->GetDocument(pszDoc); Index: Web/src/HttpHandler/HttpGetSiteInfo.cpp =================================================================== --- Web/src/HttpHandler/HttpGetSiteInfo.cpp (revision 1039) +++ Web/src/HttpHandler/HttpGetSiteInfo.cpp (revision 1040) @@ -51,14 +51,9 @@ // Check common parameters ValidateCommonParameters(); - // Open connection to Mg server - Ptr mgSite = m_siteConn->GetSite(); - - STRING serverAddress = mgSite->GetSiteServerAddress(); - // Create ServerAdmin object Ptr serverAdmin = new MgServerAdmin(); - serverAdmin->Open(serverAddress, m_userInfo); + serverAdmin->Open(m_userInfo); // call the C++ APIs Ptr properties = serverAdmin->GetInformationProperties(); Index: Web/src/HttpHandler/WmsMapUtil.cpp =================================================================== --- Web/src/HttpHandler/WmsMapUtil.cpp (revision 1039) +++ Web/src/HttpHandler/WmsMapUtil.cpp (revision 1040) @@ -47,13 +47,8 @@ { //TODO: Remove dependency on thread local storage MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo(); - Ptr mgSite; - mgSite = new MgSite(); - mgSite->Open(userInfo); - STRING serverAddress = mgSite->GetSiteServerAddress(); - Ptr serverAdmin = new MgServerAdmin(); - serverAdmin->Open(serverAddress,userInfo); + serverAdmin->Open(userInfo); Ptr brDoc; brDoc = serverAdmin->GetDocument(pszDoc); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070111/7861d1d2/attachment-0001.html From rbray at robertbray.net Thu Jan 11 11:52:05 2007 From: rbray at robertbray.net (Robert Bray) Date: Thu Jan 11 12:49:26 2007 Subject: [Mapguide_dev] PSC Meeting Today Message-ID: <45A66B35.4020406@robertbray.net> I would like to hold a PSC meeting today if folks are available. Agenda is posted here: http://wiki.osgeo.org/index.php/MapGuide_PSC_Meeting_01-11-2007. Thursday January 11th at 17:00 UTC (1:00 PM EST / 11:00 AM MST / 10:00 AM PST) http://www.timeanddate.com/worldclock/fixedtime.html?month=01&day=11&year=2007&hour=18&min=0&sec=0&p1=0 Bob From bruce.dechant at autodesk.com Thu Jan 11 12:04:03 2007 From: bruce.dechant at autodesk.com (Bruce Dechant) Date: Thu Jan 11 13:01:16 2007 Subject: [Mapguide_dev] svn commit: r1039 - Add missing entry for unit test file TEST.sdf Message-ID: Revision: 1039 Author: brucedechant Date: 4:36:21 PM, January 10, 2007 Message: Add missing entry for unit test file TEST.sdf ---- Modified : /trunk/MgDev/Server/src/PostBuild/PostBuild.mak Index: PostBuild.mak =================================================================== --- PostBuild.mak (revision 1038) +++ PostBuild.mak (revision 1039) @@ -173,6 +173,7 @@ ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml \ ..\..\bin\UnitTestFiles\SampleRepositoryContent.xml \ ..\..\bin\UnitTestFiles\TEST.FeatureSource \ + ..\..\bin\UnitTestFiles\TEST.sdf \ ..\..\bin\UnitTestFiles\UT_BaseMap.mdf \ ..\..\bin\UnitTestFiles\UT_Parcels.fs \ ..\..\bin\UnitTestFiles\UT_Parcels.ldf \ @@ -393,6 +394,7 @@ ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml \ ..\..\bin\UnitTestFiles\SampleRepositoryContent.xml \ ..\..\bin\UnitTestFiles\TEST.FeatureSource \ + ..\..\bin\UnitTestFiles\TEST.sdf \ ..\..\bin\UnitTestFiles\UT_BaseMap.mdf \ ..\..\bin\UnitTestFiles\UT_Parcels.fs \ ..\..\bin\UnitTestFiles\UT_Parcels.ldf \ @@ -477,6 +479,7 @@ if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml del /F ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryContent.xml del /F ..\..\bin\UnitTestFiles\SampleRepositoryContent.xml if EXIST ..\..\bin\UnitTestFiles\TEST.FeatureSource del /F ..\..\bin\UnitTestFiles\TEST.FeatureSource + if EXIST ..\..\bin\UnitTestFiles\TEST.sdf del /F ..\..\bin\UnitTestFiles\TEST.sdf if EXIST ..\..\bin\UnitTestFiles\UT_BaseMap.mdf del /F ..\..\bin\UnitTestFiles\UT_BaseMap.mdf if EXIST ..\..\bin\UnitTestFiles\UT_Parcels.fs del /F ..\..\bin\UnitTestFiles\UT_Parcels.fs if EXIST ..\..\bin\UnitTestFiles\UT_Parcels.ldf del /F ..\..\bin\UnitTestFiles\UT_Parcels.ldf @@ -556,6 +559,7 @@ if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml del /F ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryContent.xml del /F ..\..\bin\UnitTestFiles\SampleRepositoryContent.xml if EXIST ..\..\bin\UnitTestFiles\TEST.FeatureSource del /F ..\..\bin\UnitTestFiles\TEST.FeatureSource + if EXIST ..\..\bin\UnitTestFiles\TEST.sdf del /F ..\..\bin\UnitTestFiles\TEST.sdf if EXIST ..\..\bin\UnitTestFiles\UT_BaseMap.mdf del /F ..\..\bin\UnitTestFiles\UT_BaseMap.mdf if EXIST ..\..\bin\UnitTestFiles\UT_Parcels.fs del /F ..\..\bin\UnitTestFiles\UT_Parcels.fs if EXIST ..\..\bin\UnitTestFiles\UT_Parcels.ldf del /F ..\..\bin\UnitTestFiles\UT_Parcels.ldf @@ -664,11 +668,11 @@ ..\..\bin\UnitTestFiles\TEST.FeatureSource : "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.FeatureSource" if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles - if EXIST "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.FeatureSource" xcopy /r /d /y "..\..\..\UnitTest\TestData\FeatureService\SDF\Test.FeatureSource" ..\..\bin\UnitTestFiles\ + if EXIST "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.FeatureSource" xcopy /r /d /y "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.FeatureSource" ..\..\bin\UnitTestFiles\ ..\..\bin\UnitTestFiles\TEST.sdf : "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.sdf" if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles - if EXIST "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.sdf" xcopy /r /d /y "..\..\..\UnitTest\TestData\FeatureService\SDF\Test.sdf" ..\..\bin\UnitTestFiles\ + if EXIST "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.sdf" xcopy /r /d /y "..\..\..\UnitTest\TestData\FeatureService\SDF\TEST.sdf" ..\..\bin\UnitTestFiles\ ..\..\bin\UnitTestFiles\Sheboygan_Parcels.FeatureSource : "..\..\..\UnitTest\TestData\FeatureService\SDF\Sheboygan_Parcels.Feature Source" if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070111/3927a09e/attachment.html From amorsell at spatialgis.com Thu Jan 11 12:05:43 2007 From: amorsell at spatialgis.com (Andy Morsell) Date: Thu Jan 11 13:01:55 2007 Subject: [Mapguide_dev] PSC Meeting Today In-Reply-To: <45A66B35.4020406@robertbray.net> Message-ID: <00a901c735a2$bb732c90$6401a8c0@SPINAJM> Bob, I won't be able to attend. I tried to attend the last 3 meetings since I was not sure if they were being held or not.... ;) One item we still need to discuss is getting Autodesk legal to help us with any potential licensing issues of distributing the ECW and MrSID libraries with the GDAL provider. I do not know if you or anyone on the Autodesk end has forwarded this on or not. Andy -----Original Message----- From: mapguide_dev-bounces@lists.osgeo.org [mailto:mapguide_dev-bounces@lists.osgeo.org] On Behalf Of Robert Bray Sent: Thursday, January 11, 2007 8:52 AM To: mapguide_dev@lists.osgeo.org Subject: [Mapguide_dev] PSC Meeting Today I would like to hold a PSC meeting today if folks are available. Agenda is posted here: http://wiki.osgeo.org/index.php/MapGuide_PSC_Meeting_01-11-2007. Thursday January 11th at 17:00 UTC (1:00 PM EST / 11:00 AM MST / 10:00 AM PST) http://www.timeanddate.com/worldclock/fixedtime.html?month=01&day=11&year=20 07&hour=18&min=0&sec=0&p1=0 Bob _______________________________________________ Mapguide_dev mailing list Mapguide_dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_dev From pspencer at dmsolutions.ca Thu Jan 11 12:11:28 2007 From: pspencer at dmsolutions.ca (Paul Spencer) Date: Thu Jan 11 13:08:56 2007 Subject: [Mapguide_dev] PSC Meeting Today In-Reply-To: <45A66B35.4020406@robertbray.net> References: <45A66B35.4020406@robertbray.net> Message-ID: <087FB4C7-93CD-4E15-A789-552DECDCC380@dmsolutions.ca> I'm available Paul On 11-Jan-07, at 11:52 AM, Robert Bray wrote: > I would like to hold a PSC meeting today if folks are available. > Agenda is posted here: http://wiki.osgeo.org/index.php/ > MapGuide_PSC_Meeting_01-11-2007. > > Thursday January 11th at 17:00 UTC (1:00 PM EST / 11:00 AM MST / > 10:00 AM PST) > > http://www.timeanddate.com/worldclock/fixedtime.html? > month=01&day=11&year=2007&hour=18&min=0&sec=0&p1=0 www.timeanddate.com/worldclock/fixedtime.html? > month=01&day=11&year=2007&hour=18&min=0&sec=0&p1=0> > > > Bob > > > _______________________________________________ > Mapguide_dev mailing list > Mapguide_dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide_dev +-----------------------------------------------------------------+ |Paul Spencer pspencer@dmsolutions.ca | +-----------------------------------------------------------------+ |Chief Technology Officer | |DM Solutions Group Inc http://www.dmsolutions.ca/ | +-----------------------------------------------------------------+ From ScottH at mPower-tech.com Thu Jan 11 18:17:08 2007 From: ScottH at mPower-tech.com (Scott Hameister) Date: Thu Jan 11 19:12:55 2007 Subject: [Mapguide_dev] [Mapguide_users] MGRenderingService QueryFeatures In-Reply-To: <002d01c7359f$da703f50$18d167d1@domain.local> Message-ID: <005401c735d6$9db3d3b0$18d167d1@domain.local> OK Giving up on FCGI answers for QueryMapFeatures.... Anybody have any examples of the API using MGRenderingService and QueryFeatures...any language would do. Also Which Group should this go under??? Is Dev for Actual Open Source coders...or API programmers as well...I seem to get more answers from Dev but don't want to be impolite -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Thursday, January 11, 2007 10:45 AM To: Mapguide_users@lists.osgeo.org Subject: RE: [Mapguide_users] CGI QueryMapFeatures Is there any documentation on the FCGI OPERATIONS and params Yet? Since the WebAPI is so wrapped around it it would be nice to no what parameters are available... When I goto http://localhost/mapguide/mapagent/index.html "OPERATION=QueryMapFeatures" isn't even an option...and I'm assuming even this site doesn't give all the options of FCGI params either. -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Wednesday, January 10, 2007 6:47 PM To: Mapguide_users@lists.osgeo.org Subject: [Mapguide_users] CGI QueryMapFeatures I can't find documentation on the FCGI operation QueryMapFeatures When I change the ViewerAPi Code where it filters by the selectable and visible layers " LAYERNAMES=" + encodeURIComponent(GetVisSelLayers())" To a list of Non-visible layers it doesn't work.... ....I want users to be able to select features using the geometry on layers that are not visible as well for parsing purposes? Can I use this Operation for that _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users From amorsell at spatialgis.com Thu Jan 11 18:46:05 2007 From: amorsell at spatialgis.com (Andy Morsell) Date: Thu Jan 11 19:42:07 2007 Subject: [Mapguide_dev] RE: [Mapguide_users] MGRenderingService QueryFeatures In-Reply-To: <005401c735d6$9db3d3b0$18d167d1@domain.local> Message-ID: <00ea01c735da$a93194d0$6401a8c0@SPINAJM> To answer your question about which list to post to: mapguide_users is the proper one for end user support and questions. Dev is intended for the source coders and other things related to the MapGuide project including the Project Steering Committee. You might be getting more answers there since the coders are more likely following that list on a regular basis than the users list..... But, it should probably not become habit to post end user questions there. Andy Morsell, P.E. Spatial Integrators, Inc. http://www.SpatialGIS.com -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Thursday, January 11, 2007 3:17 PM To: Mapguide_users@lists.osgeo.org; mapguide_dev@lists.osgeo.org Subject: [Mapguide_users] MGRenderingService QueryFeatures OK Giving up on FCGI answers for QueryMapFeatures.... Anybody have any examples of the API using MGRenderingService and QueryFeatures...any language would do. Also Which Group should this go under??? Is Dev for Actual Open Source coders...or API programmers as well...I seem to get more answers from Dev but don't want to be impolite -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Thursday, January 11, 2007 10:45 AM To: Mapguide_users@lists.osgeo.org Subject: RE: [Mapguide_users] CGI QueryMapFeatures Is there any documentation on the FCGI OPERATIONS and params Yet? Since the WebAPI is so wrapped around it it would be nice to no what parameters are available... When I goto http://localhost/mapguide/mapagent/index.html "OPERATION=QueryMapFeatures" isn't even an option...and I'm assuming even this site doesn't give all the options of FCGI params either. -----Original Message----- From: mapguide_users-bounces@lists.osgeo.org [mailto:mapguide_users-bounces@lists.osgeo.org] On Behalf Of Scott Hameister Sent: Wednesday, January 10, 2007 6:47 PM To: Mapguide_users@lists.osgeo.org Subject: [Mapguide_users] CGI QueryMapFeatures I can't find documentation on the FCGI operation QueryMapFeatures When I change the ViewerAPi Code where it filters by the selectable and visible layers " LAYERNAMES=" + encodeURIComponent(GetVisSelLayers())" To a list of Non-visible layers it doesn't work.... ....I want users to be able to select features using the geometry on layers that are not visible as well for parsing purposes? Can I use this Operation for that _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users _______________________________________________ Mapguide_users mailing list Mapguide_users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide_users From rbray at robertbray.net Thu Jan 11 23:33:31 2007 From: rbray at robertbray.net (Robert Bray) Date: Fri Jan 12 00:30:47 2007 Subject: [Mapguide_dev] IMPORTANT: Mailing List Changes Message-ID: <45A70F9B.4050407@robertbray.net> An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/mapguide_dev/attachments/20070111/1422773a/attachment.html
Site Server:'; + DisplaySiteServerSelector($serverSelectionID); + echo '
Administrator ID: