[mapguide-commits] r4222 - in trunk/MgDev:
Common/PlatformBase/Services Server/src/Services/Feature
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Sep 15 04:42:24 EDT 2009
Author: leaf
Date: 2009-09-15 04:42:22 -0400 (Tue, 15 Sep 2009)
New Revision: 4222
Modified:
trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp
trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.h
trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp
Log:
Ticket #1091: SpatialContextAssociation losted in Raster property
https://trac.osgeo.org/mapguide/ticket/1091.
Submitted for Arthur Liu.
Modified: trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp 2009-09-14 20:59:16 UTC (rev 4221)
+++ trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp 2009-09-15 08:42:22 UTC (rev 4222)
@@ -73,6 +73,19 @@
}
/// <summary>
+/// Gets the Spatial Context name associated to this raster property.
+/// </summary>
+/// <returns>
+/// Returns a String value representing the Spatial Context name.
+/// If empty then the raster property is associated with the active Spatial Context
+/// in the datastore.
+/// </returns>
+STRING MgRasterPropertyDefinition::GetSpatialContextAssociation()
+{
+ return m_associatedSCName;
+}
+
+/// <summary>
/// Sets a Boolean value that specifies whether this geometric property is read-only.
/// </summary>
/// <param name="value">
@@ -115,6 +128,19 @@
m_sizeY = size;
}
+/// <summary>
+/// Sets/add a Spatial Context association to this raster property.
+/// </summary>
+/// <param name="value">
+/// Input the Spatial Context name to be added/set.
+/// Defaults to the active Spatial Context.
+/// </param>
+/// <returns>Returns nothing</returns>
+void MgRasterPropertyDefinition::SetSpatialContextAssociation(CREFSTRING spatialContextName)
+{
+ m_associatedSCName = spatialContextName;
+}
+
MgRasterPropertyDefinition::MgRasterPropertyDefinition()
{
Initialize();
@@ -146,6 +172,7 @@
m_nullable = false;
m_sizeX = 0;
m_sizeY = 0;
+ m_associatedSCName = L"";
}
void MgRasterPropertyDefinition::ToXml(string& xmlStr, bool includeType)
Modified: trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.h 2009-09-14 20:59:16 UTC (rev 4221)
+++ trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.h 2009-09-15 08:42:22 UTC (rev 4222)
@@ -142,6 +142,31 @@
///
INT32 GetDefaultImageYSize(); /// __get, __set
+ ////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Gets the Spatial Context name associated with this raster
+ /// property.
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// string GetSpatialContextAssociation();
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// String GetSpatialContextAssociation();
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// string GetSpatialContextAssociation();
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \return
+ /// Returns a String value representing the Spatial Context
+ /// name. If the value is empty then the raster property is
+ /// associated with the active spatial context in the datastore.
+ ///
+ /// \see
+ /// MgFeatureService::GetSpatialContexts.
+ STRING GetSpatialContextAssociation(); /// __get, __set
+
/////////////////////////////////////////////////////////////////////////////////////////
/// \brief
/// Sets a Boolean value that specifies whether this property is
@@ -243,6 +268,35 @@
/// Returns nothing.
///
void SetDefaultImageYSize (INT32 size);
+
+ //////////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Sets a Spatial Context association for this raster
+ /// property.
+ ///
+ /// \remarks
+ /// If not set, this name defaults to the Spatial Context name
+ /// active in the datastore.
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// void SetSpatialContextAssociation(string spatialContextName);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// void SetSpatialContextAssociation(String spatialContextName);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// void SetSpatialContextAssociation(string spatialContextName);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param spatialContextName (String/string)
+ /// The Spatial Context name to
+ /// be set.
+ ///
+ /// \return
+ /// Returns nothing.
+ ///
+ void SetSpatialContextAssociation(CREFSTRING spatialContextName);
INTERNAL_API:
@@ -258,6 +312,7 @@
bool m_nullable;
INT32 m_sizeX;
INT32 m_sizeY;
+ STRING m_associatedSCName;
STRING m_serializedXml;
INTERNAL_API:
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp 2009-09-14 20:59:16 UTC (rev 4221)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureUtil.cpp 2009-09-15 08:42:22 UTC (rev 4222)
@@ -1739,6 +1739,7 @@
bool isNullable = fdoPropDef->GetNullable();
FdoStringP qname = fdoPropDef->GetQualifiedName();
bool isReadOnly = fdoPropDef->GetReadOnly();
+ FdoStringP spatialContextName = fdoPropDef->GetSpatialContextAssociation();
// Set it for MapGuide
if (desc != NULL)
@@ -1757,6 +1758,11 @@
}
propDef->SetReadOnly(isReadOnly);
+ if (spatialContextName != NULL)
+ {
+ propDef->SetSpatialContextAssociation(STRING(spatialContextName));
+ }
+
return propDef.Detach();
}
@@ -2517,7 +2523,7 @@
bool isNullable = mgPropDef->GetNullable();
STRING qname = mgPropDef->GetQualifiedName();
bool isReadOnly = mgPropDef->GetReadOnly();
-
+ STRING spatialContextName = mgPropDef->GetSpatialContextAssociation();
//Set it for Fdo
if (!desc.empty())
{
@@ -2530,6 +2536,12 @@
//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"MgServerFeatureUtil.GetRasterPropertyDefinition")
return fdoPropDef.Detach();
@@ -3256,6 +3268,7 @@
bool isNullable = mgPropDef->GetNullable();
STRING qname = mgPropDef->GetQualifiedName();
bool isReadOnly = mgPropDef->GetReadOnly();
+ STRING spatialContextName = mgPropDef->GetSpatialContextAssociation();
//Set it for Fdo
if (desc != fdoPropDef->GetDescription())
@@ -3274,5 +3287,8 @@
if (isReadOnly != fdoPropDef->GetReadOnly())
fdoPropDef->SetReadOnly(isReadOnly);
+ if (spatialContextName != fdoPropDef->GetSpatialContextAssociation())
+ fdoPropDef->SetSpatialContextAssociation((FdoString*)spatialContextName.c_str());
+
MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgServerFeatureUtil.UpdateRasterPropertyDefinition")
}
More information about the mapguide-commits
mailing list