[mapguide-commits] r4411 - in sandbox/rfc60/MgDev: . Common
Common/CoordinateSystem Common/Geometry
Common/Geometry/CoordinateSystem Common/Geometry/Spatial
Common/MapGuideCommon Common/MapGuideCommon/MapLayer
Common/MapGuideCommon/Services Common/MapGuideCommon/System
Common/MdfModel Common/PlatformBase/Services Common/Renderers
Common/Schema Common/Stylization
Oem/fusionMG/templates/mapguide/aqua
Oem/fusionMG/templates/mapguide/limegold
Oem/fusionMG/templates/mapguide/maroon
Oem/fusionMG/templates/mapguide/preview
Oem/fusionMG/templates/mapguide/slate
Oem/fusionMG/templates/mapguide/turquoiseyellow
Server/src/Common/Manager Server/src/Common/Thread
Server/src/Core Server/src/Gws/GwsCommon
Server/src/Gws/GwsQueryEngine Server/src/Gws/Include
Server/src/Services/Feature Server/src/Services/Mapping
Server/src/Services/Resource Server/src/Services/ServerAdmin
UnitTest/WebTier/MapAgent/MapAgentForms Web/src/ApacheAgent
Web/src/CgiAgent Web/src/DotNetUnmanagedApi/MapGuideCommon
Web/src/DotNetUnmanagedApi/Web Web/src/HttpHandler
Web/src/IsapiAgent Web/src/viewerfiles
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Dec 11 11:29:41 EST 2009
Author: uvlite
Date: 2009-12-11 11:29:40 -0500 (Fri, 11 Dec 2009)
New Revision: 4411
Added:
sandbox/rfc60/MgDev/Common/Schema/SiteInformation-2.2.0.xsd
sandbox/rfc60/MgDev/Common/Schema/SiteStatus-2.2.0.xsd
sandbox/rfc60/MgDev/Common/Schema/SiteVersion-2.2.0.xsd
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.h
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.h
sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.h
Modified:
sandbox/rfc60/MgDev/
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysEnvVariable.h
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.h
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.h
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.h
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysOneGrid.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp
sandbox/rfc60/MgDev/Common/CoordinateSystem/MentorUtil.cpp
sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMgrsGridSquarePosition.h
sandbox/rfc60/MgDev/Common/Geometry/Geometry.vcproj
sandbox/rfc60/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj
sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.h
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/Command.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.h
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.h
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.h
sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.cpp
sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.h
sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.cpp
sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.h
sandbox/rfc60/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp
sandbox/rfc60/MgDev/Common/PlatformBase/Services/Reader.h
sandbox/rfc60/MgDev/Common/ProductVersion.h
sandbox/rfc60/MgDev/Common/Renderers/AGGImageIO.cpp
sandbox/rfc60/MgDev/Common/Renderers/AGGRenderer.h
sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.cpp
sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.h
sandbox/rfc60/MgDev/Common/Stylization/ExpressionFunctionIf.cpp
sandbox/rfc60/MgDev/Common/Stylization/FeatureTypeStyleVisitor.h
sandbox/rfc60/MgDev/Common/Stylization/LineBuffer.cpp
sandbox/rfc60/MgDev/Common/Stylization/SE_Renderer.cpp
sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/aqua/ApplicationDefinition.xml
sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/limegold/ApplicationDefinition.xml
sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/maroon/ApplicationDefinition.xml
sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/preview/ApplicationDefinition.xml
sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/slate/ApplicationDefinition.xml
sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/ApplicationDefinition.xml
sandbox/rfc60/MgDev/Server/src/Common/Manager/Connection.cpp
sandbox/rfc60/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.cpp
sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.h
sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.vcproj
sandbox/rfc60/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
sandbox/rfc60/MgDev/Server/src/Common/Thread/ServerThread.vcproj
sandbox/rfc60/MgDev/Server/src/Core/EventTimer.h
sandbox/rfc60/MgDev/Server/src/Core/OperationThread.cpp
sandbox/rfc60/MgDev/Server/src/Core/Server.cpp
sandbox/rfc60/MgDev/Server/src/Core/ServerCore.vcproj
sandbox/rfc60/MgDev/Server/src/Core/ServerCoreBuild.cpp
sandbox/rfc60/MgDev/Server/src/Core/TimedEvent.h
sandbox/rfc60/MgDev/Server/src/Core/TimedEventHandler.cpp
sandbox/rfc60/MgDev/Server/src/Core/serverconfig.ini
sandbox/rfc60/MgDev/Server/src/Gws/GwsCommon/stdafx.h
sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp
sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/stdafx.h
sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsCommon.h
sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsQueryEngine.h
sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp
sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.h
sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp
sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerFeatureService.h
sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.h
sandbox/rfc60/MgDev/Server/src/Services/Feature/TransformCache.cpp
sandbox/rfc60/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
sandbox/rfc60/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp
sandbox/rfc60/MgDev/Server/src/Services/Resource/OpMoveResource.cpp
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/Makefile.am
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj
sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp
sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html
sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html
sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/siteserviceapi.html
sandbox/rfc60/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp
sandbox/rfc60/MgDev/Web/src/CgiAgent/CgiAgent.cpp
sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml
sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/Web/WebApiGen.xml
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.h
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.h
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandler.vcproj
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpRequest.cpp
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
sandbox/rfc60/MgDev/Web/src/HttpHandler/Makefile.am
sandbox/rfc60/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp
sandbox/rfc60/MgDev/Web/src/viewerfiles/ajaxmappane.templ
Log:
RFC60 sandbox merged with trunk rev 4410 (see mergeInfo in MgDev) trying to minimize delta to trunk..
Property changes on: sandbox/rfc60/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/MgDev:4214-4350
+ /trunk/MgDev:4214-4410
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysEnvVariable.h
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysEnvVariable.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysEnvVariable.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -8,4 +8,4 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-#define LINUX_COORD_PATH L"/usr/local/mapguideopensource/share/gis/coordsys"; // NOXLATE
\ No newline at end of file
+#define LINUX_COORD_PATH L"/usr/local/mapguideopensource/share/gis/coordsys"; // NOXLATE
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGridGeneric.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -33,7 +33,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CCoordinateSystemGridGeneric::CCoordinateSystemGridGeneric(bool bSetExceptionsOn)
:
- m_bExceptionsOn (bSetExceptionsOn),
+ m_bExceptionsOn (bSetExceptionsOn),
m_GridLineExceptionLevel (m_GridLineExceptionLevelK),
m_GridRegionExceptionLevel (m_GridRegionExceptionLevelK),
m_GridTickExceptionLevel (m_GridTickExceptionLevelK),
@@ -48,7 +48,7 @@
MgCoordinateSystem* pTargetCs,
bool bSetExceptionsOn)
:
- m_bExceptionsOn (bSetExceptionsOn),
+ m_bExceptionsOn (bSetExceptionsOn),
m_GridLineExceptionLevel (m_GridLineExceptionLevelK),
m_GridRegionExceptionLevel (m_GridRegionExceptionLevelK),
m_GridTickExceptionLevel (m_GridTickExceptionLevelK),
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -707,7 +707,7 @@
void CCoordinateSystemGridLine::ClearSegments (void)
{
m_LineSegments->Clear ();
-}
+}
void CCoordinateSystemGridLine::AddSegment (MgLineString* newSegment)
{
m_LineSegments->Add (newSegment);
@@ -727,9 +727,9 @@
MgCoordinate* northeast,
double curvePrecision,
INT32 maxPoints)
- :
- MgCoordinateSystemGridRegion (),
- m_RegionLabel (label),
+ :
+ MgCoordinateSystemGridRegion (),
+ m_RegionLabel (label),
m_RegionCenter (),
m_RegionBoundary (),
m_SouthLine (),
@@ -986,7 +986,7 @@
MgCoordinateSystemGridLineCollection (),
m_MemoryUse (),
m_GridLineExceptionLevel (gridLineExceptionLevel),
- m_GridLineCollection ()
+ m_GridLineCollection ()
{
m_MemoryUse = sizeof (MgCoordinateSystemGridLineCollection) + sizeof (MgDisposableCollection);
m_GridLineCollection = new MgDisposableCollection();
@@ -1078,8 +1078,8 @@
}
if ((m_MemoryUse + memoryUse) < m_GridLineExceptionLevel)
{
- m_GridLineCollection->SetItem (index,value);
-}
+ m_GridLineCollection->SetItem (index,value);
+ }
else
{
throw new MgGridDensityException(L"CCoordinateSystemGridLineCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -1110,7 +1110,7 @@
INT32 maxValue;
INT32 memoryUse;
Ptr<MgCoordinateSystemGridLine> aGridLine;
-
+
maxValue = m_GridLineExceptionLevel - m_MemoryUse;
memoryUse = aGridLineCollection->GetMemoryUsage ();
if (memoryUse > maxValue)
@@ -1153,7 +1153,7 @@
MgCoordinateSystemGridRegionCollection (),
m_MemoryUse (),
m_GridRegionExceptionLevel (gridRegionExceptionLevel),
- m_GridRegionCollection ()
+ m_GridRegionCollection ()
{
m_MemoryUse = sizeof (CCoordinateSystemGridRegionCollection) + sizeof (MgDisposableCollection);
m_GridRegionCollection = new MgDisposableCollection();
@@ -1215,9 +1215,9 @@
}
if ((m_MemoryUse + memoryUse) < m_GridRegionExceptionLevel)
{
- m_GridRegionCollection->SetItem (index,value);
+ m_GridRegionCollection->SetItem (index,value);
m_MemoryUse += memoryUse;
-}
+ }
else
{
throw new MgGridDensityException(L"CCoordinateSystemGridRegionCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -1230,9 +1230,9 @@
memoryUse = value->GetMemoryUsage ();
if ((memoryUse + m_MemoryUse) < m_GridRegionExceptionLevel)
{
- m_GridRegionCollection->Add (value);
+ m_GridRegionCollection->Add (value);
m_MemoryUse += memoryUse;
-}
+ }
else
{
throw new MgGridDensityException(L"CCoordinateSystemGridRegionCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -1245,7 +1245,7 @@
INT32 memoryUse;
INT32 maxValue;
Ptr<MgCoordinateSystemGridRegion> aGridRegion;
-
+
maxValue = m_GridRegionExceptionLevel - m_MemoryUse;
memoryUse = aGridRegionCollection->GetMemoryUsage ();
if (memoryUse > maxValue)
@@ -1293,7 +1293,7 @@
MgCoordinateSystemGridTickCollection (),
m_MemoryUse (),
m_GridTickExceptionLevel (gridTickExceptionLevel),
- m_GridTickCollection ()
+ m_GridTickCollection ()
{
m_MemoryUse = sizeof (CCoordinateSystemGridTickCollection) + sizeof (MgDisposableCollection);
m_GridTickCollection = new MgDisposableCollection();
@@ -1353,9 +1353,9 @@
}
if ((m_MemoryUse + memoryUse) < m_GridTickExceptionLevel)
{
- m_GridTickCollection->SetItem (index,value);
+ m_GridTickCollection->SetItem (index,value);
m_MemoryUse += memoryUse;
-}
+ }
else
{
throw new MgGridDensityException(L"CCoordinateSystemGridTickCollection.SetItem", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -1369,9 +1369,9 @@
memoryUse = value->GetMemoryUsage ();
if ((memoryUse + m_MemoryUse) < m_GridTickExceptionLevel)
{
- m_GridTickCollection->Add (value);
+ m_GridTickCollection->Add (value);
m_MemoryUse += memoryUse;
-}
+ }
else
{
throw new MgGridDensityException(L"CCoordinateSystemGridTickCollection.Add", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -1384,7 +1384,7 @@
INT32 maxValue;
INT32 memoryUse;
Ptr<MgCoordinateSystemGridTick> aGridTick;
-
+
maxValue = m_GridTickExceptionLevel - m_MemoryUse;
memoryUse = aGridTickCollection->GetMemoryUsage ();
if (memoryUse > maxValue)
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.h
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysGrids.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -184,7 +184,7 @@
////////////////////////////////////////////////////////////////////////////
/// \brief
- /// Sets a limit on thenumber of points generated by the complex curve
+ /// Sets a limit on the number of points generated by the complex curve
/// approximation algorithm.
/// \param maxPoints
/// The complex curve approximation algorithm cleanly terminates after this
@@ -197,7 +197,7 @@
/// probability of a runaway calculation.
void SetMaxCurvePoints (INT32 maxPoints);
- ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////
/// \brief
/// Returns the extents of the grid boundary.
/// \param eastMin
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMathComparator.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -263,10 +263,10 @@
// Check the appropriate number of parameters.
if (paramCount > 0)
{
- // Delta values are always in meters.
- if (!FloatEqual(def1.delta_X, def2.delta_X, kdEpsilonLinear)) return false;
- if (!FloatEqual(def1.delta_Y, def2.delta_Y, kdEpsilonLinear)) return false;
- if (!FloatEqual(def1.delta_Z, def2.delta_Z, kdEpsilonLinear)) return false;
+ // Delta values are always in meters.
+ if (!FloatEqual(def1.delta_X, def2.delta_X, kdEpsilonLinear)) return false;
+ if (!FloatEqual(def1.delta_Y, def2.delta_Y, kdEpsilonLinear)) return false;
+ if (!FloatEqual(def1.delta_Z, def2.delta_Z, kdEpsilonLinear)) return false;
if (paramCount == 4 || paramCount == 7)
{
// Datum scale values are always in parts per million difference from unity.
@@ -274,10 +274,10 @@
}
if (paramCount > 4)
{
- // Rotations are always in arc-seconds.
- if (!FloatEqual(def1.rot_X, def2.rot_X, kdEpsilonArcSec)) return false;
- if (!FloatEqual(def1.rot_Y, def2.rot_Y, kdEpsilonArcSec)) return false;
- if (!FloatEqual(def1.rot_Z, def2.rot_Z, kdEpsilonArcSec)) return false;
+ // Rotations are always in arc-seconds.
+ if (!FloatEqual(def1.rot_X, def2.rot_X, kdEpsilonArcSec)) return false;
+ if (!FloatEqual(def1.rot_Y, def2.rot_Y, kdEpsilonArcSec)) return false;
+ if (!FloatEqual(def1.rot_Z, def2.rot_Z, kdEpsilonArcSec)) return false;
}
}
#ifdef _DEBUG
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -66,39 +66,39 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
CCoordinateSystemMgrs::CCoordinateSystemMgrs(INT8 nLetteringScheme, bool bSetExceptionsOn)
:
- m_nLetteringScheme(nLetteringScheme),
- m_bExceptionsOn (bSetExceptionsOn),
- m_bUseFrameDatum (false),
+ m_nLetteringScheme (nLetteringScheme),
+ m_bExceptionsOn (bSetExceptionsOn),
+ m_bUseFrameDatum (false),
m_GridLineExceptionLevel (m_GridLineExceptionLevelK),
m_GridRegionExceptionLevel (m_GridRegionExceptionLevelK),
m_GridTickExceptionLevel (m_GridTickExceptionLevelK),
- m_nLastError (0),
- m_pCsTarget (),
- m_pCsMgrs (NULL),
- m_GridBoundary (),
- m_ZoneCollection (),
- m_GraticuleUtm (),
- m_GraticuleUpsNorth (),
- m_GraticuleUpsSouth ()
+ m_nLastError (0),
+ m_pCsTarget (),
+ m_pCsMgrs (NULL),
+ m_GridBoundary (),
+ m_ZoneCollection (),
+ m_GraticuleUtm (),
+ m_GraticuleUpsNorth (),
+ m_GraticuleUpsSouth ()
{
}
CCoordinateSystemMgrs::CCoordinateSystemMgrs(MgCoordinateSystem* pTargetCs,INT8 nLetteringScheme,
bool bSetExceptionsOn)
:
- m_nLetteringScheme(nLetteringScheme),
- m_bExceptionsOn (bSetExceptionsOn),
- m_bUseFrameDatum (false),
+ m_nLetteringScheme (nLetteringScheme),
+ m_bExceptionsOn (bSetExceptionsOn),
+ m_bUseFrameDatum (false),
m_GridLineExceptionLevel (m_GridLineExceptionLevelK),
m_GridRegionExceptionLevel (m_GridRegionExceptionLevelK),
m_GridTickExceptionLevel (m_GridTickExceptionLevelK),
- m_nLastError (0),
- m_pCsTarget (),
- m_pCsMgrs (NULL),
- m_GridBoundary (),
- m_ZoneCollection (),
- m_GraticuleUtm (),
- m_GraticuleUpsNorth (),
- m_GraticuleUpsSouth ()
+ m_nLastError (0),
+ m_pCsTarget (),
+ m_pCsMgrs (NULL),
+ m_GridBoundary (),
+ m_ZoneCollection (),
+ m_GraticuleUtm (),
+ m_GraticuleUpsNorth (),
+ m_GraticuleUpsSouth ()
{
m_pCsTarget = SAFE_ADDREF (pTargetCs);
@@ -281,8 +281,8 @@
else
{
return pLonLat;
+ }
}
- }
//if exception mode is on and excetion is thrown internally we exit anyway
//so safe to return NULL here and not test the m_bExceptionsOn value
@@ -416,11 +416,11 @@
// compromise its generality, we have our own functions in this MGRS
// specific object which duplicates much of the functionality of the
// OneGrid objoect.
- zoneCount = m_ZoneCollection->GetCount ();
- for (index = 0;index < zoneCount;index += 1)
- {
+ zoneCount = m_ZoneCollection->GetCount ();
+ for (index = 0;index < zoneCount;index += 1)
+ {
zoneExceptionLevel = m_GridLineExceptionLevel - theGridLineCollection->GetMemoryUsage ();
- mgrsZoneGrid = m_ZoneCollection->GetItem (index);
+ mgrsZoneGrid = m_ZoneCollection->GetItem (index);
if (specIsGrid)
{
// The specification calls for a grid. The following function
@@ -428,8 +428,8 @@
// 31 through 37 at the higher northern latitudes.
aGridLineCollection = mgrsZoneGrid->GetGridLines (m_GridBoundary,specification,zoneExceptionLevel);
}
- else
- {
+ else
+ {
// The specification calls for a graticule This object is
// smart enough to deal with band X (which is 12 degrees high)
// and the special nature of zones 31 through 37 at the higher
@@ -442,7 +442,7 @@
theGridLineCollection->AddCollection (aGridLineCollection);
aGridLineCollection = 0;
}
- }
+ }
MG_CATCH_AND_THROW(L"MgCoordinateSystemMgrs::GetGridLines")
return static_cast<MgCoordinateSystemGridLineCollection*>(theGridLineCollection.Detach());
}
@@ -999,25 +999,25 @@
pSouthwest->SetX (lngMin);
pSouthwest->SetY (latMin);
pNortheast->SetX (lngMax);
- pNortheast->SetY (-80.0);
- llBoundary = csFactory->GridBoundary (pSouthwest,pNortheast);
- pPolygon = llBoundary->GetBoundary (toFrameTransform,1.0);
+ pNortheast->SetY (-80.0);
+ llBoundary = csFactory->GridBoundary (pSouthwest,pNortheast);
+ pPolygon = llBoundary->GetBoundary (toFrameTransform,1.0);
}
if (pPolygon)
{
- Ptr<MgPolygon> pPolygonTemp = frameBoundary->GetBoundary ();
- pPolygonIntersection = dynamic_cast<MgPolygon*>(pPolygon->Intersection (pPolygonTemp));
- if (pPolygonIntersection != 0)
- {
- reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
- mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
- zoneCollection->Add (mgrsZoneGrid);
+ Ptr<MgPolygon> pPolygonTemp = frameBoundary->GetBoundary ();
+ pPolygonIntersection = dynamic_cast<MgPolygon*>(pPolygon->Intersection (pPolygonTemp));
+ if (pPolygonIntersection != 0)
+ {
+ reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
+ mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
+ zoneCollection->Add (mgrsZoneGrid);
- // Construct the m_GraticuleUpsSouth member, it may be needed.
- m_GraticuleUpsSouth = new CCoordinateSystemOneGrid (reducedFrameBoundary,llCRS,frameCRS);
+ // Construct the m_GraticuleUpsSouth member, it may be needed.
+ m_GraticuleUpsSouth = new CCoordinateSystemOneGrid (reducedFrameBoundary,llCRS,frameCRS);
+ }
+ }
}
- }
- }
if (latMax > 84.0 || northPole)
{
// There is a portion of the frame boundary in the north polar region.
@@ -1032,27 +1032,27 @@
if (pPolygon == 0)
{
pSouthwest->SetX (lngMin);
- pSouthwest->SetY (84.0);
+ pSouthwest->SetY (84.0);
pNortheast->SetX (lngMax);
pNortheast->SetY (latMax);
- llBoundary = csFactory->GridBoundary (pSouthwest,pNortheast);
- pPolygon = llBoundary->GetBoundary (toFrameTransform,1.0);
+ llBoundary = csFactory->GridBoundary (pSouthwest,pNortheast);
+ pPolygon = llBoundary->GetBoundary (toFrameTransform,1.0);
}
if (pPolygon != 0)
{
- Ptr<MgPolygon> pPolygonTemp = frameBoundary->GetBoundary ();
- pPolygonIntersection = dynamic_cast<MgPolygon*>(pPolygon->Intersection (pPolygonTemp));
- if (pPolygonIntersection != 0)
- {
- reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
- mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
- zoneCollection->Add (mgrsZoneGrid);
+ Ptr<MgPolygon> pPolygonTemp = frameBoundary->GetBoundary ();
+ pPolygonIntersection = dynamic_cast<MgPolygon*>(pPolygon->Intersection (pPolygonTemp));
+ if (pPolygonIntersection != 0)
+ {
+ reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
+ mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
+ zoneCollection->Add (mgrsZoneGrid);
- // Construct the m_GraticuleUpsNorth member, it may be needed.
- m_GraticuleUpsNorth = new CCoordinateSystemOneGrid (reducedFrameBoundary,llCRS,frameCRS);
+ // Construct the m_GraticuleUpsNorth member, it may be needed.
+ m_GraticuleUpsNorth = new CCoordinateSystemOneGrid (reducedFrameBoundary,llCRS,frameCRS);
+ }
+ }
}
- }
- }
if (latMax > -80.0 && latMin < 84.0)
{
// A portion of the frame boundary is in the region covered by the
@@ -1106,11 +1106,11 @@
if (pPolygonIntersection != 0)
{
reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
- mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
- zoneCollection->Add (mgrsZoneGrid);
+ mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
+ zoneCollection->Add (mgrsZoneGrid);
+ }
}
}
- }
if (latMin < 0.0)
{
// Pretty much the same as the northern zones processed
@@ -1134,11 +1134,11 @@
if (pPolygonIntersection != 0)
{
reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
- mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
- zoneCollection->Add (mgrsZoneGrid);
+ mgrsZoneGrid = new CCoordinateSystemMgrsZone (reducedFrameBoundary,zoneNbr,useFrameDatum,frameCRS,m_nLetteringScheme);
+ zoneCollection->Add (mgrsZoneGrid);
+ }
}
}
- }
// Need a CCoordinateSystemOneGrid object which can produce the 6 x 8 graticule
// for the entire regon.
@@ -1154,8 +1154,8 @@
{
reducedFrameBoundary = csFactory->GridBoundary (pPolygonIntersection);
m_GraticuleUtm = new CCoordinateSystemOneGrid (reducedFrameBoundary,llCRS,frameCRS);
+ }
}
- }
MG_CATCH_AND_THROW(L"MgCoordinateSystemMgrs::FrameBoundaryToZones")
return zoneCollection.Detach ();
}
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.h
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrs.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -25,8 +25,8 @@
{
struct CCoordinateSystemMgrsSeries
{
- wchar_t easting [9];
- wchar_t northing [21];
+ wchar_t easting [9];
+ wchar_t northing [21];
};
static const INT32 m_GridLineExceptionLevelK;
@@ -99,8 +99,8 @@
INTERNAL_API:
INT32 ConvertFromLonLat(double dLongitude, double dLatitude, INT32 nPrecision, REFSTRING sMgrs);
INT32 ConvertFromLonLat(MgCoordinate* pLonLat, INT32 nPrecision, REFSTRING sMgrs);
- INT32 ConvertToLonLat(CREFSTRING sMgrs, MgCoordinate* pLonLat);
- INT32 ConvertToLonLat(CREFSTRING sMgrs, double& dLongitude, double& dLatitude);
+INT32 ConvertToLonLat(CREFSTRING sMgrs, MgCoordinate* pLonLat);
+INT32 ConvertToLonLat(CREFSTRING sMgrs, double& dLongitude, double& dLatitude);
INT32 ConvertToLonLat(CREFSTRING sMgrs, MgCoordinate* pLonLat, INT32 grdSqrPosition);
INT32 ConvertToLonLat(CREFSTRING sMgrs, double& dLongitude, double& dLatitude, INT32 grdSqrPosition);
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -364,27 +364,27 @@
MG_TRY ()
regionCollection = new CCoordinateSystemGridRegionCollection (exceptionLvl);
- curvePrecision = specification->GetCurvePrecision ();
- if (specification->GetUnitType () == MgCoordinateSystemUnitType::Angular)
- {
- eastingIncrement = specification->GetEastingIncrement (MgCoordinateSystemUnitCode::Degree);
- northingIncrement = specification->GetNorthingIncrement (MgCoordinateSystemUnitCode::Degree);
- if (MgMathUtility::DblCmp (eastingIncrement,6.0) &&
- MgMathUtility::DblCmp (northingIncrement,8.0))
+ curvePrecision = specification->GetCurvePrecision ();
+ if (specification->GetUnitType () == MgCoordinateSystemUnitType::Angular)
{
+ eastingIncrement = specification->GetEastingIncrement (MgCoordinateSystemUnitCode::Degree);
+ northingIncrement = specification->GetNorthingIncrement (MgCoordinateSystemUnitCode::Degree);
+ if (MgMathUtility::DblCmp (eastingIncrement,6.0) &&
+ MgMathUtility::DblCmp (northingIncrement,8.0))
+ {
BuildMajorRegions (regionCollection,frameBoundary,curvePrecision);
+ }
}
- }
- else if (specification->GetUnitType () == MgCoordinateSystemUnitType::Linear)
- {
- eastingIncrement = specification->GetEastingIncrement (MgCoordinateSystemUnitCode::Meter);
- northingIncrement = specification->GetNorthingIncrement (MgCoordinateSystemUnitCode::Meter);
- if (MgMathUtility::DblCmp (eastingIncrement,100000.0) &&
- MgMathUtility::DblCmp (northingIncrement,100000.0))
+ else if (specification->GetUnitType () == MgCoordinateSystemUnitType::Linear)
{
+ eastingIncrement = specification->GetEastingIncrement (MgCoordinateSystemUnitCode::Meter);
+ northingIncrement = specification->GetNorthingIncrement (MgCoordinateSystemUnitCode::Meter);
+ if (MgMathUtility::DblCmp (eastingIncrement,100000.0) &&
+ MgMathUtility::DblCmp (northingIncrement,100000.0))
+ {
BuildMinorRegions (regionCollection,frameBoundary,curvePrecision);
+ }
}
- }
MG_CATCH_AND_THROW(L"MgCoordinateSystemMgrsZone::GetGraticuleLines")
return regionCollection.Detach ();
}
@@ -398,7 +398,7 @@
double lngMin, lngMax;
double latMin,latMax;
STRING designation;
-
+
Ptr<MgCoordinate> southwest;
Ptr<MgCoordinate> northeast;
Ptr<MgCoordinateSystem> llCRS;
@@ -425,7 +425,7 @@
// terms of geographic coordinates. So, we extract the extents of this
// grid in geographic coordinate form, and work from there.
GetGeographicExtents (lngMin,lngMax,latMin,latMax);
-
+
mjrRegionCollection = new CCoordinateSystemMgrsMajorRegionCollection (m_UtmZone,latMin,latMax);
if (mjrRegionCollection != 0)
{
@@ -439,12 +439,12 @@
northeast->SetX (regionPtr->GetEastEdgeLng ());
northeast->SetY (regionPtr->GetNorthEdgeLat ());
designation = regionPtr->GetDesignation ();
- pMjrRegion = new CCoordinateSystemGridRegion (designation,frameBoundary,
- toFrameTransform,
- southwest,
- northeast,
- curvePrecision,
- maxPoints);
+ pMjrRegion = new CCoordinateSystemGridRegion (designation,frameBoundary,
+ toFrameTransform,
+ southwest,
+ northeast,
+ curvePrecision,
+ maxPoints);
regionCollection->Add (pMjrRegion);
}
}
@@ -525,7 +525,7 @@
m_LetteringScheme);
if (!designation.empty ())
{
- // Construct the region object and add it to the region collection.
+ // Construct the region object and add it to the region collection.
pMnrRegion = new CCoordinateSystemGridRegion (designation,frameBoundary,
gridToFrameXfrom,
southwest,
@@ -533,9 +533,9 @@
curvePrecision,
maxPoints);
regionCollection->Add (pMnrRegion);
+ }
}
}
- }
MG_CATCH_AND_THROW(L"MgCoordinateSystemOneGrid::BuildMinorRegions")
}
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.h
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysMgrsZone.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -64,7 +64,7 @@
INT32 exceptionLvl);
INT32 ApproxGridRegionMemoryUsage (MgCoordinateSystemGridSpecification* specification);
INT32 GetUtmZoneNbr (void);
-
+
protected:
CCoordinateSystemGridRegionCollection* BuildRegionCollection (MgCoordinateSystemGridBoundary* frameBoundary,
MgCoordinateSystemGridSpecification* specification,
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysOneGrid.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysOneGrid.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysOneGrid.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -44,20 +44,20 @@
const INT32 CCoordinateSystemOneGrid::m_GridLineExceptionLevelK = 50000000L; // 50MB
const INT32 CCoordinateSystemOneGrid::m_GridTickExceptionLevelK = 20000000L; // 20MB
-CCoordinateSystemOneGrid::CCoordinateSystemOneGrid () : MgGuardDisposable (),
+CCoordinateSystemOneGrid::CCoordinateSystemOneGrid () : MgGuardDisposable (),
m_GridFrameCrsSame (false),
- m_UserID (0),
- m_MaxCurvePoints (MaxCurvePoints),
- m_Label (),
+ m_UserID (0),
+ m_MaxCurvePoints (MaxCurvePoints),
+ m_Label (),
m_GridLineExceptionLevel (m_GridLineExceptionLevelK),
m_GridTickExceptionLevel (m_GridTickExceptionLevelK),
- m_GridCRS (),
- m_FrameCRS (),
- m_ToFrameXform (),
- m_ToGridXform (),
- m_BoundaryPrecision (0.0),
- m_GridBoundary (),
- m_FrameBoundary ()
+ m_GridCRS (),
+ m_FrameCRS (),
+ m_ToFrameXform (),
+ m_ToGridXform (),
+ m_BoundaryPrecision (0.0),
+ m_GridBoundary (),
+ m_FrameBoundary ()
{
Ptr<MgCoordinateSystemFactory> csFactory = new MgCoordinateSystemFactory();
}
@@ -65,20 +65,20 @@
MgCoordinateSystem* gridCRS,
MgCoordinateSystem* frameCRS)
:
- MgGuardDisposable (),
+ MgGuardDisposable (),
m_GridFrameCrsSame (false),
- m_UserID (0),
- m_MaxCurvePoints (MaxCurvePoints),
- m_Label (),
+ m_UserID (0),
+ m_MaxCurvePoints (MaxCurvePoints),
+ m_Label (),
m_GridLineExceptionLevel (m_GridLineExceptionLevelK),
m_GridTickExceptionLevel (m_GridTickExceptionLevelK),
- m_GridCRS (),
- m_FrameCRS (),
- m_ToFrameXform (),
- m_ToGridXform (),
- m_BoundaryPrecision (0.0),
- m_GridBoundary (),
- m_FrameBoundary ()
+ m_GridCRS (),
+ m_FrameCRS (),
+ m_ToFrameXform (),
+ m_ToGridXform (),
+ m_BoundaryPrecision (0.0),
+ m_GridBoundary (),
+ m_FrameBoundary ()
{
SetUp (frameBoundary,gridCRS,frameCRS);
}
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/CoordSysTransform.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -1072,122 +1072,122 @@
MG_TRY()
- chord2 = curvePrecision * curvePrecision;
+ chord2 = curvePrecision * curvePrecision;
- // Allocate and populate the first point in the segment list.
- segList = new rx_Linseg_;
- segList->next = NULL;
+ // Allocate and populate the first point in the segment list.
+ segList = new rx_Linseg_;
+ segList->next = NULL;
- wrkPntX = segList->srcX = segList->trgX = fromPnt->GetX ();
- wrkPntY = segList->srcY = segList->trgY = fromPnt->GetY ();
- Transform (&segList->trgX,&segList->trgY);
+ wrkPntX = segList->srcX = segList->trgX = fromPnt->GetX ();
+ wrkPntY = segList->srcY = segList->trgY = fromPnt->GetY ();
+ Transform (&segList->trgX,&segList->trgY);
- // Allocate and populate the last point in the segment list.
- curPtr = new rx_Linseg_;
- curPtr->next = NULL;
- segList->next = curPtr;
+ // Allocate and populate the last point in the segment list.
+ curPtr = new rx_Linseg_;
+ curPtr->next = NULL;
+ segList->next = curPtr;
- wrkPntX = curPtr->srcX = curPtr->trgX = toPnt->GetX ();
- wrkPntY = curPtr->srcY = curPtr->trgY = toPnt->GetY ();
- Transform (&curPtr->trgX,&curPtr->trgY);
+ wrkPntX = curPtr->srcX = curPtr->trgX = toPnt->GetX ();
+ wrkPntY = curPtr->srcY = curPtr->trgY = toPnt->GetY ();
+ Transform (&curPtr->trgX,&curPtr->trgY);
- // We now have the two end points of the line in the segment list. Start a
- // loop which will examine the segment list and add points where necessary
- // to make sure the chord distance from the real point to the segment point
- // is less than that required.
- segCnt = 2;
- do
- {
- // Loop through the list and bisect each segment as appropriate.
- curPtr = segList;
- maxChord = 0.0;
+ // We now have the two end points of the line in the segment list. Start a
+ // loop which will examine the segment list and add points where necessary
+ // to make sure the chord distance from the real point to the segment point
+ // is less than that required.
+ segCnt = 2;
do
{
- // Compute the midpoint of the segment in lin coordinates.
- delX = curPtr->next->srcX - curPtr->srcX;
- delY = curPtr->next->srcY - curPtr->srcY;
- midTrgX = midSrcX = curPtr->srcX + delX * 0.5;
- midTrgY = midSrcY = curPtr->srcY + delY * 0.5;
- Transform (&midTrgX,&midTrgY);
+ // Loop through the list and bisect each segment as appropriate.
+ curPtr = segList;
+ maxChord = 0.0;
+ do
+ {
+ // Compute the midpoint of the segment in lin coordinates.
+ delX = curPtr->next->srcX - curPtr->srcX;
+ delY = curPtr->next->srcY - curPtr->srcY;
+ midTrgX = midSrcX = curPtr->srcX + delX * 0.5;
+ midTrgY = midSrcY = curPtr->srcY + delY * 0.5;
+ Transform (&midTrgX,&midTrgY);
- // Compute the distance from the converted point to the line, doing all
- // of this in dwg coordinates. The result is the chord distance.
- // The following algorithm was derived from taking the intersection of a
- // line from the converted point perdendicular to the existing line.
- delX = curPtr->next->trgX - curPtr->trgX;
- delY = curPtr->next->trgY - curPtr->trgY;
- delX2 = delX * delX;
- delY2 = delY * delY;
- denom = delX2 + delY2;
+ // Compute the distance from the converted point to the line, doing all
+ // of this in dwg coordinates. The result is the chord distance.
+ // The following algorithm was derived from taking the intersection of a
+ // line from the converted point perdendicular to the existing line.
+ delX = curPtr->next->trgX - curPtr->trgX;
+ delY = curPtr->next->trgY - curPtr->trgY;
+ delX2 = delX * delX;
+ delY2 = delY * delY;
+ denom = delX2 + delY2;
- // Make sure we don't divide by zero. denom is the sum of two
- // squares, so it can't be negative.
- if (denom > 0.0)
- {
- num = (delX2 * midTrgX) + (delY2 * curPtr->trgX) +
- (midTrgY - curPtr->trgY) * delX * delY;
- newX = num / denom;
- num = (delY2 * midTrgY) + (delX2 * curPtr->trgY) +
- (midTrgX - curPtr->trgX) * delX * delY;
- newY = num / denom;
- delX = newX - midTrgX;
- delY = newY - midTrgY;
- dist2 = delX * delX + delY * delY;
- }
- else
- {
- // This is overkill unless the drawing units are lat/longs or something
- // else that is very weird.
- delX = curPtr->trgX - midTrgX;
- delY = curPtr->trgY - midTrgY;
- dist2 = delX * delX + delY * delY;
- }
+ // Make sure we don't divide by zero. denom is the sum of two
+ // squares, so it can't be negative.
+ if (denom > 0.0)
+ {
+ num = (delX2 * midTrgX) + (delY2 * curPtr->trgX) +
+ (midTrgY - curPtr->trgY) * delX * delY;
+ newX = num / denom;
+ num = (delY2 * midTrgY) + (delX2 * curPtr->trgY) +
+ (midTrgX - curPtr->trgX) * delX * delY;
+ newY = num / denom;
+ delX = newX - midTrgX;
+ delY = newY - midTrgY;
+ dist2 = delX * delX + delY * delY;
+ }
+ else
+ {
+ // This is overkill unless the drawing units are lat/longs or something
+ // else that is very weird.
+ delX = curPtr->trgX - midTrgX;
+ delY = curPtr->trgY - midTrgY;
+ dist2 = delX * delX + delY * delY;
+ }
- // Accumulate the maximum chord distance so that we know when we are done.
- if (dist2 > maxChord) maxChord = dist2;
+ // Accumulate the maximum chord distance so that we know when we are done.
+ if (dist2 > maxChord) maxChord = dist2;
- // If the chord distance (it's not really a chord, but I don't know what
- // the real name of this thing is) is greater than the requested maximum,
- // we bisect this line segment.
- if (dist2 > chord2)
- {
- // Allocate a new segment structure.
- nxtPtr = new rx_Linseg_;
- nxtPtr->next = NULL;
+ // If the chord distance (it's not really a chord, but I don't know what
+ // the real name of this thing is) is greater than the requested maximum,
+ // we bisect this line segment.
+ if (dist2 > chord2)
+ {
+ // Allocate a new segment structure.
+ nxtPtr = new rx_Linseg_;
+ nxtPtr->next = NULL;
- // Insert the computed mid point. We have both the dwg and lin values
- // available.
- nxtPtr->trgX = midTrgX;
- nxtPtr->trgY = midTrgY;
- nxtPtr->srcX = midSrcX;
- nxtPtr->srcY = midSrcY;
+ // Insert the computed mid point. We have both the dwg and lin values
+ // available.
+ nxtPtr->trgX = midTrgX;
+ nxtPtr->trgY = midTrgY;
+ nxtPtr->srcX = midSrcX;
+ nxtPtr->srcY = midSrcY;
- // Count this point.
- segCnt += 1;
+ // Count this point.
+ segCnt += 1;
- // Link this point into the list.
- nxtPtr->next = curPtr->next;
- curPtr->next = nxtPtr;
+ // Link this point into the list.
+ nxtPtr->next = curPtr->next;
+ curPtr->next = nxtPtr;
- // Move on to the next segment.
- curPtr = nxtPtr->next;
- }
- else
- {
- // Move on to the next segment.
- curPtr = curPtr->next;
- }
- } while (curPtr->next != NULL);
- } while (maxChord > chord2 && segCnt < maxPoints);
+ // Move on to the next segment.
+ curPtr = nxtPtr->next;
+ }
+ else
+ {
+ // Move on to the next segment.
+ curPtr = curPtr->next;
+ }
+ } while (curPtr->next != NULL);
+ } while (maxChord > chord2 && segCnt < maxPoints);
- // Add all of our dwg points to the provided point array.
- coordinateCollection = new MgCoordinateCollection ();
- for (curPtr = segList;curPtr != NULL;curPtr = curPtr->next)
- {
+ // Add all of our dwg points to the provided point array.
+ coordinateCollection = new MgCoordinateCollection ();
+ for (curPtr = segList;curPtr != NULL;curPtr = curPtr->next)
+ {
Ptr<MgCoordinate> pntPtr = factory.CreateCoordinateXY (curPtr->trgX,curPtr->trgY);
- coordinateCollection->Add (pntPtr);
- }
- lineString = factory.CreateLineString (coordinateCollection);
+ coordinateCollection->Add (pntPtr);
+ }
+ lineString = factory.CreateLineString (coordinateCollection);
MG_CATCH (L"MgCoordinateSystemTransform.GridLine")
@@ -1392,11 +1392,11 @@
{
xx = srcFrom->GetX () + srcDeltaX * ratio;
yy = srcFrom->GetY () + srcDeltaY * ratio;
- position->SetX (xx);
- position->SetY (yy);
- status = 0;
+ position->SetX (xx);
+ position->SetY (yy);
+ status = 0;
+ }
}
- }
}
else
{
Modified: sandbox/rfc60/MgDev/Common/CoordinateSystem/MentorUtil.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/CoordinateSystem/MentorUtil.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/CoordinateSystem/MentorUtil.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -111,7 +111,7 @@
};
static const CCsPrjAdditionalInfo s_prjInfo[] = {
-// projtype org_lng org_lat scl_red quad offset
+// projtype org_lng org_lat scl_red quad offset
{ MgCoordinateSystemProjectionCode::Alber, true, true, false, true, true },
{ MgCoordinateSystemProjectionCode::Azede, true, true, false, true, true},
{ MgCoordinateSystemProjectionCode::Azmea, true, true, false, true, true },
Modified: sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -591,8 +591,8 @@
if (!gridSpecification->IsConsistent ())
{
throw new MgInvalidArgumentException(L"MgCoordinateSystemFactory.GridSpecification", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
}
- }
MG_CATCH_AND_THROW(L"MgCoordinateSystemFactory.GridSpecification")
return gridSpecification.Detach ();
}
Modified: sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMgrsGridSquarePosition.h
===================================================================
--- sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMgrsGridSquarePosition.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Geometry/CoordinateSystem/CoordinateSystemMgrsGridSquarePosition.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -31,7 +31,7 @@
{
// MENTOR_MAINTENANCE --> These enumeration values are assumed to be the
// same as those used by CS-MAP.
-public:
+PUBLISHED_API:
///////////////////////////////////////////////////////////////////////////
///<summary>
/// Specifies the grid square position is not set as yet.
Modified: sandbox/rfc60/MgDev/Common/Geometry/Geometry.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Common/Geometry/Geometry.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Geometry/Geometry.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -2873,6 +2873,10 @@
>
</File>
<File
+ RelativePath="..\CoordinateSystem\CoordSysEnvVariable.h"
+ >
+ </File>
+ <File
RelativePath="..\CoordinateSystem\CoordSysFormatConverter.cpp"
>
</File>
Modified: sandbox/rfc60/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Geometry/Spatial/SpatialUtility.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -600,7 +600,7 @@
if (preciseFrom)
{
status |= 4;
- }
+ }
if (preciseTo)
{
status |= 8;
@@ -633,7 +633,7 @@
if (preciseFrom)
{
status |= 4;
- }
+ }
if (preciseTo)
{
status |= 8;
@@ -664,7 +664,7 @@
if (preciseFrom)
{
status |= 16;
- }
+ }
if (preciseTo)
{
status |= 32;
@@ -693,11 +693,11 @@
if (preciseFrom)
{
status |= 16;
- }
+ }
if (preciseTo)
{
status |= 32;
- }
+ }
}
}
return status;
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/MapGuideCommon.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;..\..\Oem\dbxml-2.3.10\xerces-c-src\src"
+ AdditionalIncludeDirectories="..\Foundation;..\PlatformBase;..\Geometry;..\Security;..\MdfModel;..\MdfParser;..\..\Oem\ACE\ACE_wrappers;"..\..\Oem\dbxml-2.3.10\xerces-c-src\src""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MAPGUIDECOMMON_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -104,47 +104,47 @@
if(m_initIdProps && resourceService != NULL)
{
- MG_TRY()
+ MG_TRY()
- // Generate Id field information for feature sources
- m_idProps.clear();
- if (!m_featureName.empty())
- {
- // If we cannot pull the identity properties, silently ignore it.
- try
+ // Generate Id field information for feature sources
+ m_idProps.clear();
+ if (!m_featureName.empty())
{
- //TODO: Pull site connection directly from resource service
- Ptr<MgUserInformation> userInfo = resourceService->GetUserInfo();
- Ptr<MgSiteConnection> conn = new MgSiteConnection();
- conn->Open(userInfo);
+ // If we cannot pull the identity properties, silently ignore it.
+ try
+ {
+ //TODO: Pull site connection directly from resource service
+ Ptr<MgUserInformation> userInfo = resourceService->GetUserInfo();
+ Ptr<MgSiteConnection> conn = new MgSiteConnection();
+ conn->Open(userInfo);
- Ptr<MgFeatureService> featureService = dynamic_cast<MgFeatureService*>(conn->CreateService(MgServiceType::FeatureService));
- Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(m_featureSourceId);
+ Ptr<MgFeatureService> featureService = dynamic_cast<MgFeatureService*>(conn->CreateService(MgServiceType::FeatureService));
+ Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(m_featureSourceId);
- // If the class name is fully qualified (prefixed with a schema name),
- // then use it to determine the schema name.
- STRING className;
- STRING schemaName;
- ParseFeatureName(featureService, className, schemaName);
+ // If the class name is fully qualified (prefixed with a schema name),
+ // then use it to determine the schema name.
+ STRING className;
+ STRING schemaName;
+ ParseFeatureName(featureService, className, schemaName);
- // Get the identity properties
- Ptr<MgStringCollection> classNames = new MgStringCollection();
- classNames->Add(className);
- Ptr<MgClassDefinitionCollection> classDefs = featureService->GetIdentityProperties(resId, schemaName, classNames);
- if (NULL != classDefs.p && classDefs->GetCount() == 1)
+ // Get the identity properties
+ Ptr<MgStringCollection> classNames = new MgStringCollection();
+ classNames->Add(className);
+ Ptr<MgClassDefinitionCollection> classDefs = featureService->GetIdentityProperties(resId, schemaName, classNames);
+ if (NULL != classDefs.p && classDefs->GetCount() == 1)
+ {
+ Ptr<MgClassDefinition> classDef = classDefs->GetItem(0);
+ PopulateIdentityProperties(classDef);
+ }
+ }
+ catch (MgException* e)
{
- Ptr<MgClassDefinition> classDef = classDefs->GetItem(0);
- PopulateIdentityProperties(classDef);
+ e->Release();
+ // Do nothing here. A failure to pull selection id's is not critical at this point
}
}
- catch (MgException* e)
- {
- e->Release();
- // Do nothing here. A failure to pull selection id's is not critical at this point
- }
+ MG_CATCH_AND_THROW(L"MgLayer.GetLayerInfoFromDefinition")
}
- MG_CATCH_AND_THROW(L"MgLayer.GetLayerInfoFromDefinition")
- }
}
//////////////////////////////////////////////////////////////
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -19,7 +19,6 @@
#include "MdfModel.h"
#include "SAX2Parser.h"
#include <map>
-#include <vector>
using namespace std;
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/MapLayer/Map.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -26,16 +26,10 @@
#include <vector>
#include <list>
#include <map>
-//#include "LayerBase.h"
-//#include "LayerGroup.h"
-//#include "LayerCollection.h"
-//#include "LayerGroupCollection.h"
-//#include "MapCollection.h"
-//#include "ObjectChange.h"
-//#include "ChangeList.h"
-//#include "ReadOnlyLayerCollection.h"
-//#include "SelectionBase.h"
+typedef std::list<const MdfModel::MdfString> STRCOLORLIST;
+typedef STRCOLORLIST* PSTRCOLORLIST;
+
class MgMap;
class MgSiteConnection;
template class MG_MAPGUIDE_API Ptr<MgMap>;
@@ -44,9 +38,8 @@
#undef CreateService
#endif
-// workaround for preprocessor include problems
-#include "../MdfModel/VectorLayerDefinition.h"
+
/////////////////////////////////////////////////////////////////
/// \brief
/// Defines the runtime state of a map.
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/Command.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/Command.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/Command.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -34,6 +34,8 @@
//TODO: Parse url and pull machine name into target
}
+ MG_TRY()
+
Ptr<MgUserInformation> userInfo = connProp->GetUserInfo();
Ptr<MgServerConnection> serviceConn = MgServerConnection::Acquire(userInfo, connProp);
Ptr<MgStream> stream = serviceConn->GetStream();
@@ -114,6 +116,29 @@
stream->WriteStreamEnd();
GetResponse(serviceConn, retType);
+
+ MG_CATCH(L"MgCommand.ExecuteCommand")
+
+ if (NULL != mgException)
+ {
+ if (mgException->IsOfClass(MapGuide_Exception_MgConnectionFailedException))
+ {
+ // The server didn't respond so it needs to be marked as unavailable in the list of servers.
+ // We will check to see if it can be made available later.
+ MgSiteManager* siteManager = MgSiteManager::GetInstance();
+ Ptr<MgSiteInfo> badSite = siteManager->GetSiteInfo(connProp->GetTarget(), connProp->GetPort());
+ if(NULL != badSite.p)
+ {
+ // Update the status of the failed server
+ badSite->SetStatus(MgSiteInfo::UnableToConnect);
+ }
+
+ // Need to remove the server connection from the pool
+ MgServerConnection::Remove(connProp);
+ }
+
+ MG_THROW();
+ }
}
//////////////////////////////////////////////////////////////////
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ProxyFeatureReader.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -523,7 +523,7 @@
///
BYTE_ARRAY_OUT GetGeometry(CREFSTRING propertyName, INT32& length);
- //////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////
/// \brief
/// Gets the Geometry for the specified property. No conversion is
/// performed, thus the property must be a of type Geometry or the result
@@ -551,7 +551,7 @@
///
const wchar_t* GetString(CREFSTRING propertyName, INT32& length);
- //////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////
/// \brief
/// Gets the string value of the specified property. No conversion is
/// performed, thus the property must be a of type string or the result
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -622,6 +622,63 @@
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
+/// Gets the site version.
+/// </summary>
+/// <returns>
+/// The site version.
+/// </returns>
+///
+/// EXCEPTIONS:
+/// MgConnectionNotOpenException
+STRING MgServerAdmin::GetSiteVersion()
+{
+ MgCommand cmd;
+
+ cmd.ExecuteCommand(m_connProp, // Connection
+ MgCommand::knString, // Return type expected
+ MgServerAdminServiceOpId::GetSiteVersion, // Command Code
+ 0, // No of arguments
+ ServerAdmin_Service, // Service Id
+ BUILD_VERSION(1,0,0), // Operation version
+ MgCommand::knNone);
+
+ SetWarning(cmd.GetWarningObject());
+
+ STRING retVal = *(cmd.GetReturnValue().val.m_str);
+ delete cmd.GetReturnValue().val.m_str;
+
+ return retVal;
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// Gets the status properties for the server.
+/// </summary>
+/// <returns>
+/// The collection of status properties.
+/// </returns>
+///
+/// EXCEPTIONS:
+/// MgConnectionNotOpenException
+MgPropertyCollection* MgServerAdmin::GetSiteStatus()
+{
+ MgCommand cmd;
+
+ cmd.ExecuteCommand(m_connProp, // Connection
+ MgCommand::knObject, // Return type expected
+ MgServerAdminServiceOpId::GetSiteStatus, // Command Code
+ 0, // No of arguments
+ ServerAdmin_Service, // Service Id
+ BUILD_VERSION(2,2,0), // Operation version
+ MgCommand::knNone);
+
+ SetWarning(cmd.GetWarningObject());
+
+ return (MgPropertyCollection*)cmd.GetReturnValue().val.m_obj;
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+/// <summary>
/// Delete the specified package, if able.
/// </summary>
///
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -365,6 +365,28 @@
///////////////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Gets the site version.
+ ///
+ /// \return
+ /// The site version.
+ ///
+ /// \exception MgConnectionNotOpenException
+ ///
+ STRING GetSiteVersion();
+
+ ///////////////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Gets the status properties for the server.
+ ///
+ /// \return
+ /// The collection of status properties.
+ ///
+ /// \exception MgConnectionNotOpenException
+ ///
+ MgPropertyCollection* GetSiteStatus();
+
+ ///////////////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Delete the specified package, if able.
///
/// \param packageName
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -76,3 +76,9 @@
const STRING MgServerInformationProperties::TotalConnections = L"TotalConnections";
const STRING MgServerInformationProperties::TotalActiveConnections = L"TotalActiveConnections";
const STRING MgServerInformationProperties::OperatingSystemVersion = L"OperatingSystemVersion";
+const STRING MgServerInformationProperties::ApiVersion = L"ApiVersion";
+const STRING MgServerInformationProperties::MachineIp = L"MachineIp";
+const STRING MgServerInformationProperties::WorkingSet = L"WorkingSet";
+const STRING MgServerInformationProperties::VirtualMemory = L"VirtualMemory";
+const STRING MgServerInformationProperties::CacheSize = L"CacheSize";
+const STRING MgServerInformationProperties::CacheDroppedEntries = L"CacheDroppedEntries";
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -114,6 +114,8 @@
/// The server's version
static const STRING ServerVersion; /// value("ServerVersion")
+ /// The API version
+ static const STRING ApiVersion; /// value("ApiVersion")
/// STATISTIC PROPERTIES SECTION -----------------------------------------------------------------------------------
@@ -156,6 +158,9 @@
/// Gets the server display name
static const STRING DisplayName; /// value("DisplayName")
+ /// Gets the server machine Ip
+ static const STRING MachineIp; /// value("MachineIp")
+
/// Gets the total operations received
static const STRING TotalReceivedOperations; /// value("TotalReceivedOperations")
@@ -170,6 +175,18 @@
/// Gets the operating system version
static const STRING OperatingSystemVersion; /// value("OperatingSystemVersion")
+
+ /// Gets the process working set memory
+ static const STRING WorkingSet; /// value("WorkingSet")
+
+ /// Gets the process virtual memory
+ static const STRING VirtualMemory; /// value("VirtualMemory")
+
+ /// Gets the current size of the server cache
+ static const STRING CacheSize; /// value("CacheSize")
+
+ /// Gets the number of dropped cache entries
+ static const STRING CacheDroppedEntries; /// value("CacheDroppedEntries")
};
@@ -209,6 +226,8 @@
static const int NotifyResourcesChanged = 0x1111EA1A;
static const int MakePackage = 0x1111EA1B;
static const int RemoveConfigurationProperties = 0x1111EA1C;
+ static const int GetSiteVersion = 0x1111EA1D;
+ static const int GetSiteStatus = 0x1111EA1E;
};
/// \endcond
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -275,10 +275,10 @@
/// </summary>
///
/// <param name="userInformation">
-/// User information to authenticate against
+/// User information to authenticate against.
/// </param>
-/// <param name="target">
-/// Target server. NULL or "" indicates local server
+/// <param name="connProp">
+/// Connection properties for the server to connect to.
/// </param>
/// <returns>
/// Nothing
@@ -342,3 +342,28 @@
return msc.Detach();
}
+//////////////////////////////////////////////////////////////////
+/// <summary>
+/// Removes a connection to a Mg server
+/// </summary>
+///
+/// <param name="connProp">
+/// Connection properties of the server to remove.
+/// </param>
+/// <returns>
+/// Nothing
+/// </returns>
+/// EXCEPTIONS:
+/// AuthorizationFailed
+/// TargetNotFound
+void MgServerConnection::Remove(MgConnectionProperties* connProp)
+{
+ CHECKNULL((MgConnectionProperties*)connProp, L"MgServerConnection.Remove");
+
+ {
+ ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sm_mutex));
+
+ wstring hash = connProp->Hash();
+ g_connectionPool->pool.erase(hash);
+ }
+}
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/ServerConnection.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -105,6 +105,19 @@
//////////////////////////////////////////////////////////////////
/// \brief
+ /// Removes the TCP/IP connection to a MapGuide server from the
+ /// internal connection pool.
+ ///
+ /// \param connProp
+ /// Connection properties for target server
+ ///
+ /// \return
+ /// Nothing
+ ///
+ static void Remove(MgConnectionProperties* connProp);
+
+ //////////////////////////////////////////////////////////////////
+ /// \brief
/// Internal method used for getting stream helper
/// which will then be used in serialize/deserialize
///
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -129,7 +129,8 @@
if (m_connProp == NULL)
{
- throw new MgLogicException(L"MgSiteConnection.Open",
+ // There might not be any MapGuide servers running for the site
+ throw new MgConnectionFailedException(L"MgSiteConnection.Open",
__LINE__, __WFILE__, NULL, L"", NULL);
}
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -19,6 +19,94 @@
// Process-wide MgSiteManager
Ptr<MgSiteManager> MgSiteManager::sm_siteManager = (MgSiteManager*)NULL;
+// Background thread function
+ACE_THR_FUNC_RETURN CheckServers(void* param)
+{
+ SMThreadData* threadData = (SMThreadData*)param;
+ // Store our unique thread ID
+ threadData->threadId = ACE_Thread::self();
+
+ MgSiteManager* siteManager = MgSiteManager::GetInstance();
+
+ bool bDone = false;
+ while(!bDone)
+ {
+ INT32 sleepTime = threadData->failoverRetryTime;
+
+ MgSiteVector* sites = siteManager->GetSites();
+ if(sites)
+ {
+ for(size_t i=0;i<sites->size();i++)
+ {
+ MgSiteInfo* siteInfo = sites->at(i);
+
+ // Check the server status
+ if (MgSiteInfo::Ok != siteInfo->GetStatus())
+ {
+ // This is an unavailable server so we need to check if it is now available
+ MG_TRY()
+
+ // Send a simple request to the server to see if it can respond
+ Ptr<MgUserInformation> userInformation = new MgUserInformation(L"", L"");
+ Ptr<MgConnectionProperties> connProp = siteManager->GetConnectionProperties(userInformation, siteInfo, MgSiteInfo::Admin);
+
+ // Use GetSiteStatus because it doesn't require authentication
+ MgCommand cmd;
+ cmd.ExecuteCommand(connProp, // Connection
+ MgCommand::knObject, // Return type expected
+ MgServerAdminServiceOpId::GetSiteStatus, // Command Code
+ 0, // No of arguments
+ ServerAdmin_Service, // Service Id
+ BUILD_VERSION(2,2,0), // Operation version
+ MgCommand::knNone);
+
+ // The server responded so update the status if the server is online
+ Ptr<MgPropertyCollection> properties = (MgPropertyCollection*)cmd.GetReturnValue().val.m_obj;
+ if(properties.p)
+ {
+ // Check the status of the server
+ Ptr<MgBooleanProperty> boolProp = (MgBooleanProperty*)properties->GetItem(MgServerInformationProperties::Status);
+ if(boolProp->GetValue())
+ {
+ // Server is there and "Online"
+ ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, siteManager->m_mutex, NULL));
+ siteInfo->SetStatus(MgSiteInfo::Ok);
+ }
+ }
+
+ MG_CATCH_AND_RELEASE()
+ if(NULL != mgException.p)
+ {
+ // Exception was thrown
+ STRING message = mgException->GetMessage();
+ }
+ }
+ }
+
+ // Does this site only contain 1 server?
+ if(sites->size() == 1)
+ {
+ MgSiteInfo* siteInfo = sites->at(0);
+
+ // Check the server status in case it was just updated
+ if (MgSiteInfo::Ok != siteInfo->GetStatus())
+ {
+ // There is only 1 server in the site and it is not in a "Good" state yet so reduce the sleep time
+ sleepTime = 1;
+ }
+ }
+ }
+
+ // Sleep the thread as thread resume/suspend is not supported on all platforms
+ ACE_OS::sleep(sleepTime);
+
+ // Update whether we are done or not
+ bDone = siteManager->GetCheckServersThreadDone();
+ }
+
+ return 0;
+}
+
///----------------------------------------------------------------------------
/// <summary>
/// Constructs the object.
@@ -43,6 +131,10 @@
ClearSiteInfo();
+ // Block any threads as we are updating the thread done
+ ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex));
+ m_bCheckServersThreadDone = true;
+
MG_CATCH(L"MgSiteManager.~MgSiteManager")
}
@@ -179,6 +271,24 @@
m_sites.push_back(siteInfo.Detach());
}
+ // Create background thread that will check any unavailable servers to see if their status has changed
+ INT32 failoverRetryTime = MgConfigProperties::DefaultGeneralPropertyFailoverRetryTime;
+ configuration->GetIntValue(
+ MgConfigProperties::GeneralPropertiesSection,
+ MgConfigProperties::GeneralPropertyFailoverRetryTime,
+ failoverRetryTime,
+ MgConfigProperties::DefaultGeneralPropertyFailoverRetryTime);
+
+ m_threadData.failoverRetryTime = failoverRetryTime;
+
+ m_bCheckServersThreadDone = false;
+
+ // Need a thread manager
+ ACE_Thread_Manager* manager = ACE_Thread_Manager::instance();
+
+ // Create the background thread
+ manager->spawn(ACE_THR_FUNC(CheckServers), &m_threadData);
+
MG_CATCH_AND_THROW(L"MgSiteManager.Initialize")
}
@@ -213,12 +323,19 @@
{
STRING siteHexString = sessionId.substr(
length - MgSiteInfo::HexStringLength, MgSiteInfo::HexStringLength);
- Ptr<MgSiteInfo> siteInfo = new MgSiteInfo(siteHexString);
+ Ptr<MgSiteInfo> siteInfo = GetSiteInfo(siteHexString);
if (MgSiteInfo::Ok == siteInfo->GetStatus())
{
connProps = GetConnectionProperties(userInfo, siteInfo, portType);
}
+ else
+ {
+ // This site is not currently working
+
+ // We have a session, but it will not exist on any other machine so we force the session exception
+ throw new MgSessionExpiredException(L"MgSiteManager.GetConnectionProperties",__LINE__,__WFILE__, NULL, L"", NULL);
+ }
}
}
else
@@ -233,7 +350,8 @@
if (NULL == connProps.p)
{
- throw new MgLogicException(
+ // There might not be any MapGuide servers running for the site
+ throw new MgConnectionFailedException(
L"MgSiteManager.GetConnectionProperties",
__LINE__, __WFILE__, NULL, L"", NULL);
}
@@ -371,3 +489,64 @@
return SAFE_ADDREF(matchingSiteInfo);
}
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Retrieves site info for the site server matching the specified target and port
+/// contained within the specifed hex string.
+/// </summary>
+///----------------------------------------------------------------------------
+MgSiteInfo* MgSiteManager::GetSiteInfo(CREFSTRING hexString)
+{
+ MgSiteInfo* matchingSiteInfo = NULL;
+
+ if(hexString.length() >= MgSiteInfo::HexStringLength)
+ {
+ UINT32 n1, n2, n3, n4;
+ INT32 sitePort, clientPort, adminPort;
+ STRING target;
+
+ // Read the IP parts into their variables
+ if(::swscanf(hexString.c_str(), L"%2X%2X%2X%2X%4X%4X%4X", &n1, &n2, &n3, &n4, &sitePort, &clientPort, &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);
+ target = buffer;
+ }
+
+ ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, NULL));
+
+ for (INT32 i = 0; i < (INT32)m_sites.size(); i++)
+ {
+ MgSiteInfo* siteInfo = m_sites.at(i);
+
+ if (siteInfo->GetTarget() == target
+ && (siteInfo->GetPort(MgSiteInfo::Site) == sitePort ||
+ siteInfo->GetPort(MgSiteInfo::Client) == clientPort ||
+ siteInfo->GetPort(MgSiteInfo::Admin) == adminPort))
+ {
+ matchingSiteInfo = siteInfo;
+ break;
+ }
+ }
+ }
+
+ return SAFE_ADDREF(matchingSiteInfo);
+}
+
+MgSiteVector* MgSiteManager::GetSites()
+{
+ return &m_sites;
+}
+
+bool MgSiteManager::GetCheckServersThreadDone()
+{
+ return m_bCheckServersThreadDone;
+}
+
+void MgSiteManager::SetCheckServersThreadDone(bool bDone)
+{
+ ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex));
+ m_bCheckServersThreadDone = bDone;
+}
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/Services/SiteManager.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -21,6 +21,13 @@
class MgSiteInfo;
typedef std::vector<MgSiteInfo*> MgSiteVector;
+// Data structure which is passed to thread
+struct SMThreadData
+{
+ ACE_thread_t threadId;
+ INT32 failoverRetryTime;
+};
+
class MG_MAPGUIDE_API MgSiteManager : public MgGuardDisposable
{
DECLARE_CLASSNAME(MgSiteManager)
@@ -63,9 +70,16 @@
MgSiteInfo* GetSiteInfo(INT32 index);
MgSiteInfo* GetSiteInfo(CREFSTRING target, INT32 port);
+ MgSiteInfo* GetSiteInfo(CREFSTRING hexString);
INT32 GetSiteCount();
+ MgSiteVector* GetSites();
+ ACE_Recursive_Thread_Mutex m_mutex;
+
+ bool GetCheckServersThreadDone();
+ void SetCheckServersThreadDone(bool bDone);
+
private:
void Initialize();
@@ -79,9 +93,10 @@
static Ptr<MgSiteManager> sm_siteManager;
- ACE_Recursive_Thread_Mutex m_mutex;
INT32 m_index;
MgSiteVector m_sites;
+ SMThreadData m_threadData;
+ bool m_bCheckServersThreadDone;
};
#endif // MG_SITEMANAGER_H_
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -161,6 +161,8 @@
const INT32 MgConfigProperties::DefaultGeneralPropertyWorkerThreadPoolSize = 1;
const STRING MgConfigProperties::GeneralPropertyRenderer = L"Renderer";
const STRING MgConfigProperties::DefaultGeneralPropertyRenderer = L"GD";
+const STRING MgConfigProperties::GeneralPropertyFailoverRetryTime = L"FailoverRetryTime"; // for internal use only
+const INT32 MgConfigProperties::DefaultGeneralPropertyFailoverRetryTime = 60;
// ******************************************************************
// Administrative Connection Properties
@@ -505,6 +507,7 @@
{ MgConfigProperties::GeneralPropertyWfsDocumentPath , MgPropertyType::String , MG_CONFIG_MIN_PATH_LENGTH , MG_CONFIG_MAX_PATH_LENGTH , MG_CONFIG_PATH_RESERVED_CHARACTERS },
{ MgConfigProperties::GeneralPropertyWmsDocumentPath , MgPropertyType::String , MG_CONFIG_MIN_PATH_LENGTH , MG_CONFIG_MAX_PATH_LENGTH , MG_CONFIG_PATH_RESERVED_CHARACTERS },
{ MgConfigProperties::GeneralPropertyWorkerThreadPoolSize , MgPropertyType::Int32 , MG_CONFIG_MIN_THREAD_POOL_SIZE , MG_CONFIG_MAX_THREAD_POOL_SIZE , L"" },
+ { MgConfigProperties::GeneralPropertyFailoverRetryTime , MgPropertyType::Int32 , MG_CONFIG_MIN_TIMER_INTERVAL , MG_CONFIG_MAX_TIMER_INTERVAL , L"" },
{ L"" , 0 , 0.0 , 0.0 , L"" }
};
Modified: sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MapGuideCommon/System/ConfigProperties.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -135,6 +135,10 @@
static const STRING GeneralPropertyWorkerThreadPoolSize; /// value("WorkerThreadPoolSize")
static const INT32 DefaultGeneralPropertyWorkerThreadPoolSize; /// value(1)
+ /// Sets the failover retry time
+ static const STRING GeneralPropertyFailoverRetryTime; /// value("FailoverRetryTime")
+ static const INT32 DefaultGeneralPropertyFailoverRetryTime; /// value(60)
+
EXTERNAL_API:
/// ADMINISTRATIVE CONNECTION PROPERTIES SECTION ---------------------------------------------------------------------
Modified: sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -22,25 +22,7 @@
#include "stdafx.h"
#include "VectorScaleRange.h"
-#include "AreaRule.h"
-#include "LineRule.h"
-#include "PointRule.h"
-#include "CompositeRule.h"
-#include "BlockSymbol.h"
-#include "FontSymbol.h"
-#include "ImageSymbol.h"
-#include "MarkSymbol.h"
-#include "TextSymbol.h"
-#include "W2DSymbol.h"
-
-#include "SimpleSymbol.h"
-#include "SimpleSymbolDefinition.h"
-#include "CompoundSymbolDefinition.h"
-#include "IGraphicElementVisitor.h"
-#include "LineUsage.h"
-#include "Path.h"
-
using namespace MDFMODEL_NAMESPACE;
// we must undefine the max macro so the limits max function compiles correctly
@@ -62,7 +44,6 @@
this->m_dMinScale = 0.0;
this->m_dMaxScale = MAX_MAP_SCALE;
this->m_elevationSettings = NULL;
-// this->m_usedColorList = NULL;
}
//-------------------------------------------------------------------------
@@ -70,11 +51,8 @@
//-------------------------------------------------------------------------
VectorScaleRange::~VectorScaleRange()
{
- // delete members which are pointers explicitely
if (this->m_elevationSettings != NULL)
delete this->m_elevationSettings;
-// if (this->m_usedColorList != NULL)
-// delete this->m_usedColorList;
}
//-------------------------------------------------------------------------
@@ -163,222 +141,3 @@
this->m_elevationSettings = elevationSettings;
}
}
-/*
-//-------------------------------------------------------------------------
-/// PURPOSE: Accessor method for the base colors defined in this Layer and scaleRange.
-/// RETURNS: A pointer to the list of colors of the collected colors (maybe empty but not null)
-//-------------------------------------------------------------------------
-PSTRCOLORLIST VectorScaleRange::GetUsedColorList()
-{
- // lazy instantiation
- if (this->m_usedColorList) return this->m_usedColorList;
- // this should be sufficiently thread safe as the object is created immediately
- PSTRCOLORLIST usedColorList = this->m_usedColorList = new STRCOLORLIST();
-
- struct Local // local declaration of helper function
- {
- /// overloaded helper for SimpleSymbolDefinition
- inline static void findColorInSymbolDefinition(PSTRCOLORLIST colorList, MdfModel::SimpleSymbolDefinition * symdef)
- {
- /// the visitor for the graphics
- class GraphicElementVisitorImpl : public MdfModel::IGraphicElementVisitor
- {
- public:
- PSTRCOLORLIST colorList;
- void VisitPath (Path& path){
- colorList->push_back(path.GetLineColor().substr());
- colorList->push_back(path.GetFillColor().substr());
- };
- void VisitImage(Image& image){};
- void VisitText (Text& text){};
- } visitor;
- if (symdef)
- {
- MdfModel::LineUsage* lineUsage = symdef->GetLineUsage();
- if (lineUsage)
- {
- MdfModel::Path *path = lineUsage->GetDefaultPath();
- if (path)
- {
- colorList->push_back(path->GetLineColor().substr());
- colorList->push_back(path->GetFillColor().substr());
- }
- }
-
- MdfModel::GraphicElementCollection* graphElems = symdef->GetGraphics();
- int gInstances = graphElems->GetCount();
- for (int i=0; i < gInstances; ++i)
- {
- MdfModel::GraphicElement* graphics = graphElems->GetAt(i);
- if (graphics)
- {
- visitor.colorList = colorList; // use injection to pass reference to list
- graphics->AcceptVisitor(visitor);
- }
- }
- }
- }
- /// overloaded helper for CompoundSymbolDefinition
- inline static void findColorInSymbolDefinition(PSTRCOLORLIST colorList, MdfModel::CompoundSymbolDefinition * symdef)
- {
- if (symdef)
- {
- MdfModel::SimpleSymbolCollection* simSymCol = symdef->GetSymbols();
- int kInstances = simSymCol->GetCount();
- for (int i=0; i < kInstances; ++i)
- {
- MdfModel::SimpleSymbol* simsym = simSymCol->GetAt(i);
- if (simsym)
- Local::findColorInSymbolDefinition(colorList, simsym->GetSymbolDefinition());
- }
- }
-
- }
- /// overloaded helper for SymbolDefinition
- static void findColorInSymbolDefinition(PSTRCOLORLIST colorList, MdfModel::SymbolDefinition * symdef)
- {
- Local::findColorInSymbolDefinition(colorList, dynamic_cast<MdfModel::SimpleSymbolDefinition*>(symdef));
- Local::findColorInSymbolDefinition(colorList, dynamic_cast<MdfModel::CompoundSymbolDefinition*>(symdef));
- }
- };
-
- // compute new color list by iterating through the featuretypecollection
- FeatureTypeStyleCollection* pftsColl = this->GetFeatureTypeStyles();
- int ftsccount = pftsColl->GetCount();
- for (int j=0; j< ftsccount; j++)
- {
- FeatureTypeStyle* pfts = pftsColl->GetAt(j);
-
- // iterate through the rulecollection
- RuleCollection* ruleColl = pfts->GetRules();
- int rccount = ruleColl->GetCount();
- for (int k=0; k < rccount; k++)
- {
- Rule* rule = ruleColl->GetAt(k);
-
- // get the label which will be the key in the color map
- Label* label = rule->GetLabel();
- // the legend label is just a string
- // const MdfString& legendLabel = rule->GetLegendLabel();
-
- // add colors of txtsymbols
- TextSymbol* txtsym = label->GetSymbol();
- if (txtsym) {
- usedColorList->push_back(txtsym->GetForegroundColor().substr());
- usedColorList->push_back(txtsym->GetBackgroundColor().substr());
- }
- // do the casting to access the relevant members
- // this is bad style (instead of using the visitor pattern of the Mdfmodel)
- // but it keeps it nice and compact and documents the structure better...
- AreaRule* paRule = dynamic_cast<AreaRule*>(rule);
- LineRule* plRule = dynamic_cast<LineRule*>(rule);
- PointRule* ppRule = dynamic_cast<PointRule*>(rule);
- CompositeRule* pcRule = dynamic_cast<CompositeRule*>(rule); // used for new stylization
-
- // AreaRule Symbolization.....
- if (paRule != NULL)
- {
- AreaSymbolization2D* pasym = paRule->GetSymbolization();
- if (pasym->GetFill() != NULL)
- { // create copies of all strings!!! so we can safely delete the resulting list later
- usedColorList->push_back(pasym->GetFill()->GetForegroundColor().substr());
- usedColorList->push_back(pasym->GetFill()->GetBackgroundColor().substr());
- }
- if (pasym->GetEdge() != NULL)
- usedColorList->push_back(pasym->GetEdge()->GetColor().substr());
- }
-
- // LineRule Symbolization.....
- if (plRule != NULL)
- {
- LineSymbolizationCollection* plsymcol = plRule->GetSymbolizations();
- // iterate through the linesymbolizations
- int lsccount = plsymcol->GetCount();
- for (int l=0; l < lsccount; l++)
- {
- LineSymbolization2D* plsym = plsymcol->GetAt(l);
- if (plsym->GetStroke() != NULL)
- usedColorList->push_back(plsym->GetStroke()->GetColor().substr());
- }
- }
- // PointRule Symbolization.....
- if (ppRule != NULL)
- {
- PointSymbolization2D* ppsym = ppRule->GetSymbolization();
- if (ppsym)
- {
- Symbol *sym = ppsym->GetSymbol();
- MdfModel::BlockSymbol* blockSymbol = dynamic_cast<MdfModel::BlockSymbol*>(sym);
- MdfModel::FontSymbol* fontSymbol = dynamic_cast<MdfModel::FontSymbol*>(sym);
- MdfModel::MarkSymbol* markSymbol = dynamic_cast<MdfModel::MarkSymbol*>(sym);
- MdfModel::TextSymbol* textSymbol = dynamic_cast<MdfModel::TextSymbol*>(sym);
- MdfModel::W2DSymbol* w2dSymbol = dynamic_cast<MdfModel::W2DSymbol*>(sym);
- if (blockSymbol != NULL)
- {
- usedColorList->push_back(blockSymbol->GetBlockColor().substr());
- usedColorList->push_back(blockSymbol->GetLayerColor().substr());
- }
- if (fontSymbol != NULL)
- {
- usedColorList->push_back(fontSymbol->GetForegroundColor().substr());
- }
- if (markSymbol != NULL)
- {
- if (markSymbol->GetEdge() != NULL)
- usedColorList->push_back(markSymbol->GetEdge()->GetColor().substr());
- if (markSymbol->GetFill() != NULL) {
- usedColorList->push_back(markSymbol->GetFill()->GetForegroundColor().substr());
- usedColorList->push_back(markSymbol->GetFill()->GetBackgroundColor().substr());
- }
- }
- if (textSymbol != NULL)
- {
- usedColorList->push_back(textSymbol->GetForegroundColor().substr());
- usedColorList->push_back(textSymbol->GetBackgroundColor().substr());
- }
- if (w2dSymbol != NULL)
- {
- usedColorList->push_back(w2dSymbol->GetFillColor().substr());
- usedColorList->push_back(w2dSymbol->GetLineColor().substr());
- usedColorList->push_back(w2dSymbol->GetTextColor().substr());
- }
- } // if pointSymbolization
- } // end pointRule
- // CompositeRule Symbolization.....
- if (pcRule != NULL)
- {
- CompositeSymbolization* pcsym = pcRule->GetSymbolization();
- SymbolInstanceCollection* sic = pcsym->GetSymbolCollection();
- int nInstances = sic->GetCount();
- for (int i=0; i<nInstances; ++i)
- {// bool isRef = false;
- SymbolInstance* instance = sic->GetAt(i);
- // get the symbol definition, either inlined or by reference
- SymbolDefinition* symdef = instance->GetSymbolDefinition();
- if (symdef) // inline
- Local::findColorInSymbolDefinition(usedColorList, symdef);
- else
- { // resourceId
- const MdfString& symref = instance->GetResourceId(); // symbol reference
-#ifdef _DEBUG
- // collect the symbolreference for later inspection?
- usedColorList->push_back(symref.substr());
- printf("\n\n$$$$$$$$$$$$$$$$$$$$$$$$ GetUserColorList(): found ResourceId %s\n\n", symref.c_str());
-#endif
- /// CHECK resource service
-// the following code is needed to use the resourceId to load a symboldefiniton into some colors but not here
-// symdef = m_resources->GetSymbolDefinition(ref.c_str());
-// if (symdef == NULL) continue;
-// isRef = true;
- // remember the current symbol resource id in case it references
- // an attached png image resource
-// m_resIdStack.push_back(ref.c_str());
- }
-// if (isRef) m_resIdStack.pop_back();
- } // for sym instances
- } // for CompositeRule
- } // for GetRules
- } // for GetFeatureTypeStyles
- return this->m_usedColorList;
-}
-*/
\ No newline at end of file
Modified: sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.h
===================================================================
--- sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/MdfModel/VectorScaleRange.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -23,11 +23,7 @@
#include "FeatureTypeStyle.h"
#include "ElevationSettings.h"
#include "MdfRootObject.h"
-#include <list>
-typedef std::list<const MdfModel::MdfString> STRCOLORLIST;
-typedef STRCOLORLIST* PSTRCOLORLIST;
-
BEGIN_NAMESPACE_MDFMODEL
//-------------------------------------------------------------------------
@@ -66,9 +62,6 @@
ElevationSettings* GetElevationSettings();
void AdoptElevationSettings(ElevationSettings* elevationSettings);
- // Computed Property : UsedColorList
-// PSTRCOLORLIST GetUsedColorList();
-
private:
// Hidden copy constructor and assignment operator.
VectorScaleRange(const VectorScaleRange&);
@@ -86,9 +79,6 @@
// Extended data
ElevationSettings* m_elevationSettings;
-
- // cached colorlist
-// PSTRCOLORLIST m_usedColorList;
};
typedef MdfOwnerCollection<VectorScaleRange> VectorScaleRangeCollection;
Modified: sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -72,7 +72,7 @@
if (-1 != index)
{
return index;
-}
+ }
else
{
throw new MgObjectNotFoundException(L"MgFeatureReader.GetPropertyIndex", __LINE__, __WFILE__, NULL, L"", NULL);
Modified: sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.h
===================================================================
--- sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/PlatformBase/Services/FeatureReader.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -392,7 +392,7 @@
///
virtual BYTE_ARRAY_OUT GetGeometry(CREFSTRING propertyName, INT32& length) = 0;
- //////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////
/// \brief
/// Gets the Geometry for the specified property. No conversion is
/// performed, thus the property must be a of type Geometry or the result
Modified: sandbox/rfc60/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -154,6 +154,7 @@
stream->WriteInt32(m_sizeX);
stream->WriteInt32(m_sizeY);
stream->WriteString(m_serializedXml);
+ stream->WriteString(m_associatedSCName);
}
void MgRasterPropertyDefinition::Deserialize(MgStream* stream)
@@ -164,6 +165,7 @@
stream->GetInt32(m_sizeX);
stream->GetInt32(m_sizeY);
stream->GetString(m_serializedXml);
+ stream->GetString(m_associatedSCName);
}
void MgRasterPropertyDefinition::Initialize()
@@ -172,6 +174,7 @@
m_nullable = false;
m_sizeX = 0;
m_sizeY = 0;
+ m_serializedXml = L"";
m_associatedSCName = L"";
}
Modified: sandbox/rfc60/MgDev/Common/PlatformBase/Services/Reader.h
===================================================================
--- sandbox/rfc60/MgDev/Common/PlatformBase/Services/Reader.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/PlatformBase/Services/Reader.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -132,7 +132,7 @@
///
virtual INT32 GetPropertyType(CREFSTRING propertyName) = 0;
- /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
/// \brief
/// Gets the type of the property at the specified index. See
/// MgPropertyType for the list of possible values.
Modified: sandbox/rfc60/MgDev/Common/ProductVersion.h
===================================================================
--- sandbox/rfc60/MgDev/Common/ProductVersion.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/ProductVersion.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -19,5 +19,6 @@
#define PRODUCTVERSION_H_
const STRING ProductVersion = L"2.2.0.0";
+const STRING ApiVersion = L"2.2"; // Major.Minor only
#endif // PRODUCTVERSION_H_
Modified: sandbox/rfc60/MgDev/Common/Renderers/AGGImageIO.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Renderers/AGGImageIO.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Renderers/AGGImageIO.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -673,7 +673,9 @@
//
int AGGImageIO::ImageCopyForcePaletteGD(gdImagePtr src, gdImagePtr dst, int method)
{
- long icfp = GetTickCount();
+#ifdef _DEBUG_PNG8
+ long icfp = GetTickCount(); // for performance evaluation
+#endif
int x, y;
int w, h;
int c, r, g, b,color;
Modified: sandbox/rfc60/MgDev/Common/Renderers/AGGRenderer.h
===================================================================
--- sandbox/rfc60/MgDev/Common/Renderers/AGGRenderer.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Renderers/AGGRenderer.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -50,9 +50,6 @@
/// for the list of colors used to do color quantization
-typedef std::list<RS_Color*> RSCOLORLIST;
-typedef RSCOLORLIST* PRSCOLORLIST;
-/// the efficient way
typedef std::vector<RS_Color> RSCOLORS;
typedef RSCOLORS* PRSCOLORS;
Copied: sandbox/rfc60/MgDev/Common/Schema/SiteInformation-2.2.0.xsd (from rev 4410, trunk/MgDev/Common/Schema/SiteInformation-2.2.0.xsd)
===================================================================
--- sandbox/rfc60/MgDev/Common/Schema/SiteInformation-2.2.0.xsd (rev 0)
+++ sandbox/rfc60/MgDev/Common/Schema/SiteInformation-2.2.0.xsd 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.2.0">
+ <xs:element name="SiteInformation">
+ <xs:annotation>
+ <xs:documentation>Site Information</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="SiteInformationType">
+ <xs:attribute name="version" type="xs:string" fixed="2.2.0"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="SiteInformationType">
+ <xs:sequence>
+ <xs:element name="Server">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="IpAddress" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's Ip address.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="DisplayName" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's display name.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Status" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's status. Either Online or Offline</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Version" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's version.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="OperatingSystem">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="AvailablePhysicalMemory" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The available physical memory for the operating system in bytes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TotalPhysicalMemory" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total physical memory for the operating system in bytes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="AvailableVirtualMemory" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The available virtual memory for the operating system in bytes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TotalVirtualMemory" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total virtual memory for the operating system in bytes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Version" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The operating system version.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Statistics">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="AdminOperationsQueueCount" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The number of operations in the Admin queue.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ClientOperationsQueueCount" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The number of operations in the Client queue.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="SiteOperationsQueueCount" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The number of operations in the Site queue.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="AverageOperationTime" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The average time it takes to process an operation in milliseconds.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="CpuUtilization" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The cpu utilization as a percentage.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="WorkingSet" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The working set memory of the MapGuide server in bytes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="VirtualMemory" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The virtual memory of the MapGuide server in bytes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TotalOperationTime" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total operation time of the MapGuide server in seconds.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ActiveConnections" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The number of active connections to the MapGuide server.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TotalConnections" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total number of connections that have been made to the MapGuide server.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TotalOperationsProcessed" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total number of operations processed by the MapGuide server.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="TotalOperationsReceived" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total number of operations received by the MapGuide server.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Uptime" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total time the MapGuide server has been running in seconds.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="CacheSize" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The current number of entries in the MapGuide server cache.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="CacheDroppedEntries" type="xs:integer">
+ <xs:annotation>
+ <xs:documentation>The total number of entries in the MapGuide server cache that have been dropped.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Copied: sandbox/rfc60/MgDev/Common/Schema/SiteStatus-2.2.0.xsd (from rev 4410, trunk/MgDev/Common/Schema/SiteStatus-2.2.0.xsd)
===================================================================
--- sandbox/rfc60/MgDev/Common/Schema/SiteStatus-2.2.0.xsd (rev 0)
+++ sandbox/rfc60/MgDev/Common/Schema/SiteStatus-2.2.0.xsd 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.2.0">
+ <xs:element name="SiteInformation">
+ <xs:annotation>
+ <xs:documentation>Site Status</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="SiteStatusType">
+ <xs:attribute name="version" type="xs:string" fixed="2.2.0"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="SiteStatusType">
+ <xs:sequence>
+ <xs:element name="Server">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="DisplayName" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's display name.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Status" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's status. Either Online or Offline</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ApiVersion" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's API version.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Copied: sandbox/rfc60/MgDev/Common/Schema/SiteVersion-2.2.0.xsd (from rev 4410, trunk/MgDev/Common/Schema/SiteVersion-2.2.0.xsd)
===================================================================
--- sandbox/rfc60/MgDev/Common/Schema/SiteVersion-2.2.0.xsd (rev 0)
+++ sandbox/rfc60/MgDev/Common/Schema/SiteVersion-2.2.0.xsd 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name="SiteVersion">
+ <xs:annotation>
+ <xs:documentation>Site Version</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="SiteVersionType">
+ <xs:attribute name="version" type="xs:string" fixed="2.2.0"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="SiteVersionType">
+ <xs:sequence>
+ <xs:element name="Server">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Version" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The MapGuide server's version.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Modified: sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -75,11 +75,143 @@
// check if we have any composite type styles - if we find at least
// one then we'll use it and ignore any other non-composite type styles
// TODO: confirm this is the behavior we want
+ bool foundComposite = false;
+ for (int i=0; i<ftsc->GetCount(); ++i)
+ {
+ MdfModel::FeatureTypeStyle* fts = ftsc->GetAt(i);
+ if (FeatureTypeStyleVisitor::DetermineFeatureTypeStyle(fts) == FeatureTypeStyleVisitor::ftsComposite)
+ {
+ foundComposite = true;
+ break;
+ }
+ }
+
// composite type styles are handled by the new style engine
- if (FeatureTypeStyleVisitor::hasFeatureTypeStyleCollectionComposite(ftsc))
+ if (foundComposite)
+ {
m_styleEngine->StylizeVectorLayer(layer, scaleRange, (SE_Renderer*)renderer, features, xformer, cancel, userData);
+ }
else
- CompositeLineStyleHelper(layer, scaleRange, renderer, features, xformer, cancel, userData);
+ {
+ int nFeatures = 0;
+
+ // Here we check if the layer has a composite polyline style. If so,
+ // we will make multiple feature queries and process the geometry
+ // once for each line style. This makes things look much better.
+
+ // We can render polylines with composite styles using this method
+ // only if there is a single line style
+ MdfModel::FeatureTypeStyle* fts = (ftsc->GetCount() > 0)? ftsc->GetAt(0) : NULL;
+ if (NULL != fts
+ && FeatureTypeStyleVisitor::DetermineFeatureTypeStyle(fts) == FeatureTypeStyleVisitor::ftsLine
+ && renderer->RequiresCompositeLineStyleSeparation())
+ {
+ MdfModel::RuleCollection* rules = fts->GetRules();
+
+ // temporary holder for line styles
+ std::vector<MdfModel::LineSymbolizationCollection*> tmpSyms;
+
+ // For each rule transfer all line styles into a temporary collection
+ // and away from the layer definition. Also obtain the maximum # of
+ // styles for all the rules.
+ int maxStyles = 0;
+ for (int m=0; m<rules->GetCount(); ++m)
+ {
+ MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
+ MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
+
+ // move composite line styles to a temporary collection away
+ // from the one in the layer definition
+ MdfModel::LineSymbolizationCollection* syms2 = new MdfModel::LineSymbolizationCollection();
+ while (syms->GetCount() > 0)
+ syms2->Adopt(syms->OrphanAt(0));
+
+ tmpSyms.push_back(syms2);
+
+ // keep track of the maximum # of styles
+ maxStyles = rs_max(maxStyles, syms2->GetCount());
+ }
+
+ // if there are no styles, we still want to render so that labels
+ // draw even if we are not drawing the actual geometry
+ if (maxStyles == 0)
+ {
+ nFeatures = StylizeVLHelper(layer, scaleRange, renderer, features, true, xformer, cancel, userData);
+ }
+ else
+ {
+ // collection to store labels temporarily so that we add labels
+ // to each feature just once
+ std::vector<MdfModel::TextSymbol*> tmpLabels;
+
+ // now for each separate line style - run a feature query
+ // and stylization loop with that single style
+ for (int i=0; i<maxStyles; ++i)
+ {
+ // reset reader if this is not the first time we stylize the feature
+ if (i > 0)
+ features->Reset();
+
+ // for each rule, transfer a single line style from the temporary
+ // collection to the layer definition
+ for (int m=0; m<rules->GetCount(); ++m)
+ {
+ MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
+ MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
+ MdfModel::LineSymbolizationCollection* syms2 = tmpSyms[m];
+
+ // remove label if this is not the first time we stylize
+ // the feature
+ if (i == 1)
+ tmpLabels.push_back(lr->GetLabel()->OrphanSymbol());
+
+ if (i < syms2->GetCount())
+ syms->Adopt(syms2->GetAt(i));
+ }
+
+ nFeatures += StylizeVLHelper(layer, scaleRange, renderer, features, i==0, xformer, cancel, userData);
+
+ // clear line style from each rule in the layer definition
+ for (int m=0; m<rules->GetCount(); ++m)
+ {
+ MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
+ MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
+
+ // add back label if we removed it
+ if (i > 0 && i == maxStyles-1)
+ lr->GetLabel()->AdoptSymbol(tmpLabels[m]);
+
+ if (syms->GetCount() > 0)
+ syms->OrphanAt(0);
+ }
+ }
+ }
+
+ // move composite line styles back to original layer definition
+ // collection so that it frees them up when we destroy it
+ for (int m=0; m<rules->GetCount(); ++m)
+ {
+ MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
+ MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
+ MdfModel::LineSymbolizationCollection* syms2 = tmpSyms[m];
+
+ while (syms2->GetCount() > 0)
+ syms->Adopt(syms2->OrphanAt(0));
+
+ delete syms2;
+ }
+ }
+ else
+ {
+ // composite line style separation not required
+ nFeatures = StylizeVLHelper(layer, scaleRange, renderer, features, true, xformer, cancel, userData);
+ }
+
+ #ifdef _DEBUG
+ printf(" DefaultStylizer::StylizeVectorLayer() Layer: %S Features: %d\n", layer->GetFeatureName().c_str(), nFeatures);
+ #endif
+ }
+
// need to get rid of these since they cache per layer theming
// information which may conflict with the next layer
ClearAdapters();
@@ -378,160 +510,3 @@
m_pRasterAdapter = NULL;
}
}
-
-///=======================================================================================
-/// parse the rules and move linesyms from lineRules into tmpSyms
-int DefaultStylizer::CollectLineStyles(MdfModel::RuleCollection* rules, LSCPVECTOR &tmpSyms)
-{
- // For each rule transfer all line styles into a temporary collection
- // and away from the layer definition. Also obtain the maximum # of
- // styles for all the rules.
- int maxStyles = 0;
- for (int m=0; m < rules->GetCount(); ++m)
- {
- MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
- MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
-
- // move composite line styles to a temporary collection away
- // from the one in the layer definition
- MdfModel::LineSymbolizationCollection* syms2 = new MdfModel::LineSymbolizationCollection();
- while (syms->GetCount() > 0)
- syms2->Adopt(syms->OrphanAt(0));
-
- tmpSyms.push_back(syms2);
-
- // keep track of the maximum # of styles
- maxStyles = rs_max(maxStyles, syms2->GetCount());
- }
- return maxStyles;
-}
-
-///=======================================================================================
-/// move composite line styles back from tmpSyms to original layer definition collection
-/// so that it frees them up when we destroy it
-void DefaultStylizer::ReturnLineStyles(MdfModel::RuleCollection* rules, LSCPVECTOR &tmpSyms)
-{
- for (int m=0; m<rules->GetCount(); ++m)
- {
- MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
- MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
- MdfModel::LineSymbolizationCollection* syms2 = tmpSyms[m];
-
- while (syms2->GetCount() > 0)
- syms->Adopt(syms2->OrphanAt(0));
-
- delete syms2;
- }
-}
-
-
-///=======================================================================================
-/// stylize multiple styles and remove labels in additional styles
-int DefaultStylizer::ProcessLineStyles(int maxStyles,
- MdfModel::RuleCollection* rules,
- LSCPVECTOR tmpSyms,
- MdfModel::VectorLayerDefinition* layer,
- MdfModel::VectorScaleRange* scaleRange,
- Renderer* renderer,
- RS_FeatureReader* features,
- CSysTransformer* xformer,
- CancelStylization cancel,
- void* userData)
-{
- int nFeatures =0;
- // collection to store labels temporarily so that we add labels
- // to each feature just once
- std::vector<MdfModel::TextSymbol*> tmpLabels;
-
- // now for each separate line style - run a feature query
- // and stylization loop with that single style
- for (int i=0; i < maxStyles; ++i)
- {
- // reset reader if this is not the first time we stylize the feature
- if (i > 0)
- features->Reset();
-
- // for each rule, transfer a single line style from the temporary
- // collection to the layer definition
- for (int m=0; m < rules->GetCount(); ++m)
- {
- MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
- MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
- MdfModel::LineSymbolizationCollection* syms2 = tmpSyms[m];
-
- // remove label if this is not the first time we stylize the feature
- if (i == 1)
- tmpLabels.push_back(lr->GetLabel()->OrphanSymbol());
-
- // add
- if (i < syms2->GetCount())
- syms->Adopt(syms2->GetAt(i));
- }
- /// call the helper
- nFeatures += StylizeVLHelper(layer, scaleRange, renderer, features, i==0, xformer, cancel, userData);
-
- // clear line style from each rule in the layer definition
- for (int m=0; m<rules->GetCount(); ++m)
- {
- MdfModel::LineRule* lr = (MdfModel::LineRule*)rules->GetAt(m);
- MdfModel::LineSymbolizationCollection* syms = lr->GetSymbolizations();
-
- // add back label if we removed it
- if (i > 0 && i == maxStyles-1)
- lr->GetLabel()->AdoptSymbol(tmpLabels[m]);
-
- if (syms->GetCount() > 0)
- syms->OrphanAt(0);
- }
- }
- return nFeatures;
-}
-///=======================================================================================
-/// Here we check if the layer has a composite polyline style. If so,
-/// we will make multiple feature queries and process the geometry
-/// once for each line style. This makes things look much better.
-void DefaultStylizer::CompositeLineStyleHelper(MdfModel::VectorLayerDefinition* layer,
- MdfModel::VectorScaleRange* scaleRange,
- Renderer* renderer,
- RS_FeatureReader* features,
- CSysTransformer* xformer,
- CancelStylization cancel,
- void* userData)
-{
- // we have a valid scale range... we can now go over the
- // features and apply the feature styles in that range
- MdfModel::FeatureTypeStyleCollection* ftsc = scaleRange->GetFeatureTypeStyles();
-
- int nFeatures = 0;
-
- // We can render polylines with composite styles using this method
- // only if there is a single line style
- MdfModel::FeatureTypeStyle* fts = (ftsc->GetCount() > 0)? ftsc->GetAt(0) : NULL;
- if (NULL != fts
- && FeatureTypeStyleVisitor::DetermineFeatureTypeStyle(fts) == FeatureTypeStyleVisitor::ftsLine
- && renderer->RequiresCompositeLineStyleSeparation())
- {
- MdfModel::RuleCollection* rules = fts->GetRules();
-
- // temporary holder for line styles
- LSCPVECTOR tmpSyms;
- int maxStyles = CollectLineStyles(rules, tmpSyms);
-
- // if there are no styles, we still want to render so that labels
- // draw even if we are not drawing the actual geometry
- if (maxStyles == 0)
- nFeatures = StylizeVLHelper(layer, scaleRange, renderer, features, true, xformer, cancel, userData);
- else
- nFeatures = ProcessLineStyles(maxStyles, rules, tmpSyms, layer, scaleRange, renderer, features, xformer, cancel, userData);
-
- ReturnLineStyles(rules, tmpSyms);
- }
- else // composite line style separation not required
- {
- nFeatures = StylizeVLHelper(layer, scaleRange, renderer, features, true, xformer, cancel, userData);
- }
-
-#ifdef _DEBUG
-printf(" DefaultStylizer::StylizeVectorLayer() Layer: %S Features: %d\n", layer->GetFeatureName().c_str(), nFeatures);
-#endif
-}
Modified: sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.h
===================================================================
--- sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Stylization/DefaultStylizer.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -25,8 +25,6 @@
class StylizationEngine;
class SE_SymbolManager;
-typedef std::vector<MdfModel::LineSymbolizationCollection*> LSCPVECTOR;
-
//-----------------------------------------------------------------------------
// Stylizer used for all types of layers which do not have special
// Stylizer implementation, which is currently all of them.
@@ -60,10 +58,10 @@
double mapScale);
STYLIZATION_API virtual void SetGeometryAdapter(FdoGeometryType type, GeometryAdapter* stylizer);
+ STYLIZATION_API SE_SymbolManager* GetSymbolManager() { return m_symbolmanager; }
- STYLIZATION_API virtual SE_SymbolManager* GetSymbolManager() { return m_symbolmanager; }
-protected:
- virtual int StylizeVLHelper(MdfModel::VectorLayerDefinition* layer,
+private:
+ int StylizeVLHelper(MdfModel::VectorLayerDefinition* layer,
MdfModel::VectorScaleRange* scaleRange,
Renderer* renderer,
RS_FeatureReader* features,
@@ -71,30 +69,6 @@
CSysTransformer* xformer,
CancelStylization cancel,
void* userData);
-
-private:
- void CompositeLineStyleHelper(MdfModel::VectorLayerDefinition* layer,
- MdfModel::VectorScaleRange* scaleRange,
- Renderer* renderer,
- RS_FeatureReader* features,
- CSysTransformer* xformer,
- CancelStylization cancel,
- void* userData);
-
- int CollectLineStyles(MdfModel::RuleCollection* rules, LSCPVECTOR &tmpSyms);
- void ReturnLineStyles(MdfModel::RuleCollection* rules, LSCPVECTOR &tmpSyms);
-
- int ProcessLineStyles(int maxStyles,
- MdfModel::RuleCollection* rules,
- LSCPVECTOR tmpSyms,
- MdfModel::VectorLayerDefinition* layer,
- MdfModel::VectorScaleRange* scaleRange,
- Renderer* renderer,
- RS_FeatureReader* features,
- CSysTransformer* xformer,
- CancelStylization cancel,
- void* userData);
-
GeometryAdapter* FindGeomAdapter(int geomType);
void ClearAdapters();
Modified: sandbox/rfc60/MgDev/Common/Stylization/ExpressionFunctionIf.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Stylization/ExpressionFunctionIf.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Stylization/ExpressionFunctionIf.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -150,10 +150,10 @@
{
e->Release();
// value remains false
+ }
}
}
}
- }
// return the literal indicated by the condition
return condition? literalValues->GetItem(1) : literalValues->GetItem(2);
Modified: sandbox/rfc60/MgDev/Common/Stylization/FeatureTypeStyleVisitor.h
===================================================================
--- sandbox/rfc60/MgDev/Common/Stylization/FeatureTypeStyleVisitor.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Stylization/FeatureTypeStyleVisitor.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -85,20 +85,6 @@
return vis.GetFeatureTypeStyle();
}
- //static helper
- static bool hasFeatureTypeStyleCollectionComposite(MdfModel::FeatureTypeStyleCollection* ftsc)
- {
- for (int i=0; i<ftsc->GetCount(); ++i)
- {
- MdfModel::FeatureTypeStyle* fts = ftsc->GetAt(i);
- if (FeatureTypeStyleVisitor::DetermineFeatureTypeStyle(fts) == FeatureTypeStyleVisitor::ftsComposite)
- {
- return true;
- }
- }
- return false;
- }
-
private:
eFeatureTypeStyle m_type;
};
Modified: sandbox/rfc60/MgDev/Common/Stylization/LineBuffer.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Stylization/LineBuffer.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Stylization/LineBuffer.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -1933,7 +1933,7 @@
//
// PURPOSE: Clips a line (given in application coordinates) against the
// specified clip rectangle using the Cohen-Sutherland clipping
-// algorithm. Note - the clipped segment is guaranteed to have
+// algorithm. Note - the clipped segment is guaranteed to have
// the same directon as the original.
//
// PARAMETERS:
Modified: sandbox/rfc60/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- sandbox/rfc60/MgDev/Common/Stylization/SE_Renderer.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Common/Stylization/SE_Renderer.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -569,8 +569,8 @@
memcpy(ret->bounds, symbol->bounds, sizeof(ret->bounds));
ret->addToExclusionRegion = symbol->addToExclusionRegion;
ret->checkExclusionRegion = symbol->checkExclusionRegion;
- ret->drawLast = symbol->drawLast;
- ret->renderPass = symbol->renderPass;
+ ret->drawLast = symbol->drawLast;
+ ret->renderPass = symbol->renderPass;
// copy the graphics for the symbol
for (size_t i=0; i<symbol->symbol.size(); ++i)
Modified: sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/aqua/ApplicationDefinition.xml
===================================================================
--- sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/aqua/ApplicationDefinition.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/aqua/ApplicationDefinition.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -695,7 +695,7 @@
<Widget xsi:type="UiWidgetType">
<Name>menuMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
@@ -835,7 +835,7 @@
<Widget xsi:type="UiWidgetType">
<Name>toolbarMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
Modified: sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/limegold/ApplicationDefinition.xml
===================================================================
--- sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/limegold/ApplicationDefinition.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/limegold/ApplicationDefinition.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -690,7 +690,7 @@
<Widget xsi:type="UiWidgetType">
<Name>menuMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
@@ -762,7 +762,7 @@
<Widget xsi:type="UiWidgetType">
<Name>toolbarMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
Modified: sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/maroon/ApplicationDefinition.xml
===================================================================
--- sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/maroon/ApplicationDefinition.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/maroon/ApplicationDefinition.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -695,7 +695,7 @@
<Widget xsi:type="UiWidgetType">
<Name>menuMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
@@ -835,7 +835,7 @@
<Widget xsi:type="UiWidgetType">
<Name>toolbarMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
Modified: sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/preview/ApplicationDefinition.xml
===================================================================
--- sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/preview/ApplicationDefinition.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/preview/ApplicationDefinition.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -683,7 +683,7 @@
<Widget xsi:type="UiWidgetType">
<Name>menuMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
@@ -795,7 +795,7 @@
<Widget xsi:type="UiWidgetType">
<Name>toolbarMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
Modified: sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/slate/ApplicationDefinition.xml
===================================================================
--- sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/slate/ApplicationDefinition.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/slate/ApplicationDefinition.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -690,7 +690,7 @@
<Widget xsi:type="UiWidgetType">
<Name>menuMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
@@ -762,7 +762,7 @@
<Widget xsi:type="UiWidgetType">
<Name>toolbarMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
Modified: sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/ApplicationDefinition.xml
===================================================================
--- sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/ApplicationDefinition.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/ApplicationDefinition.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -671,7 +671,7 @@
<Widget xsi:type="UiWidgetType">
<Name>menuMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
@@ -728,7 +728,7 @@
<Widget xsi:type="UiWidgetType">
<Name>toolbarMeasure</Name>
<Type>Measure</Type>
- <StatusItem>Measure distances on the map.</StatusItem>
+ <StatusItem>Measure distances and areas on the map.</StatusItem>
<Extension xsi:type="CustomContentType">
<Type>both</Type>
<MeasureTooltipContainer>MeasureResult</MeasureTooltipContainer>
Modified: sandbox/rfc60/MgDev/Server/src/Common/Manager/Connection.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Manager/Connection.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Manager/Connection.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -100,9 +100,9 @@
else
{
ACE_OS::thr_setspecific(g_threadLocalConnection, NULL);
+ }
}
}
- }
if (0 != g_threadLocalConnection)
{
@@ -113,7 +113,7 @@
if(connection != NULL)
{
tempConnection = new MgConnection(*connection);
- }
+ }
ACE_OS::thr_setspecific(g_threadLocalConnection, tempConnection);
Modified: sandbox/rfc60/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -654,35 +654,35 @@
INT32 useLimit = providerInfo->GetUseLimit();
if (useLimit == -1 || pFdoConnectionCacheEntry->nUseTotal <= useLimit)
{
- if((!pFdoConnectionCacheEntry->bInUse) ||
- (providerInfo->GetThreadModel() == FdoThreadCapability_PerCommandThreaded) ||
- (providerInfo->GetThreadModel() == FdoThreadCapability_MultiThreaded))
- {
- // It is not in use or the provider is a PerCommandThreaded/MultiThreaded provider so claim it
- pFdoConnectionCacheEntry->lastUsed = ACE_OS::gettimeofday();
- pFdoConnectionCacheEntry->bInUse = true;
- pFdoConnectionCacheEntry->nUseCount++; // Only used by PerCommandThreaded/MultiThreaded
+ if((!pFdoConnectionCacheEntry->bInUse) ||
+ (providerInfo->GetThreadModel() == FdoThreadCapability_PerCommandThreaded) ||
+ (providerInfo->GetThreadModel() == FdoThreadCapability_MultiThreaded))
+ {
+ // It is not in use or the provider is a PerCommandThreaded/MultiThreaded provider so claim it
+ pFdoConnectionCacheEntry->lastUsed = ACE_OS::gettimeofday();
+ pFdoConnectionCacheEntry->bInUse = true;
+ pFdoConnectionCacheEntry->nUseCount++; // Only used by PerCommandThreaded/MultiThreaded
pFdoConnectionCacheEntry->nUseTotal++;
- // Check to see if the key is blank which indicates a blank connection string was cached
- if(0 < key.size())
- {
- // The key was not blank so check if we need to open it
- if (FdoConnectionState_Closed == pFdoConnectionCacheEntry->pFdoConnection->GetConnectionState())
+ // Check to see if the key is blank which indicates a blank connection string was cached
+ if(0 < key.size())
{
- pFdoConnectionCacheEntry->pFdoConnection->Open();
- #ifdef _DEBUG_FDOCONNECTION_MANAGER
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT("SearchFdoConnectionCache() - Had to reopen connection!!\n")));
- #endif
+ // The key was not blank so check if we need to open it
+ if (FdoConnectionState_Closed == pFdoConnectionCacheEntry->pFdoConnection->GetConnectionState())
+ {
+ pFdoConnectionCacheEntry->pFdoConnection->Open();
+ #ifdef _DEBUG_FDOCONNECTION_MANAGER
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("SearchFdoConnectionCache() - Had to reopen connection!!\n")));
+ #endif
+ }
}
+ pFdoConnection = FDO_SAFE_ADDREF(pFdoConnectionCacheEntry->pFdoConnection);
+ break;
}
- pFdoConnection = FDO_SAFE_ADDREF(pFdoConnectionCacheEntry->pFdoConnection);
- break;
}
}
}
}
- }
// Next match
iter++;
@@ -1634,10 +1634,10 @@
// If the provider was PerCommandThreaded/MultiThreaded the connection may still be in use
if(0 >= pFdoConnectionCacheEntry->nUseCount)
{
- pFdoConnectionCacheEntry->bInUse = false;
+ pFdoConnectionCacheEntry->bInUse = false;
pFdoConnectionCacheEntry->nUseCount = 0;
+ }
}
- }
else
{
#ifdef _DEBUG_FDOCONNECTION_MANAGER
@@ -2071,7 +2071,7 @@
{
resId = resource->ToString();
}
-
+
if (resId.empty())
{
MgStringCollection arguments;
@@ -2103,7 +2103,7 @@
FdoConnectionCacheEntry* pFdoConnectionCacheEntry = iter->second;
if (pFdoConnectionCacheEntry)
{
- // Mark all the connections that use this resource as invalid because the something bad
+ // Mark all the connections that use this resource as invalid because the something bad
// happened to the underlying connection. This will force new connections to be created aand cached.
pFdoConnectionCacheEntry->bValid = false;
}
Modified: sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -23,6 +23,14 @@
#include "WorkerThread.h"
#include "WorkerThreadData.h"
+#ifdef _WIN32
+#include <Psapi.h>
+#else
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+#endif
+
const STRING MgServerManager::DocumentExtension = L".awd";
const STRING MgServerManager::DocumentPath = L"DocumentPath";
@@ -444,8 +452,8 @@
pProperties->Add(pProperty);
// Add the Uptime
- INT32 nUptime = GetUptime();
- pProperty = new MgInt32Property(MgServerInformationProperties::Uptime, nUptime);
+ time_t nUptime = GetUptime();
+ pProperty = new MgInt64Property(MgServerInformationProperties::Uptime, nUptime);
pProperties->Add(pProperty);
// Add the TotalPhysicalMemory
@@ -469,13 +477,13 @@
pProperties->Add(pProperty);
// Add the TotalOperationTime
- INT32 nTotalOperationTime = GetTotalOperationTime();
- pProperty = new MgInt32Property(MgServerInformationProperties::TotalOperationTime, nTotalOperationTime);
+ time_t nTotalOperationTime = GetTotalOperationTime();
+ pProperty = new MgInt64Property(MgServerInformationProperties::TotalOperationTime, nTotalOperationTime);
pProperties->Add(pProperty);
// Add the AverageOperationTime
- INT32 nAverageOperationTime = GetAverageOperationTime();
- pProperty = new MgInt32Property(MgServerInformationProperties::AverageOperationTime, nAverageOperationTime);
+ time_t nAverageOperationTime = GetAverageOperationTime();
+ pProperty = new MgInt64Property(MgServerInformationProperties::AverageOperationTime, nAverageOperationTime);
pProperties->Add(pProperty);
// Add the server Version
@@ -486,6 +494,10 @@
pProperty = new MgStringProperty(MgServerInformationProperties::DisplayName, m_displayName);
pProperties->Add(pProperty);
+ // Add the MachineIp
+ pProperty = new MgStringProperty(MgServerInformationProperties::MachineIp, m_localServerAddress);
+ pProperties->Add(pProperty);
+
// Add the Operations info
INT32 nTotalReceivedOperations = GetTotalReceivedOperations();
pProperty = new MgInt32Property(MgServerInformationProperties::TotalReceivedOperations, nTotalReceivedOperations);
@@ -509,11 +521,105 @@
pProperty = new MgStringProperty(MgServerInformationProperties::OperatingSystemVersion, osVersion);
pProperties->Add(pProperty);
+#ifdef _WIN32
+ HANDLE procHandle = GetCurrentProcess();
+ PROCESS_MEMORY_COUNTERS counters;
+ counters.cb = sizeof(counters);
+ BOOL ok = GetProcessMemoryInfo(procHandle, &counters, sizeof(counters));
+ if (ok)
+ {
+ pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, counters.WorkingSetSize);
+ pProperties->Add(pProperty);
+ pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, counters.PagefileUsage);
+ pProperties->Add(pProperty);
+ }
+#else
+ // getrusage does not work on Linux so pull information directly
+ // from proc filesystem.
+ int pageSize = getpagesize();
+ char procName[256];
+ sprintf(procName,"/proc/%d/status",getpid());
+ FILE* fp = fopen(procName,"rb");
+ if (NULL != fp)
+ {
+ char buf[1024];
+ memset(buf,0,1024);
+ fread(buf, 1024, 1, fp);
+ fclose(fp);
+
+ char* strRss = "VmRSS:";
+ char* end = NULL;
+ char* loc = strstr(buf, strRss);
+ if (NULL != loc)
+ {
+ long kbytes = strtol(loc + strlen(strRss) + 1, &end, 10);
+ INT64 workingSet = kbytes * 1000;
+ pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, workingSet);
+ pProperties->Add(pProperty);
+ }
+
+ char* strSize = "VmSize:";
+ loc = strstr(buf, strSize);
+ if (NULL != loc)
+ {
+ long kbytes = strtol(loc + strlen(strSize) + 1, &end, 10);
+ INT64 workingSet = kbytes * 1000;
+ pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, workingSet);
+ pProperties->Add(pProperty);
+ }
+ }
+#endif
+
MG_CATCH_AND_THROW(L"MgServerManager.GetInformationProperties")
return pProperties.Detach();
}
+///////////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// Gets the site version.
+/// </summary>
+STRING MgServerManager::GetSiteVersion()
+{
+ return ProductVersion;
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// Gets the status properties for the server.
+/// </summary>
+MgPropertyCollection* MgServerManager::GetSiteStatus()
+{
+ Ptr<MgPropertyCollection> pProperties;
+ pProperties = NULL;
+
+ MG_TRY()
+
+ MG_LOG_TRACE_ENTRY(L"MgServerManager::GetSiteStatus()");
+
+ pProperties = new MgPropertyCollection();
+
+ // Add the information properties
+ Ptr<MgProperty> pProperty;
+
+ // Add the DisplayName
+ pProperty = new MgStringProperty(MgServerInformationProperties::DisplayName, m_displayName);
+ pProperties->Add(pProperty);
+
+ // Add the Status
+ bool bOnline = IsOnline();
+ pProperty = new MgBooleanProperty(MgServerInformationProperties::Status, bOnline);
+ pProperties->Add(pProperty);
+
+ // Add the API Version
+ pProperty = new MgStringProperty(MgServerInformationProperties::ApiVersion, ApiVersion);
+ pProperties->Add(pProperty);
+
+ MG_CATCH_AND_THROW(L"MgServerManager.GetSiteStatus")
+
+ return pProperties.Detach();
+}
+
MgByteReader* MgServerManager::GetDocument(CREFSTRING identifier)
{
Ptr<MgByteReader> pByteReader;
@@ -711,12 +817,12 @@
return m_totalProcessedOperations.value();
}
-INT32 MgServerManager::GetTotalOperationTime()
+time_t MgServerManager::GetTotalOperationTime()
{
return m_totalOperationTime.value();
}
-void MgServerManager::IncrementOperationTime(INT32 operationTime)
+void MgServerManager::IncrementOperationTime(time_t operationTime)
{
m_totalOperationTime += operationTime;
}
@@ -1022,7 +1128,7 @@
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
-INT32 MgServerManager::GetUptime()
+time_t MgServerManager::GetUptime()
{
ACE_Time_Value upTime(0);
@@ -1032,7 +1138,7 @@
MG_CATCH_AND_THROW(L"MgServerManager.GetUptime");
- return (INT32)upTime.sec();
+ return upTime.sec();
}
///////////////////////////////////////////////////////////////////////////////////
@@ -1045,7 +1151,7 @@
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
-INT32 MgServerManager::GetAverageOperationTime()
+time_t MgServerManager::GetAverageOperationTime()
{
double avgTime = 0.0;
@@ -1059,7 +1165,7 @@
MG_CATCH_AND_THROW(L"MgServerManager.GetAverageOperationTime")
- return (INT32)avgTime;
+ return time_t(avgTime);
}
///////////////////////////////////////////////////////////////////////////////////
Modified: sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -36,6 +36,7 @@
class MgWorkerThread;
typedef ACE_Atomic_Op<ACE_Thread_Mutex, INT32> SAFE_INT32;
+typedef ACE_Atomic_Op<ACE_Thread_Mutex, time_t> SAFE_TIME_T;
class MG_SERVER_MANAGER_API MgServerManager : public MgGuardDisposable
{
@@ -60,6 +61,8 @@
void RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
MgPropertyCollection* GetInformationProperties();
+ MgPropertyCollection* GetSiteStatus();
+ STRING GetSiteVersion();
MgByteReader* GetDocument(CREFSTRING identifier);
void SetDocument(CREFSTRING identifier, MgByteReader* data);
@@ -97,9 +100,9 @@
ACE_Time_Value GetStartTime();
INT32 GetTotalReceivedOperations();
INT32 GetTotalProcessedOperations();
- INT32 GetTotalOperationTime();
+ time_t GetTotalOperationTime();
- void IncrementOperationTime(INT32 operationTime);
+ void IncrementOperationTime(time_t operationTime);
void IncrementReceivedOperations();
void IncrementProcessedOperations();
@@ -114,8 +117,8 @@
INT32 GetClientOperationsQueueCount();
INT32 GetSiteOperationsQueueCount();
- INT32 GetUptime();
- INT32 GetAverageOperationTime();
+ time_t GetUptime();
+ time_t GetAverageOperationTime();
INT64 GetTotalPhysicalMemory();
INT64 GetAvailablePhysicalMemory();
@@ -173,7 +176,7 @@
INT32 m_nSiteThreads;
ACE_Time_Value m_startTime;
- SAFE_INT32 m_totalOperationTime; // This value is tracked in seconds
+ SAFE_TIME_T m_totalOperationTime; // This value is tracked in seconds
SAFE_INT32 m_totalReceivedOperations;
SAFE_INT32 m_totalProcessedOperations;
Modified: sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Manager/ServerManager.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Common\Renderers;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;"..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src";..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\Inc\ExpressionEngine"
+ AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;"..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src";..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\Inc\ExpressionEngine"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS"
MinimalRebuild="true"
ExceptionHandling="2"
@@ -52,7 +52,6 @@
RuntimeLibrary="3"
DisableLanguageExtensions="false"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
@@ -66,11 +65,11 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACEd.lib Fdo.lib FdoCommon.lib pdh.lib"
+ AdditionalDependencies="ACEd.lib FDO.lib FDOCommon.lib pdh.lib psapi.lib"
OutputFile="$(OutDir)\MgServerManagerd.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\FDO\lib"
- DelayLoadDLLs="Fdo.dll;FdoCommon.dll"
+ DelayLoadDLLs="FDO.dll;FDOCommon.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgServerManagerd.pdb"
SubSystem="2"
@@ -135,7 +134,6 @@
RuntimeLibrary="3"
DisableLanguageExtensions="false"
WarningLevel="3"
- Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
@@ -149,11 +147,11 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACEd.lib Fdo.lib FdoCommon.lib pdh.lib"
+ AdditionalDependencies="ACEd.lib FDO.lib FDOCommon.lib pdh.lib psapi.lib"
OutputFile="$(OutDir)\MgServerManagerd.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\FDO\lib64"
- DelayLoadDLLs="Fdo.dll;FdoCommon.dll"
+ DelayLoadDLLs="FDO.dll;FDOCommon.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgServerManagerd.pdb"
SubSystem="2"
@@ -209,12 +207,11 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Common\Renderers;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;"..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src";..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\Inc\ExpressionEngine"
+ AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;"..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src";..\..\..\..\Oem\FDO\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS"
ExceptionHandling="2"
RuntimeLibrary="2"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
@@ -228,11 +225,11 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACE.lib Fdo.lib FdoCommon.lib pdh.lib"
+ AdditionalDependencies="ACE.lib FDO.lib FDOCommon.lib pdh.lib psapi.lib"
OutputFile="$(OutDir)\MgServerManager.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\FDO\lib"
- DelayLoadDLLs="Fdo.dll;FdoCommon.dll"
+ DelayLoadDLLs="FDO.dll;FDOCommon.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgServerManager.pdb"
SubSystem="2"
@@ -296,7 +293,6 @@
ExceptionHandling="2"
RuntimeLibrary="2"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
@@ -310,11 +306,11 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ACE.lib Fdo.lib FdoCommon.lib pdh.lib"
+ AdditionalDependencies="ACE.lib FDO.lib FDOCommon.lib pdh.lib psapi.lib"
OutputFile="$(OutDir)\MgServerManager.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\FDO\lib64"
- DelayLoadDLLs="Fdo.dll;FdoCommon.dll"
+ DelayLoadDLLs="FDO.dll;FDOCommon.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\MgServerManager.pdb"
SubSystem="2"
Modified: sandbox/rfc60/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -441,7 +441,7 @@
// find the mapping name in the map, and then replace it
Ptr<MgPropertyCollection> unmanagedDataMappings = MgUnmanagedDataManager::GetInstance()->GetUnmanagedDataMappings();
-
+
if (NULL != unmanagedDataMappings.p)
{
Ptr<MgStringProperty> stringProp = dynamic_cast<MgStringProperty*>(unmanagedDataMappings->FindItem(MgUtil::MultiByteToWideChar(mappingName)));
Modified: sandbox/rfc60/MgDev/Server/src/Common/Thread/ServerThread.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Common/Thread/ServerThread.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Common/Thread/ServerThread.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -50,7 +50,6 @@
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
@@ -130,7 +129,6 @@
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
- Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
@@ -207,7 +205,6 @@
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_THREAD_EXPORTS"
RuntimeLibrary="2"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
@@ -287,7 +284,6 @@
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_THREAD_EXPORTS"
RuntimeLibrary="2"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Modified: sandbox/rfc60/MgDev/Server/src/Core/EventTimer.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/EventTimer.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/EventTimer.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -20,7 +20,7 @@
class MgTimedEventHandler;
-const int MG_MAX_EVENT_TIMERS = 7;
+const int MG_MAX_EVENT_TIMERS = 8;
class MgEventTimer
{
@@ -37,6 +37,7 @@
RepositoryCheckpoint = 4,
ResourceChange = 5,
FeatureServiceCacheTimeLimit = 6,
+ DataTransactionTimeout = 7,
};
/// Constructors/Destructor
Modified: sandbox/rfc60/MgDev/Server/src/Core/OperationThread.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/OperationThread.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/OperationThread.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -408,7 +408,7 @@
// We increment operations processed for successful operations only.
if (IMgServiceHandler::mpsDone == stat)
{
- INT32 opTime = operationTime.sec();
+ time_t opTime = operationTime.sec();
pConnection->IncrementProcessedOperations();
pConnection->SetCurrentOperationTime(opTime);
Modified: sandbox/rfc60/MgDev/Server/src/Core/Server.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/Server.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/Server.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -28,6 +28,7 @@
#include "FontManager.h"
#include "LongTransactionManager.h"
#include "CacheManager.h"
+#include "ServerFeatureTransactionPool.h"
#include "Stylizer.h"
#include "Bounds.h"
@@ -987,6 +988,12 @@
MgFdoConnectionManager* pFdoConnectionManager = MgFdoConnectionManager::GetInstance();
pFdoConnectionManager->Initialize(bDataConnectionPoolEnabled, nDataConnectionPoolSize, dataConnectionTimer.GetEventTimeout(), dataConnectionPoolExcludedProviders, dataConnectionPoolSizeCustom, dataConnectionUseLimit);
+ // Initialize the transaction pool
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) MgServer::open() - Initializing transaction pool.\n")));
+ MgEventTimer& dataTransactionTimer = m_eventTimerManager.GetEventTimer(MgEventTimer::DataTransactionTimeout);
+ MgServerFeatureTransactionPool* pTransactionPool = MgServerFeatureTransactionPool::GetInstance();
+ pTransactionPool->Initialize(dataTransactionTimer.GetEventTimeout());
+
// On startup, perform the service registration for the Site server.
// Note that this event will be perfomed by a timer for the Support server.
ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) MgServer::open() - Registering Services.\n")));
Modified: sandbox/rfc60/MgDev/Server/src/Core/ServerCore.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/ServerCore.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/ServerCore.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -50,7 +50,6 @@
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4267"
/>
@@ -131,7 +130,6 @@
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
- Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
DisableSpecificWarnings="4267"
/>
@@ -212,7 +210,6 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4267"
/>
@@ -295,7 +292,6 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4267"
/>
@@ -432,6 +428,78 @@
>
</File>
<File
+ RelativePath=".\DataTransactionTimeoutEventHandler.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseTopobase|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseTopobase|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="DebugTopobase|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="DebugTopobase|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\DataTransactionTimeoutEventHandler.h"
+ >
+ </File>
+ <File
RelativePath=".\EventTimer.cpp"
>
<FileConfiguration
@@ -949,10 +1017,6 @@
>
</File>
<File
- RelativePath=".\serverconfig.ini"
- >
- </File>
- <File
RelativePath=".\ServerCore.rc"
>
</File>
Modified: sandbox/rfc60/MgDev/Server/src/Core/ServerCoreBuild.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/ServerCoreBuild.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/ServerCoreBuild.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -18,6 +18,7 @@
#include "ClientAcceptor.cpp"
#include "ConnectionTimeoutEventHandler.cpp"
#include "DataConnectionTimeoutEventHandler.cpp"
+#include "DataTransactionTimeoutEventHandler.cpp"
#include "EventTimer.cpp"
#include "EventTimerManager.cpp"
#include "FeatureServiceCacheTimeLimitEventHandler.cpp"
Modified: sandbox/rfc60/MgDev/Server/src/Core/TimedEvent.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/TimedEvent.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/TimedEvent.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -33,6 +33,7 @@
RepositoryCheckpoint = 50,
ResourceChange = 60,
FeatureServiceCacheTimeLimit = 70,
+ DataTransactionTimeout = 80,
};
/// Constructors/Destructor
Modified: sandbox/rfc60/MgDev/Server/src/Core/TimedEventHandler.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/TimedEventHandler.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/TimedEventHandler.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -86,6 +86,10 @@
eventHandler.reset(new MgFeatureServiceCacheTimeLimitEventHandler(timer));
break;
+ case MgEventTimer::DataTransactionTimeout:
+ eventHandler.reset(new MgDataTransactionTimeoutEventHandler(timer));
+ break;
+
default:
throw new MgInvalidArgumentException(
L"MgTimedEventHandler.Create", __LINE__, __WFILE__, NULL, L"", NULL);
Modified: sandbox/rfc60/MgDev/Server/src/Core/serverconfig.ini
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Core/serverconfig.ini 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Core/serverconfig.ini 2009-12-11 16:29:40 UTC (rev 4411)
@@ -1,4 +1,4 @@
-# *****************************************************************************
+# *****************************************************************************
# MapGuide Server Configuration File
#
# The following configuration is based on a single CPU with a single core.
@@ -83,6 +83,7 @@
ConnectionTimerInterval = 60
DefaultMessageLocale = en
DisplayName =
+FailoverRetryTime = 60
FdoPath = FDO/
LicenseServerPath = @localhost
Locale =
Modified: sandbox/rfc60/MgDev/Server/src/Gws/GwsCommon/stdafx.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Gws/GwsCommon/stdafx.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Gws/GwsCommon/stdafx.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -20,16 +20,14 @@
#endif
#if defined (_MSC_VER)
-// Disable deprecation and non-conforming warning introduced by VC8
-# define _CRT_SECURE_NO_DEPRECATE 1
-# define _CRT_NON_CONFORMING_SWPRINTFS 1
-# pragma warning (disable:4996)
+// disable deprecation and non-conforming warning introduced by VC8
+#define _CRT_SECURE_NO_DEPRECATE 1
+#define _CRT_NON_CONFORMING_SWPRINTFS 1
+#pragma warning(disable: 4996)
#endif
-// #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#ifdef _WIN32
+// Windows Header Files:
#include <windows.h>
#include <limits.h>
#else
Modified: sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -308,12 +308,12 @@
}
-// TODO - This method is executed 2 times on a join.
-// 1) SelectFeatures() creates a MgServerGwsFeatureReader() object and inside this constructor it calls
+// TODO - This method is executed 2 times on a join.
+// 1) SelectFeatures() creates a MgServerGwsFeatureReader() object and inside this constructor it calls
// m_gwsGetFeatures->GetMgClassDefinition() which uses the iterator copy to generate the class definition.
// 2) ReadNext() on the actual reader. This one is expected.
//
-// Would be nice if we did not require the iterator copy and could therefore remove the 1st call.
+// Would be nice if we did not require the iterator copy and could therefore remove the 1st call.
FdoDataValueCollection * CGwsBatchSortedBlockJoinQueryResults::GetJoinValues ()
{
#ifdef _DEBUG_BATCHSORT_JOIN
Modified: sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/stdafx.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/stdafx.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Gws/GwsQueryEngine/stdafx.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -20,16 +20,18 @@
#endif
#if defined (_MSC_VER)
-// Disable deprecation and non-conforming warning introduced by VC8
-# define _CRT_SECURE_NO_DEPRECATE 1
-# define _CRT_NON_CONFORMING_SWPRINTFS 1
-# pragma warning (disable:4996)
+// disable deprecation and non-conforming warning introduced by VC8
+#define _CRT_SECURE_NO_DEPRECATE 1
+#define _CRT_NON_CONFORMING_SWPRINTFS 1
+#pragma warning(disable: 4996)
#endif
#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+// exclude rarely-used stuff from Windows headers
+#define WIN32_LEAN_AND_MEAN
+
// Windows Header Files:
-
#include <windows.h>
#include <limits.h>
#else
@@ -40,7 +42,6 @@
#include <string>
#endif
-//#include "io.h"
#include "assert.h"
#include <Fdo.h>
Modified: sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsCommon.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsCommon.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsCommon.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -28,10 +28,6 @@
#include <Fdo.h>
-#ifdef _WIN32
-#pragma warning( disable : 4290 ) //ignore C++ specific exception specification
-#endif
-
#ifdef GWS_MULTHREADED_CLIENT
#define GWSThreadModel GWSMultiThreadModel
#else
Modified: sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsQueryEngine.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsQueryEngine.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Gws/Include/GwsQueryEngine.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -30,9 +30,7 @@
#include <GwsCommon.h>
#ifdef _WIN32
-#pragma warning( disable : 4505 ) // ignore 'function' : unreferenced local function has been removed
-#pragma warning( disable : 4290 ) // ignore C++ specific exception specification
-#else
+#pragma warning(disable: 4505) // ignore 'function' : unreferenced local function has been removed
#endif
// forward definitions
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -959,7 +959,7 @@
fdoPropDef->SetHasMeasure(hasMeasure);
fdoPropDef->SetReadOnly(isReadOnly);
- if(spatialContextName.empty())
+ if(!spatialContextName.empty())
{
fdoPropDef->SetSpatialContextAssociation((FdoString*)spatialContextName.c_str());
}
@@ -989,6 +989,7 @@
bool isNullable = mgPropDef->GetNullable();
STRING qname = mgPropDef->GetQualifiedName();
bool isReadOnly = mgPropDef->GetReadOnly();
+ STRING spatialContextName = mgPropDef->GetSpatialContextAssociation();
//Set it for Fdo
if (!desc.empty())
@@ -1002,6 +1003,11 @@
//Cannot set qualified name in fdo
fdoPropDef->SetReadOnly(isReadOnly);
+ if(!spatialContextName.empty())
+ {
+ fdoPropDef->SetSpatialContextAssociation((FdoString*)spatialContextName.c_str());
+ }
+
MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgJoinFeatureReader.GetRasterPropertyDefinition")
return fdoPropDef.Detach();
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/JoinFeatureReader.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -299,7 +299,7 @@
///
virtual FdoIRaster* GetRaster(FdoString* propertyName);
- /// \brief
+ /// \brief
/// Gets the geometry value of the property, at the specified index,
/// as a byte array in FGF format. Because no conversion is performed,
/// the property must be of Geometric type; otherwise, an exception is thrown.
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerCreateFeatureSource.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -93,24 +93,24 @@
if (bCheckFeatureClass)
{
- Ptr<MgClassDefinitionCollection> classes = schema->GetClasses();
- if(classes == NULL || classes->GetCount() == 0)
- throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingClassDef", NULL);
+ Ptr<MgClassDefinitionCollection> classes = schema->GetClasses();
+ if(classes == NULL || classes->GetCount() == 0)
+ throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingClassDef", NULL);
- for(INT32 ci = 0; ci < classes->GetCount(); ci++)
- {
- Ptr<MgClassDefinition> classDef = classes->GetItem(ci);
- Ptr<MgPropertyDefinitionCollection> idProps = classDef->GetIdentityProperties();
- if(idProps == NULL || idProps->GetCount() == 0)
- throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgClassWOIdentity", NULL);
+ for(INT32 ci = 0; ci < classes->GetCount(); ci++)
+ {
+ Ptr<MgClassDefinition> classDef = classes->GetItem(ci);
+ Ptr<MgPropertyDefinitionCollection> idProps = classDef->GetIdentityProperties();
+ if(idProps == NULL || idProps->GetCount() == 0)
+ throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgClassWOIdentity", NULL);
+ }
}
- }
if (bCheckSpatialContext)
{
- // A coordinate system must be defined
- if(m_params->GetCoordinateSystemWkt().empty())
- throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSrs", NULL);
+ // A coordinate system must be defined
+ if(m_params->GetCoordinateSystemWkt().empty())
+ throw new MgInvalidArgumentException(L"MgServerCreateFileFeatureSource.CreateFeatureSource", __LINE__, __WFILE__, NULL, L"MgMissingSrs", NULL);
}
// Connect to provider
@@ -168,13 +168,13 @@
// Create the spatialcontext
if (!m_params->GetCoordinateSystemWkt().empty())
{
- FdoPtr<FdoICreateSpatialContext> spatialContext = (FdoICreateSpatialContext*)conn->CreateCommand(FdoCommandType_CreateSpatialContext);
- spatialContext->SetCoordinateSystemWkt(m_params->GetCoordinateSystemWkt().c_str());
- spatialContext->SetDescription(m_params->GetSpatialContextDescription().c_str());
- spatialContext->SetName(m_params->GetSpatialContextName().c_str());
- spatialContext->SetXYTolerance(m_params->GetXYTolerance());
- spatialContext->SetZTolerance(m_params->GetZTolerance());
- spatialContext->Execute();
+ FdoPtr<FdoICreateSpatialContext> spatialContext = (FdoICreateSpatialContext*)conn->CreateCommand(FdoCommandType_CreateSpatialContext);
+ spatialContext->SetCoordinateSystemWkt(m_params->GetCoordinateSystemWkt().c_str());
+ spatialContext->SetDescription(m_params->GetSpatialContextDescription().c_str());
+ spatialContext->SetName(m_params->GetSpatialContextName().c_str());
+ spatialContext->SetXYTolerance(m_params->GetXYTolerance());
+ spatialContext->SetZTolerance(m_params->GetZTolerance());
+ spatialContext->Execute();
}
// Create and set the schema
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerFeatureService.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerFeatureService.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerFeatureService.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -783,7 +783,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Set the active long transaction name for a feature source.
- /// The long transaction name is associated with the caller's session. If
+ /// The long transaction name is associated with the caller's session. If
/// no session is set then the method throws an MgSessionNotFoundException.
/// </summary>
/// <param name="featureSourceId">Input
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -234,10 +234,10 @@
}
else
{
- m_bAdvancePrimaryIterator = true;
+ m_bAdvancePrimaryIterator = true;
+ }
}
}
- }
else
{
m_bAdvancePrimaryIterator = true;
@@ -351,10 +351,10 @@
}
else
{
- m_bAdvancePrimaryIterator = true;
+ m_bAdvancePrimaryIterator = true;
+ }
}
}
- }
else
{
m_bAdvancePrimaryIterator = true;
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -26,7 +26,7 @@
{
public:
GwsRightSideIterator(IGWSFeatureIterator* iter, bool b):m_iterator(iter), m_bHasData(b){}
-
+
IGWSFeatureIterator * Iterator(){return m_iterator;};
bool HasData(){return m_bHasData;}
Modified: sandbox/rfc60/MgDev/Server/src/Services/Feature/TransformCache.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Feature/TransformCache.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Feature/TransformCache.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -95,7 +95,7 @@
Ptr<MgClassDefinition> classDef = svcFeature->GetClassDefinition(resId, schemaName, className, false);
Ptr<MgPropertyDefinitionCollection> propDefCol = classDef->GetProperties();
- // Find the spatial context for the geometric property. Use the first one if there are many defined.
+ // Find the spatial context for the geometric or raster property. Use the first one if there are many defined.
for(int index=0;index<propDefCol->GetCount();index++)
{
Ptr<MgPropertyDefinition> propDef = propDefCol->GetItem(index);
@@ -106,6 +106,14 @@
spatialContextAssociation = geomProp->GetSpatialContextAssociation();
break;
}
+ else if(propDef->GetPropertyType () == MgFeaturePropertyType::RasterProperty)
+ {
+ // We found the raster property
+ MgRasterPropertyDefinition* rasterProp = static_cast<MgRasterPropertyDefinition*>(propDef.p);
+ spatialContextAssociation = rasterProp->GetSpatialContextAssociation();
+ break;
+ }
+
}
// We want all of the spatial contexts
Modified: sandbox/rfc60/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Mapping/MappingUtil.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Mapping/MappingUtil.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -1430,7 +1430,6 @@
FindColorInSymDefHelper(colorList, simsym->GetSymbolDefinition());
}
}
-
}
/// overloaded helper for SymbolDefinition
inline void MgMappingUtil::FindColorInSymDefHelper(PSTRCOLORLIST colorList, MdfModel::SymbolDefinition * symdef)
Modified: sandbox/rfc60/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Resource/OpEnumerateResourceDocuments.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -67,7 +67,7 @@
STRING type;
INT32 properties;
Ptr<MgStringCollection> resources = (MgStringCollection*)m_stream->GetObject();
-
+
m_stream->GetString(type);
m_stream->GetInt32(properties);
Modified: sandbox/rfc60/MgDev/Server/src/Services/Resource/OpMoveResource.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/Resource/OpMoveResource.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/Resource/OpMoveResource.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -62,7 +62,7 @@
ACE_ASSERT(m_stream != NULL);
- if (3 == m_packet.m_NumArguments)
+ if (3 == m_packet.m_NumArguments || 4 == m_packet.m_NumArguments)
{
Ptr<MgResourceIdentifier> sourceResource =
(MgResourceIdentifier*)m_stream->GetObject();
@@ -70,6 +70,11 @@
(MgResourceIdentifier*)m_stream->GetObject();
bool overwrite;
m_stream->GetBoolean(overwrite);
+ bool cascade = false;
+ if(4 == m_packet.m_NumArguments)
+ {
+ m_stream->GetBoolean(cascade);
+ }
BeginExecution();
@@ -79,11 +84,13 @@
MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == destResource) ? L"MgResourceIdentifier" : destResource->ToString().c_str());
MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
MG_LOG_OPERATION_MESSAGE_ADD_BOOL(overwrite);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_BOOL(cascade);
MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
Validate();
- m_service->MoveResource(sourceResource, destResource, overwrite);
+ m_service->MoveResource(sourceResource, destResource, overwrite, cascade);
EndExecution();
}
Modified: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/Makefile.am
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/Makefile.am 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/Makefile.am 2009-12-11 16:29:40 UTC (rev 4411)
@@ -35,6 +35,8 @@
OpGetLogFile.cpp \
OpGetPackageLog.cpp \
OpGetPackageStatus.cpp \
+ OpGetSiteStatus.cpp \
+ OpGetSiteVersion.cpp \
OpIsMaximumLogSizeEnabled.cpp \
OpIsOnline.cpp \
OpLoadPackage.cpp \
@@ -69,6 +71,8 @@
OpGetLogFile.h \
OpGetPackageLog.h \
OpGetPackageStatus.h \
+ OpGetSiteStatus.h \
+ OpGetSiteVersion.h \
OpIsMaximumLogSizeEnabled.h \
OpIsOnline.h \
OpLoadPackage.h \
Copied: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp (from rev 4410, trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp)
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp (rev 0)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,117 @@
+//
+// Copyright (C) 2004-2009 by 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 "ServerAdminService.h"
+#include "OpGetSiteStatus.h"
+#include "LogManager.h"
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Constructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpGetSiteStatus::MgOpGetSiteStatus()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Destructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpGetSiteStatus::~MgOpGetSiteStatus()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Gets the role(s) required to perform this operation.
+/// </summary>
+///----------------------------------------------------------------------------
+MgStringCollection* MgOpGetSiteStatus::GetRoles() const
+{
+ return NULL; // for anonymous/everyone
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Executes the operation.
+/// </summary>
+///
+/// <exceptions>
+/// MgException
+/// </exceptions>
+///----------------------------------------------------------------------------
+void MgOpGetSiteStatus::Execute()
+{
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT(" (%t) MgOpGetSiteStatus::Execute()\n")));
+
+ MG_LOG_OPERATION_MESSAGE(L"MgOpGetSiteStatus");
+
+ MG_TRY()
+
+ MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+
+ ACE_ASSERT(m_stream != NULL);
+
+ if (0 == m_packet.m_NumArguments)
+ {
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ // Authentication not required for this operation
+ //Validate();
+
+ Ptr<MgPropertyCollection> propertyCollection = m_service->GetSiteStatus();
+
+ EndExecution(propertyCollection);
+ }
+ else
+ {
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+ }
+
+ if (!m_argsRead)
+ {
+ throw new MgOperationProcessingException(L"MgOpGetSiteStatus.Execute",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ // Successful operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+
+ MG_CATCH(L"MgOpGetSiteStatus.Execute")
+
+ if (mgException != NULL)
+ {
+ // Failed operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
+ }
+
+ // Add admin log entry for operation
+ MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
+
+ MG_THROW()
+}
Copied: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.h (from rev 4410, trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.h)
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.h (rev 0)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteStatus.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2004-2009 by 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 MGOPGETSITESTATUS_H_
+#define MGOPGETSITESTATUS_H_
+
+#include "ServerAdminOperation.h"
+
+class MgOpGetSiteStatus : public MgServerAdminOperation
+{
+ public:
+ MgOpGetSiteStatus();
+ virtual ~MgOpGetSiteStatus();
+
+ public:
+ virtual void Execute();
+
+ protected:
+ virtual MgStringCollection* GetRoles() const;
+};
+
+#endif
Copied: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp (from rev 4410, trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp)
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp (rev 0)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,116 @@
+//
+// Copyright (C) 2004-2009 by 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 "ServerAdminService.h"
+#include "OpGetSiteVersion.h"
+#include "LogManager.h"
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Constructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpGetSiteVersion::MgOpGetSiteVersion()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Destructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpGetSiteVersion::~MgOpGetSiteVersion()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Gets the role(s) required to perform this operation.
+/// </summary>
+///----------------------------------------------------------------------------
+MgStringCollection* MgOpGetSiteVersion::GetRoles() const
+{
+ return NULL; // for anonymous/everyone
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Executes the operation.
+/// </summary>
+///
+/// <exceptions>
+/// MgException
+/// </exceptions>
+///----------------------------------------------------------------------------
+void MgOpGetSiteVersion::Execute()
+{
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT(" (%t) MgOpGetSiteVersion::Execute()\n")));
+
+ MG_LOG_OPERATION_MESSAGE(L"MgOpGetSiteVersion");
+
+ MG_TRY()
+
+ MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+
+ ACE_ASSERT(m_stream != NULL);
+
+ if (0 == m_packet.m_NumArguments)
+ {
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ STRING version = m_service->GetSiteVersion();
+
+ EndExecution(version);
+ }
+ else
+ {
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+ }
+
+ if (!m_argsRead)
+ {
+ throw new MgOperationProcessingException(L"MgOpGetSiteVersion.Execute",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ // Successful operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+
+ MG_CATCH(L"MgOpGetSiteVersion.Execute")
+
+ if (mgException != NULL)
+ {
+ // Failed operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
+ }
+
+ // Add admin log entry for operation
+ MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
+
+ MG_THROW()
+}
Copied: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.h (from rev 4410, trunk/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.h)
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.h (rev 0)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/OpGetSiteVersion.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2004-2009 by 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 MGOPGETSITEVERSION_H_
+#define MGOPGETSITEVERSION_H_
+
+#include "ServerAdminOperation.h"
+
+class MgOpGetSiteVersion : public MgServerAdminOperation
+{
+ public:
+ MgOpGetSiteVersion();
+ virtual ~MgOpGetSiteVersion();
+
+ public:
+ virtual void Execute();
+
+ protected:
+ virtual MgStringCollection* GetRoles() const;
+};
+
+#endif
Modified: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -35,6 +35,8 @@
#include "OpGetLogFile.h"
#include "OpGetPackageLog.h"
#include "OpGetPackageStatus.h"
+#include "OpGetSiteStatus.h"
+#include "OpGetSiteVersion.h"
#include "OpIsMaximumLogSizeEnabled.h"
#include "OpIsOnline.h"
#include "OpLoadPackage.h"
@@ -301,6 +303,28 @@
}
break;
+ case MgServerAdminServiceOpId::GetSiteVersion:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(1,0): // Original 1.0 operation actually called GetInformationProperties
+ handler.reset(new MgOpGetSiteVersion());
+ break;
+ default:
+ break;
+ }
+ break;
+
+ case MgServerAdminServiceOpId::GetSiteStatus:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(2,2):
+ handler.reset(new MgOpGetSiteStatus());
+ break;
+ default:
+ break;
+ }
+ break;
+
case MgServerAdminServiceOpId::RegisterServicesOnServers :
switch (VERSION_NO_PHASE(operationVersion))
{
Modified: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -550,6 +550,57 @@
return pProperties.Detach();
}
+//////////////////////////////////////////////////////////////////
+/// <summary>
+/// Gets the site version.
+/// </summary>
+STRING MgServerAdminService::GetSiteVersion()
+{
+ STRING version = L"";
+
+ MG_TRY()
+
+ MG_LOG_TRACE_ENTRY(L"MgServerAdminService::GetSiteVersion()");
+
+ MgServerManager* pMan = MgServerManager::GetInstance();
+ if (NULL == pMan)
+ {
+ throw new MgNullReferenceException(L"MgServerAdminService::GetSiteVersion", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ version = pMan->GetSiteVersion();
+
+ MG_CATCH_AND_THROW(L"MgServerAdminService.GetSiteVersion");
+
+ return version;
+}
+
+//////////////////////////////////////////////////////////////////
+/// <summary>
+/// Gets the status properties for the server.
+/// </summary>
+MgPropertyCollection* MgServerAdminService::GetSiteStatus()
+{
+ Ptr<MgPropertyCollection> pProperties;
+ pProperties = NULL;
+
+ MG_TRY()
+
+ MG_LOG_TRACE_ENTRY(L"MgServerAdminService::GetSiteStatus()");
+
+ MgServerManager* pMan = MgServerManager::GetInstance();
+ if (NULL == pMan)
+ {
+ throw new MgNullReferenceException(L"MgServerAdminService::GetSiteStatus", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ pProperties = pMan->GetSiteStatus();
+
+ MG_CATCH_AND_THROW(L"MgServerAdminService.GetSiteStatus");
+
+ return pProperties.Detach();
+}
+
///----------------------------------------------------------------------------
/// <summary>
/// Registers services on the specified servers.
Modified: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -62,6 +62,8 @@
void SetDocument(CREFSTRING identifier, MgByteReader* data);
MgPropertyCollection* GetInformationProperties();
+ MgPropertyCollection* GetSiteStatus();
+ STRING GetSiteVersion();
// Service Management Methods
Modified: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -951,6 +951,86 @@
>
</File>
<File
+ RelativePath=".\OpGetSiteStatus.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\OpGetSiteStatus.h"
+ >
+ </File>
+ <File
+ RelativePath=".\OpGetSiteVersion.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\OpGetSiteVersion.h"
+ >
+ </File>
+ <File
RelativePath=".\OpIsMaximumLogSizeEnabled.cpp"
>
<FileConfiguration
Modified: sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp
===================================================================
--- sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -32,6 +32,8 @@
#include "OpGetLogFile.cpp"
#include "OpGetPackageLog.cpp"
#include "OpGetPackageStatus.cpp"
+#include "OpGetSiteStatus.cpp"
+#include "OpGetSiteVersion.cpp"
#include "OpIsOnline.cpp"
#include "OpIsMaximumLogSizeEnabled.cpp"
#include "OpLoadPackage.cpp"
Modified: sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html
===================================================================
--- sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html 2009-12-11 16:29:40 UTC (rev 4411)
@@ -13,7 +13,7 @@
<b>Operation:</b>
<input type="text" name="OPERATION" value="GETSITEINFO" size="50" ID="Text1">
<p> Version:
- <input type="text" name="VERSION" value="1.0.0" size="10" ID="Text2">
+ <input type="text" name="VERSION" value="2.2.0" size="10" ID="Text2">
<p> Locale:
<input type="text" name="LOCALE" value="en" size="10" ID="Text4">
<p> Client Agent:
Copied: sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html (from rev 4410, trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html)
===================================================================
--- sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html (rev 0)
+++ sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+ <head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
+ <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
+ <script type="text/javascript" src="setactiontarget.js" >
+ </script>
+ </head>
+ <body>
+ <form name="input" action="" method="get" ID="Form1">
+ <b>Operation:</b>
+ <input type="text" name="OPERATION" value="GETSITESTATUS" size="50" ID="Text1">
+ <p> Version:
+ <input type="text" name="VERSION" value="2.1.0" size="10" ID="Text2">
+ <p> Locale:
+ <input type="text" name="LOCALE" value="en" size="10" ID="Text4">
+ <p> Client Agent:
+ <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+ <p>
+ <input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
+ </form>
+ </body>
+</html>
Modified: sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html
===================================================================
--- sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html 2009-12-11 16:29:40 UTC (rev 4411)
@@ -13,7 +13,7 @@
<b>Operation:</b>
<input type="text" name="OPERATION" value="GETSITEVERSION" size="50" ID="Text1">
<p> Version:
- <input type="text" name="VERSION" value="1.0.0" size="10" ID="Text2">
+ <input type="text" name="VERSION" value="2.2.0" size="10" ID="Text2">
<p> Locale:
<input type="text" name="LOCALE" value="en" size="10" ID="Text4">
<p> Client Agent:
Modified: sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/siteserviceapi.html
===================================================================
--- sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/siteserviceapi.html 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/siteserviceapi.html 2009-12-11 16:29:40 UTC (rev 4411)
@@ -10,8 +10,9 @@
<ul>
<li><a href="enumerateusersform.html" target="showform">EnumerateUsers</a>
<li><a href="enumerategroupsform.html" target="showform">EnumerateGroups</a>
+<li><a href="getsiteinfoform.html" target="showform">GetSiteInfo</a>
+<li><a href="getsitestatusform.html" target="showform">GetSiteStatus</a>
<li><a href="getsiteversionform.html" target="showform">GetSiteVersion</a>
-<li><a href="getsiteinfoform.html" target="showform">GetSiteInfo</a>
</ul>
</body>
Modified: sandbox/rfc60/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -202,6 +202,13 @@
if (!bValid)
bValid = params->GetXmlPostData().length() != 0;
+ // Certain operations do not require authentication
+ STRING operation = params->GetParameterValue(L"OPERATION");
+ if((_wcsicmp(operation.c_str(), L"GETSITESTATUS") == 0))
+ {
+ bValid = true;
+ }
+
if (!bValid)
{
// Invalid authentication information is not fatal, we should continue.
Modified: sandbox/rfc60/MgDev/Web/src/CgiAgent/CgiAgent.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/CgiAgent/CgiAgent.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/CgiAgent/CgiAgent.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -210,6 +210,13 @@
if (!bValid)
bValid = params->GetXmlPostData().length() != 0;
+ // Certain operations do not require authentication
+ STRING operation = params->GetParameterValue(L"OPERATION");
+ if((_wcsicmp(operation.c_str(), L"GETSITESTATUS") == 0))
+ {
+ bValid = true;
+ }
+
if (!bValid)
{
// Invalid authentication information is not fatal, we should continue.
Modified: sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml
===================================================================
--- sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -85,79 +85,79 @@
-->
<Headers>
- <!-- MapGuideCommon classes -->
+ <!-- MapGuideCommon classes -->
- <Header path="../../../../Common/MapGuideCommon/Exception/AuthenticationFailedException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionFailedException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionNotOpenException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DbException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DbXmlException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateGroupException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateNameException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateParameterException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRepositoryException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRoleException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateServerException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateSessionException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateUserException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DwfException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionResourceNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/EndOfStreamException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/GroupNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfPackageException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfSectionException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidFeatureSourceException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidIpAddressException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLicenseException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLogEntryException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPasswordException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutPositionUnitsException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutSizeUnitsException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/InvalidServerNameException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/LicenseException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/LicenseExpiredException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/OperationProcessingException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/ParameterNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/PathTooLongException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/PortNotAvailableException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/PrintToScaleModeNotSelectedException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryCreationFailedException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotOpenException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryOpenFailedException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/RoleNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotOnlineException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/SessionExpiredException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/SessionNotFoundException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/UnauthorizedAccessException.h" />
- <Header path="../../../../Common/MapGuideCommon/Exception/UriFormatException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/AuthenticationFailedException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionFailedException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionNotOpenException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DbException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DbXmlException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateGroupException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateNameException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateParameterException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRepositoryException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRoleException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateServerException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateSessionException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateUserException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DwfException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionResourceNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/EndOfStreamException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/GroupNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfPackageException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfSectionException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidFeatureSourceException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidIpAddressException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLicenseException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLogEntryException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPasswordException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutPositionUnitsException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutSizeUnitsException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/InvalidServerNameException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/LicenseException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/LicenseExpiredException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/OperationProcessingException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/ParameterNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/PathTooLongException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/PortNotAvailableException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/PrintToScaleModeNotSelectedException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryCreationFailedException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotOpenException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryOpenFailedException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/RoleNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotOnlineException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/SessionExpiredException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/SessionNotFoundException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/UnauthorizedAccessException.h" />
+ <Header path="../../../../Common/MapGuideCommon/Exception/UriFormatException.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/DrawingService.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/DwfVersion.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/FeatureInformation.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/KmlService.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/Layout.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/MappingService.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/MapPlot.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/MapPlotCollection.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/PackageStatusInformation.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/PlotSpecification.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/RenderingOptions.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/RenderingService.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/ServerAdmin.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/Site.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/SiteConnection.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/SiteInfo.h" />
- <Header path="../../../../Common/MapGuideCommon/Services/TileService.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/DrawingService.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/DwfVersion.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/FeatureInformation.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/KmlService.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/Layout.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/MappingService.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/MapPlot.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/MapPlotCollection.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/PackageStatusInformation.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/PlotSpecification.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/RenderingOptions.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/RenderingService.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/ServerAdmin.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/Site.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/SiteConnection.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/SiteInfo.h" />
+ <Header path="../../../../Common/MapGuideCommon/Services/TileService.h" />
- <Header path="../../../../Common/MapGuideCommon/System/UserInformation.h" />
+ <Header path="../../../../Common/MapGuideCommon/System/UserInformation.h" />
- <Header path="../../../../Common/MapGuideCommon/MapLayer/Layer.h" />
- <Header path="../../../../Common/MapGuideCommon/MapLayer/Map.h" />
- <Header path="../../../../Common/MapGuideCommon/MapLayer/Selection.h" />
+ <Header path="../../../../Common/MapGuideCommon/MapLayer/Layer.h" />
+ <Header path="../../../../Common/MapGuideCommon/MapLayer/Map.h" />
+ <Header path="../../../../Common/MapGuideCommon/MapLayer/Selection.h" />
</Headers>
Modified: sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/Web/WebApiGen.xml
===================================================================
--- sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/Web/WebApiGen.xml 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/DotNetUnmanagedApi/Web/WebApiGen.xml 2009-12-11 16:29:40 UTC (rev 4411)
@@ -96,46 +96,46 @@
-->
<Headers>
- <!-- WebApp classes -->
+ <!-- WebApp classes -->
- <Header path="../../WebApp/WebCommand.h" />
- <Header path="../../WebApp/WebUiTargetCommand.h" />
- <Header path="../../WebApp/WebWidget.h" />
- <Header path="../../WebApp/WebWidgetCollection.h" />
- <Header path="../../WebApp/WebUiPane.h" />
- <Header path="../../WebApp/WebUiSizablePane.h" />
+ <Header path="../../WebApp/WebCommand.h" />
+ <Header path="../../WebApp/WebUiTargetCommand.h" />
+ <Header path="../../WebApp/WebWidget.h" />
+ <Header path="../../WebApp/WebWidgetCollection.h" />
+ <Header path="../../WebApp/WebUiPane.h" />
+ <Header path="../../WebApp/WebUiSizablePane.h" />
- <Header path="../../WebApp/WebBufferCommand.h" />
- <Header path="../../WebApp/WebCommandCollection.h" />
- <Header path="../../WebApp/WebCommandWidget.h" />
- <Header path="../../WebApp/WebContextMenu.h" />
- <Header path="../../WebApp/WebFlyoutWidget.h" />
- <Header path="../../WebApp/WebGetPrintablePageCommand.h" />
- <Header path="../../WebApp/WebHelpCommand.h" />
- <Header path="../../WebApp/WebInformationPane.h" />
- <Header path="../../WebApp/WebInvokeScriptCommand.h" />
- <Header path="../../WebApp/WebInvokeUrlCommand.h" />
- <Header path="../../WebApp/WebLayout.h" />
- <Header path="../../WebApp/WebMeasureCommand.h" />
- <Header path="../../WebApp/WebPrintCommand.h" />
- <Header path="../../WebApp/WebSearchCommand.h" />
- <Header path="../../WebApp/WebSelectWithinCommand.h" />
- <Header path="../../WebApp/WebSeparatorWidget.h" />
- <Header path="../../WebApp/WebTaskBar.h" />
- <Header path="../../WebApp/WebTaskBarWidget.h" />
- <Header path="../../WebApp/WebTaskPane.h" />
- <Header path="../../WebApp/WebToolbar.h" />
- <Header path="../../WebApp/WebViewOptionsCommand.h" />
+ <Header path="../../WebApp/WebBufferCommand.h" />
+ <Header path="../../WebApp/WebCommandCollection.h" />
+ <Header path="../../WebApp/WebCommandWidget.h" />
+ <Header path="../../WebApp/WebContextMenu.h" />
+ <Header path="../../WebApp/WebFlyoutWidget.h" />
+ <Header path="../../WebApp/WebGetPrintablePageCommand.h" />
+ <Header path="../../WebApp/WebHelpCommand.h" />
+ <Header path="../../WebApp/WebInformationPane.h" />
+ <Header path="../../WebApp/WebInvokeScriptCommand.h" />
+ <Header path="../../WebApp/WebInvokeUrlCommand.h" />
+ <Header path="../../WebApp/WebLayout.h" />
+ <Header path="../../WebApp/WebMeasureCommand.h" />
+ <Header path="../../WebApp/WebPrintCommand.h" />
+ <Header path="../../WebApp/WebSearchCommand.h" />
+ <Header path="../../WebApp/WebSelectWithinCommand.h" />
+ <Header path="../../WebApp/WebSeparatorWidget.h" />
+ <Header path="../../WebApp/WebTaskBar.h" />
+ <Header path="../../WebApp/WebTaskBarWidget.h" />
+ <Header path="../../WebApp/WebTaskPane.h" />
+ <Header path="../../WebApp/WebToolbar.h" />
+ <Header path="../../WebApp/WebViewOptionsCommand.h" />
- <!-- HttpHandler classes -->
+ <!-- HttpHandler classes -->
- <Header path="../../HttpHandler/HttpHeader.h" />
- <Header path="../../HttpHandler/HttpPrimitiveValue.h" />
- <Header path="../../HttpHandler/HttpRequest.h" />
- <Header path="../../HttpHandler/HttpRequestMetadata.h" />
- <Header path="../../HttpHandler/HttpRequestParam.h" />
- <Header path="../../HttpHandler/HttpResponse.h" />
- <Header path="../../HttpHandler/HttpResult.h" />
+ <Header path="../../HttpHandler/HttpHeader.h" />
+ <Header path="../../HttpHandler/HttpPrimitiveValue.h" />
+ <Header path="../../HttpHandler/HttpRequest.h" />
+ <Header path="../../HttpHandler/HttpRequestMetadata.h" />
+ <Header path="../../HttpHandler/HttpRequestParam.h" />
+ <Header path="../../HttpHandler/HttpResponse.h" />
+ <Header path="../../HttpHandler/HttpResult.h" />
</Headers>
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -52,14 +52,79 @@
// Check common parameters
ValidateCommonParameters();
- // Create ServerAdmin object
- Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
- serverAdmin->Open(m_userInfo);
+ STRING xml;
+ xml += BeginXml();
- // call the C++ APIs
- Ptr<MgPropertyCollection> properties = serverAdmin->GetInformationProperties();
- STRING xml = GetXml(properties);
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ MgSiteManager* siteManager = MgSiteManager::GetInstance();
+ if(siteManager)
+ {
+ MgSiteVector* sites = siteManager->GetSites();
+ if(sites)
+ {
+ for(size_t i=0;i<sites->size();i++)
+ {
+ MgSiteInfo* siteInfo = sites->at(i);
+ // Check the server status - though this status could be out of date and an exception might be thrown
+ bool bHaveSiteInfo = false;
+ STRING message = MgResources::Unknown;
+
+ if (MgSiteInfo::Ok == siteInfo->GetStatus())
+ {
+ MG_HTTP_HANDLER_TRY()
+
+ // Create ServerAdmin object
+ Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
+ serverAdmin->Open(siteInfo->GetTarget(), m_userInfo);
+
+ // call the C++ APIs
+ Ptr<MgPropertyCollection> properties = serverAdmin->GetInformationProperties();
+ xml += GetXml(properties);
+ bHaveSiteInfo = true;
+
+ MG_HTTP_HANDLER_CATCH(L"MgHttpGetSiteInfo.Execute")
+ if (mgException != NULL)
+ {
+ message = mgException->GetMessage();
+ }
+ }
+
+ if(!bHaveSiteInfo)
+ {
+ // This server is not available
+ xml += L"\t<Server>\n";
+
+ xml += L"\t\t<IpAddress>";
+ xml += siteInfo->GetTarget();
+ xml += L"</IpAddress>\n";
+ xml += L"\t\t<DisplayName></DisplayName>\n";
+ xml += L"\t\t<Status>";
+ xml += message;
+ xml += L"</Status>\n";
+ xml += L"\t\t<Version></Version>\n";
+ xml += L"\t\t<OperatingSystem></OperatingSystem>\n";
+ xml += L"\t\t<Statistics></Statistics>\n";
+
+ xml += L"\t</Server>\n";
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // Create ServerAdmin object
+ Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
+ serverAdmin->Open(m_userInfo);
+
+ // call the C++ APIs
+ Ptr<MgPropertyCollection> properties = serverAdmin->GetInformationProperties();
+ xml += GetXml(properties);
+ }
+ xml += EndXml();
+
Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(xml);
if(!value)
throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -69,6 +134,32 @@
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetSiteInfo.Execute")
}
+STRING MgHttpGetSiteInfo::BeginXml()
+{
+ STRING xml = L"";
+
+ xml += L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"<SiteInformation xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteInformation-2.2.0.xsd\">\n";
+ }
+ else
+ {
+ xml += L"<SiteInformation xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteInformation-1.0.0.xsd\">\n";
+ }
+
+ return xml;
+}
+
+STRING MgHttpGetSiteInfo::EndXml()
+{
+ STRING xml = L"";
+
+ xml = L"</SiteInformation>\n";
+
+ return xml;
+}
+
STRING MgHttpGetSiteInfo::GetXml(MgPropertyCollection* properties)
{
STRING xml;
@@ -78,11 +169,23 @@
Ptr<MgInt32Property> int32Prop;
Ptr<MgBooleanProperty> boolProp;
- // this XML follows the SiteInformation-1.0.0.xsd schema
- xml += L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- xml += L"<SiteInformation xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteInformation-1.0.0.xsd\">\n";
- xml += L"\t<SiteServer>\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t<Server>\n";
+ }
+ else
+ {
+ xml += L"\t<SiteServer>\n";
+ }
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t\t<IpAddress>";
+ strProp = (MgStringProperty*)properties->GetItem(MgServerInformationProperties::MachineIp);
+ xml += strProp->GetValue();
+ xml += L"</IpAddress>\n";
+ }
+
xml += L"\t\t<DisplayName>";
strProp = (MgStringProperty*)properties->GetItem(MgServerInformationProperties::DisplayName);
xml += strProp->GetValue();
@@ -131,7 +234,10 @@
xml += L"\t\t</OperatingSystem>\n";
- xml += L"\t</SiteServer>\n";
+ if (m_userInfo->GetApiVersion() == MG_API_VERSION(1,0,0))
+ {
+ xml += L"\t</SiteServer>\n";
+ }
xml += L"\t<Statistics>\n";
@@ -165,6 +271,21 @@
xml += MgUtil::MultiByteToWideChar(tmpStr);
xml += L"</CpuUtilization>\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t\t<WorkingSet>";
+ int64Prop = (MgInt64Property*)properties->GetItem(MgServerInformationProperties::WorkingSet);
+ MgUtil::Int64ToString(int64Prop->GetValue(), tmpStr);
+ xml += MgUtil::MultiByteToWideChar(tmpStr);
+ xml += L"</WorkingSet>\n";
+
+ xml += L"\t\t<VirtualMemory>";
+ int64Prop = (MgInt64Property*)properties->GetItem(MgServerInformationProperties::VirtualMemory);
+ MgUtil::Int64ToString(int64Prop->GetValue(), tmpStr);
+ xml += MgUtil::MultiByteToWideChar(tmpStr);
+ xml += L"</VirtualMemory>\n";
+ }
+
xml += L"\t\t<TotalOperationTime>";
int32Prop = (MgInt32Property*)properties->GetItem(MgServerInformationProperties::TotalOperationTime);
MgUtil::Int32ToString(int32Prop->GetValue(), tmpStr);
@@ -201,9 +322,27 @@
xml += MgUtil::MultiByteToWideChar(tmpStr);
xml += L"</Uptime>\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t\t<CacheSize>";
+ int32Prop = (MgInt32Property*)properties->GetItem(MgServerInformationProperties::CacheSize);
+ MgUtil::Int32ToString(int32Prop->GetValue(), tmpStr);
+ xml += MgUtil::MultiByteToWideChar(tmpStr);
+ xml += L"</CacheSize>\n";
+
+ xml += L"\t\t<CacheDroppedEntries>";
+ int32Prop = (MgInt32Property*)properties->GetItem(MgServerInformationProperties::CacheDroppedEntries);
+ MgUtil::Int32ToString(int32Prop->GetValue(), tmpStr);
+ xml += MgUtil::MultiByteToWideChar(tmpStr);
+ xml += L"</CacheDroppedEntries>\n";
+ }
+
xml += L"\t</Statistics>\n";
- xml += L"</SiteInformation>\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t</Server>\n";
+ }
return xml;
}
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.h
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -46,6 +46,8 @@
private:
STRING GetXml(MgPropertyCollection* properties);
+ STRING BeginXml();
+ STRING EndXml();
};
#endif
Copied: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp (from rev 4410, trunk/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp)
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp (rev 0)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,163 @@
+//
+// Copyright (C) 2004-2009 by 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 "HttpHandler.h"
+#include "HttpGetSiteStatus.h"
+
+HTTP_IMPLEMENT_CREATE_OBJECT(MgHttpGetSiteStatus)
+
+/// <summary>
+/// Initializes the common parameters and parameters specific to this request.
+/// </summary>
+/// <param name="name">Input
+/// MgHttpRequest
+/// This contains all the parameters of the request.
+/// </param>
+/// <returns>
+/// nothing
+/// </returns>
+MgHttpGetSiteStatus::MgHttpGetSiteStatus(MgHttpRequest *hRequest)
+{
+ InitializeCommonParameters(hRequest);
+}
+
+/// <summary>
+/// Executes the specific request.
+/// </summary>
+/// <returns>
+/// MgHttpResponse
+/// This contains the response (including MgHttpResult and StatusCode) from the server.
+/// </returns>
+void MgHttpGetSiteStatus::Execute(MgHttpResponse& hResponse)
+{
+ Ptr<MgHttpResult> hResult = hResponse.GetResult();
+
+ MG_HTTP_HANDLER_TRY()
+
+ // Check common parameters
+ ValidateCommonParameters();
+
+ STRING xml = BeginXml();
+
+ MgSiteManager* siteManager = MgSiteManager::GetInstance();
+ if(siteManager)
+ {
+ MgSiteVector* sites = siteManager->GetSites();
+ if(sites)
+ {
+ for(size_t i=0;i<sites->size();i++)
+ {
+ MgSiteInfo* siteInfo = sites->at(i);
+
+ // Check the server status - though this status could be out of date and an exception might be thrown
+ bool bHaveSiteStatus = false;
+ STRING message = MgResources::Unknown;
+
+ if (MgSiteInfo::Ok == siteInfo->GetStatus())
+ {
+ MG_HTTP_HANDLER_TRY()
+ // Create ServerAdmin object
+ Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
+ serverAdmin->Open(siteInfo->GetTarget(), m_userInfo);
+
+ // call the C++ APIs
+ Ptr<MgPropertyCollection> properties = serverAdmin->GetSiteStatus();
+ xml += GetXml(properties);
+ bHaveSiteStatus = true;
+
+ MG_HTTP_HANDLER_CATCH(L"MgHttpGetSiteStatus.Execute")
+ if (mgException != NULL)
+ {
+ message = mgException->GetMessage();
+ }
+ }
+
+ if(!bHaveSiteStatus)
+ {
+ // This server is not available
+ xml += L"\t<Server>\n";
+
+ xml += L"\t\t<DisplayName></DisplayName>\n";
+ xml += L"\t\t<Status>";
+ xml += message;
+ xml += L"</Status>\n";
+ xml += L"\t\t<ApiVersion></ApiVersion>\n";
+
+ xml += L"\t</Server>\n";
+ }
+ }
+ }
+ }
+
+ xml += EndXml();
+
+ Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(xml);
+ if(!value)
+ throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+
+ hResult->SetResultObject(value, MgMimeType::Xml);
+
+ MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetSiteStatus.Execute")
+}
+
+STRING MgHttpGetSiteStatus::BeginXml()
+{
+ STRING xml = L"";
+
+ // this XML follows the SiteStatus-2.2.0.xsd schema
+ xml += L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ xml += L"<SiteStatus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteStatus-2.2.0.xsd\">\n";
+
+ return xml;
+}
+
+STRING MgHttpGetSiteStatus::EndXml()
+{
+ STRING xml = L"";
+
+ xml = L"</SiteStatus>\n";
+
+ return xml;
+}
+
+STRING MgHttpGetSiteStatus::GetXml(MgPropertyCollection* properties)
+{
+ STRING xml = L"";
+ Ptr<MgStringProperty> strProp;
+ Ptr<MgBooleanProperty> boolProp;
+
+ xml += L"\t<Server>\n";
+
+ xml += L"\t\t<DisplayName>";
+ strProp = (MgStringProperty*)properties->GetItem(MgServerInformationProperties::DisplayName);
+ xml += strProp->GetValue();
+ xml += L"</DisplayName>\n";
+
+ xml += L"\t\t<Status>";
+ boolProp = (MgBooleanProperty*)properties->GetItem(MgServerInformationProperties::Status);
+ xml += boolProp->GetValue() ? L"Online" : L"Offline";
+ xml += L"</Status>\n";
+
+ xml += L"\t\t<ApiVersion>";
+ strProp = (MgStringProperty*)properties->GetItem(MgServerInformationProperties::ApiVersion);
+ xml += strProp->GetValue();
+ xml += L"</ApiVersion>\n";
+
+ xml += L"\t</Server>\n";
+
+ return xml;
+}
Copied: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.h (from rev 4410, trunk/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.h)
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.h (rev 0)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -0,0 +1,52 @@
+//
+// Copyright (C) 2004-2009 by 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 _S_GET_SITE_STATUS_H
+#define _S_GET_SITE_STATUS_H
+
+class MgHttpGetSiteStatus : public MgHttpRequestResponseHandler
+{
+HTTP_DECLARE_CREATE_OBJECT()
+
+public:
+ /// <summary>
+ /// Initializes the common parameters of the request.
+ /// </summary>
+ /// <param name="name">Input
+ /// MgHttpRequest
+ /// This contains all the parameters of the request.
+ /// </param>
+ /// <returns>
+ /// nothing
+ /// </returns>
+ MgHttpGetSiteStatus(MgHttpRequest *hRequest);
+
+ /// <summary>
+ /// Executes the specific request.
+ /// </summary>
+ /// <param name="hResponse">Input
+ /// This contains the response (including MgHttpResult and StatusCode) from the server.
+ /// </param>
+ void Execute(MgHttpResponse& hResponse);
+
+private:
+ STRING GetXml(MgPropertyCollection* properties);
+ STRING BeginXml();
+ STRING EndXml();
+};
+
+#endif
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -51,14 +51,72 @@
// Check common parameters
ValidateCommonParameters();
- // Create ServerAdmin object
- Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
- serverAdmin->Open(m_userInfo);
+ STRING xml;
+ xml += BeginXml();
- // call the C++ APIs
- Ptr<MgPropertyCollection> properties = serverAdmin->GetInformationProperties();
- STRING xml = GetXml(properties);
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ MgSiteManager* siteManager = MgSiteManager::GetInstance();
+ if(siteManager)
+ {
+ MgSiteVector* sites = siteManager->GetSites();
+ if(sites)
+ {
+ for(size_t i=0;i<sites->size();i++)
+ {
+ MgSiteInfo* siteInfo = sites->at(i);
+ // Check the server status - though this status could be out of date and an exception might be thrown
+ bool bHaveSiteVersion = false;
+ STRING message = MgResources::Unknown;
+
+ if (MgSiteInfo::Ok == siteInfo->GetStatus())
+ {
+ MG_HTTP_HANDLER_TRY()
+
+ // Create ServerAdmin object
+ Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
+ serverAdmin->Open(siteInfo->GetTarget(), m_userInfo);
+
+ // call the C++ APIs
+ STRING version = serverAdmin->GetSiteVersion();
+ xml += GetXml(version);
+ bHaveSiteVersion = true;
+
+ MG_HTTP_HANDLER_CATCH(L"MgHttpGetSiteInfo.Execute")
+ if (mgException != NULL)
+ {
+ message = mgException->GetMessage();
+ }
+ }
+
+ if(!bHaveSiteVersion)
+ {
+ // This server is not available
+ xml += L"\t<Server>\n";
+
+ xml += L"\t\t<Version>";
+ xml += message;
+ xml += L"</Version>\n";
+
+ xml += L"\t</Server>\n";
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // Create ServerAdmin object
+ Ptr<MgServerAdmin> serverAdmin = new MgServerAdmin();
+ serverAdmin->Open(m_userInfo);
+
+ // call the C++ APIs
+ STRING version = serverAdmin->GetSiteVersion();
+ xml += GetXml(version);
+ }
+ xml += EndXml();
+
Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(xml);
if(!value)
throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -68,18 +126,49 @@
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetSiteVersion.Execute")
}
-STRING MgHttpGetSiteVersion::GetXml(MgPropertyCollection* properties)
+STRING MgHttpGetSiteVersion::BeginXml()
{
- Ptr<MgStringProperty> property = (MgStringProperty*)properties->GetItem(L"ServerVersion");
STRING xml = L"";
- // this XML follows the SiteVersion-1.0.0.xsd schema
xml += L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- xml += L"<SiteVersion xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteVersion-1.0.0.xsd\">\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"<SiteVersion xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteVersion-2.2.0.xsd\">\n";
+ }
+ else
+ {
+ xml += L"<SiteVersion xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SiteVersion-1.0.0.xsd\">\n";
+ }
+
+ return xml;
+}
+
+STRING MgHttpGetSiteVersion::EndXml()
+{
+ STRING xml = L"";
+
+ xml += L"</SiteVersion>\n";
+
+ return xml;
+}
+
+STRING MgHttpGetSiteVersion::GetXml(CREFSTRING version)
+{
+ STRING xml = L"";
+
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t<Server>\n";
+ }
+
xml += L"\t<Version>";
- xml += property->GetValue();
+ xml += version;
xml += L"</Version>\n";
- xml += L"</SiteVersion>\n";
+ if (m_userInfo->GetApiVersion() >= MG_API_VERSION(2,2,0))
+ {
+ xml += L"\t</Server>\n";
+ }
+
return xml;
}
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.h
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -44,7 +44,9 @@
void Execute(MgHttpResponse& hResponse);
private:
- STRING GetXml(MgPropertyCollection* properties);
+ STRING GetXml(CREFSTRING version);
+ STRING BeginXml();
+ STRING EndXml();
};
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandler.vcproj
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandler.vcproj 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandler.vcproj 2009-12-11 16:29:40 UTC (rev 4411)
@@ -2723,6 +2723,46 @@
>
</File>
<File
+ RelativePath=".\HttpGetSiteStatus.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\HttpGetSiteStatus.h"
+ >
+ </File>
+ <File
RelativePath=".\HttpGetSiteVersion.cpp"
>
<FileConfiguration
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -85,6 +85,7 @@
#include "HttpGetIdentityProperties.cpp"
#include "HttpGetSchemaMapping.cpp"
#include "HttpGetSiteInfo.cpp"
+#include "HttpGetSiteStatus.cpp"
#include "HttpGetSiteVersion.cpp"
#include "HttpGetSpatialContexts.cpp"
#include "HttpGetTileImage.cpp"
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpRequest.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpRequest.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpRequest.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -353,6 +353,7 @@
httpClassCreators[MgHttpResourceStrings::opEnumerateGroups] = MgHttpEnumerateGroups::CreateObject;
httpClassCreators[MgHttpResourceStrings::opGetSiteVersion] = MgHttpGetSiteVersion::CreateObject;
httpClassCreators[MgHttpResourceStrings::opGetSiteInfo] = MgHttpGetSiteInfo::CreateObject;
+ httpClassCreators[MgHttpResourceStrings::opGetSiteStatus] = MgHttpGetSiteStatus::CreateObject;
httpClassCreators[MgHttpResourceStrings::opGetDrawingCoordinateSpace] = MgHttpGetDrawingCoordinateSpace::CreateObject;
httpClassCreators[MgHttpResourceStrings::opCreateSession] = MgHttpCreateSession::CreateObject;
httpClassCreators[MgHttpResourceStrings::opGetSessionTimeout] = MgHttpGetSessionTimeout::CreateObject;
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -322,6 +322,7 @@
const STRING MgHttpResourceStrings::opEnumerateGroups = L"ENUMERATEGROUPS";
const STRING MgHttpResourceStrings::opGetSiteVersion = L"GETSITEVERSION";
const STRING MgHttpResourceStrings::opGetSiteInfo = L"GETSITEINFO";
+const STRING MgHttpResourceStrings::opGetSiteStatus = L"GETSITESTATUS";
// Other requests
const STRING MgHttpResourceStrings::opCreateSession = L"CREATESESSION";
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.h 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/HttpResourceStrings.h 2009-12-11 16:29:40 UTC (rev 4411)
@@ -327,6 +327,7 @@
static const STRING opEnumerateGroups;
static const STRING opGetSiteVersion;
static const STRING opGetSiteInfo;
+ static const STRING opGetSiteStatus;
// Other requests
static const STRING opCreateSession;
Modified: sandbox/rfc60/MgDev/Web/src/HttpHandler/Makefile.am
===================================================================
--- sandbox/rfc60/MgDev/Web/src/HttpHandler/Makefile.am 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/HttpHandler/Makefile.am 2009-12-11 16:29:40 UTC (rev 4411)
@@ -86,6 +86,7 @@
HttpGetSessionTimeout.cpp \
HttpGetSiteInfo.cpp \
HttpGetSiteVersion.cpp \
+ HttpGetSiteStatus.cpp \
HttpGetSpatialContexts.cpp \
HttpGetTileImage.cpp \
HttpGetVisibleMapExtent.cpp \
@@ -207,6 +208,7 @@
HttpGetSessionTimeout.h \
HttpGetSiteInfo.h \
HttpGetSiteVersion.h \
+ HttpGetSiteStatus.h \
HttpGetSpatialContexts.h \
HttpGetTileImage.h \
HttpGetVisibleMapExtent.h \
Modified: sandbox/rfc60/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp
===================================================================
--- sandbox/rfc60/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp 2009-12-11 16:29:40 UTC (rev 4411)
@@ -169,6 +169,13 @@
if (!bValid)
bValid = params->GetXmlPostData().length() != 0;
+ // Certain operations do not require authentication
+ STRING operation = params->GetParameterValue(L"OPERATION");
+ if((_wcsicmp(operation.c_str(), L"GETSITESTATUS") == 0))
+ {
+ bValid = true;
+ }
+
if (!bValid)
{
// Invalid authentication information is not fatal, we should continue.
Modified: sandbox/rfc60/MgDev/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- sandbox/rfc60/MgDev/Web/src/viewerfiles/ajaxmappane.templ 2009-12-11 03:09:47 UTC (rev 4410)
+++ sandbox/rfc60/MgDev/Web/src/viewerfiles/ajaxmappane.templ 2009-12-11 16:29:40 UTC (rev 4411)
@@ -1737,7 +1737,7 @@
url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=PNG&VERSION=2.1.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random() + "&CLIENTAGENT=" + encodeComponent(clientAgent) + "&BEHAVIOR=2";
url += viewParams;
document.getElementById("overlay").innerHTML =
- '<img class="mapImage" name="' + reqId + '" id="mapImage" src="' + url + '" width=' + mapDevW + ' height=' + mapDevH + ' border=0 vspace=0 hspace=0 style="visibility: hidden; width: ' + mapDevW + 'px; height: ' + mapDevH + 'px;" onload="return OnMapOverlayImageLoaded(event)">';
+ '<img class="mapImage" name="' + reqId + '" id="mapImage" src="' + url + '" width=' + mapDevW + ' height=' + mapDevH + ' border=0 vspace=0 hspace=0 style="visibility: hidden; width: ' + mapDevW + 'px; height: ' + mapDevH + 'px;" onload="return OnMapOverlayImageLoaded(event)" onerror="return OnMapOverlayImageLoadedError(event)">';
if (opera)
document.getElementById("mapImage").src = document.getElementById("mapImage").src;
}
@@ -1747,7 +1747,7 @@
url = webAgent + "?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FORMAT=PNG&VERSION=2.1.0&SESSION=" + sessionId + "&MAPNAME=" + encodeComponent(mapName) + "&SEQ=" + Math.random() + "&CLIENTAGENT=" + encodeComponent(clientAgent) + "&BEHAVIOR=5&SELECTIONCOLOR=" + selectionColor;
url += viewParams;
document.getElementById('selOverlay').innerHTML =
- '<img class="mapImage" name="' + reqId + '" id="selectionImage" src="' + url + '" width=' + mapDevW + ' height=' + mapDevH + ' border=0 vspace=0 hspace=0 style="visibility: hidden; width: ' + mapDevW + 'px; height: ' + mapDevH + 'px;" onload="return OnSelectionOverlayImageLoaded(event)">';
+ '<img class="mapImage" name="' + reqId + '" id="selectionImage" src="' + url + '" width=' + mapDevW + ' height=' + mapDevH + ' border=0 vspace=0 hspace=0 style="visibility: hidden; width: ' + mapDevW + 'px; height: ' + mapDevH + 'px;" onload="return OnSelectionOverlayImageLoaded(event)" onerror="return OnSelectionOverlayImageLoadedError(event)">';
if (opera)
document.getElementById("selectionImage").src = document.getElementById("selectionImage").src;
}
@@ -1806,6 +1806,28 @@
return false;
}
+function OnMapOverlayImageLoadedError(e)
+{
+ var frmParent = parent.frames["tbFrame"];
+ var objDivRefresh = frmParent.document.getElementById("divRefresh");
+ if(objDivRefresh != null)
+ {
+ objDivRefresh.style.display='none';
+ }
+ mapLoading = false;
+
+ var text = this.req.responseText;
+
+ var startPos = text.indexOf("<h2>");
+ startPos = startPos + 4;
+ var endPos = text.indexOf("</h2>", startPos);
+ var message = text.substring(startPos, endPos);
+
+ alert(message);
+
+ return false;
+}
+
function OnSelectionOverlayImageLoaded(e)
{
if(msie)
@@ -1854,6 +1876,20 @@
return false;
}
+function OnSelectionOverlayImageLoadedError(e)
+{
+ var text = this.req.responseText;
+
+ var startPos = text.indexOf("<h2>");
+ startPos = startPos + 4;
+ var endPos = text.indexOf("</h2>", startPos);
+ var message = text.substring(startPos, endPos);
+
+ alert(message);
+
+ return false;
+}
+
function OnAlternateImageLoaded()
{
altimg = document.getElementById(curimg == "mapImage1"? "mapImage2": "mapImage1");
@@ -1890,7 +1926,12 @@
function RequestFailed(text)
{
- //placeholder for debugging output
+ var startPos = text.indexOf("<h2>");
+ startPos = startPos + 4;
+ var endPos = text.indexOf("</h2>", startPos);
+ var message = text.substring(startPos, endPos);
+
+ alert(message);
}
function DraggingShape(e)
@@ -2928,7 +2969,7 @@
dr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
dr.send(reqParams);
- if(dr.responseXML)
+ if(dr.status == 200)
{
var env = ParseEnvelope(dr.responseXML.documentElement);
if(env != null)
@@ -2941,6 +2982,8 @@
GotoView(centerX, centerY, scale, true, true);
}
}
+ else
+ RequestFailed(dr.responseText);
}
function ParseEnvelope(xmlRoot)
More information about the mapguide-commits
mailing list