[mapguide-commits] r1146 - in trunk/MgDev: Common/MapGuideCommon/Services Common/PlatformBase/Services Server/src/Common/Manager Server/src/Services/Feature Server/src/Services/Resource UnitTest/WebTier/MapAgent/MapAgentForms Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Mar 2 00:50:23 EST 2007


Author: tonyfang
Date: 2007-03-02 00:50:23 -0500 (Fri, 02 Mar 2007)
New Revision: 1146

Modified:
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp
   trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp
   trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.h
   trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp
   trunk/MgDev/Common/PlatformBase/Services/ResourceService.h
   trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
   trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h
   trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h
   trunk/MgDev/Server/src/Services/Resource/TagManager.cpp
   trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.h
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
Log:
Update to MapGuide RFC 12 - Unmanaged Data API Changes
- use %MG_DATA_PATH_ALIAS[alias]% 
  * added MgResourceTag::DataPathAliasBegin and MgResourceTag::DataPathAliasEnd (moved/renamed from UnmanagedDataManager)
  * renamed SubstituteMappingTag to SubstituteDataPathAliases
  
- renamed EnumerateUnmanagedData API "select" argument to "type"
  * added MgResourceUnmanagedDataType::Folders, Files, Both (moved/renamed from UnmanagedDataManager)

- fixed http signature for EnumerateUnmanagedData API
  * use "1" or "0" for recursive argument
  * changed webtier test pages to use "1" or "0" for recursive argument


Other Unmanaged Data API fixes
- fixed SubstituteDataPathAliases (SubstituteMappingTag) bug 
  * unclosed tags, multiple tags resulted in an infinite loop
  
- use MgUtil::ReplaceEscapeCharInXml to encode file/folder names in EnumerateUnmanagedData

- Corrected EnumerateUnmanagedData API declaration to PUBLISHED_API instead of INTERNAL_API

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -1062,7 +1062,7 @@
 /// Enumerates the unmanaged data
 ///
 MgByteReader* MgProxyResourceService::EnumerateUnmanagedData(
-    CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
+    CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter)
 {
     MgCommand cmd;
 
@@ -1074,7 +1074,7 @@
                         1,
                         MgCommand::knString, &path,
                         MgCommand::knInt8, (int)recursive,
-                        MgCommand::knString, &select,
+                        MgCommand::knString, &type,
                         MgCommand::knString, &filter,
                         MgCommand::knNone);
 

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -64,6 +64,8 @@
 const STRING MgResourceTag::Username                = L"%MG_USERNAME%";
 const STRING MgResourceTag::Password                = L"%MG_PASSWORD%";
 const STRING MgResourceTag::DataFilePath            = L"%MG_DATA_FILE_PATH%";
+const STRING MgResourceTag::DataPathAliasBegin      = L"%MG_DATA_PATH_ALIAS[";
+const STRING MgResourceTag::DataPathAliasEnd        = L"]%";
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -101,3 +103,10 @@
 const STRING MgResourceFolder::Users                = L"Users";
 const STRING MgResourceFolder::Groups               = L"Groups";
 const STRING MgResourceFolder::Roles                = L"Roles";
+
+///////////////////////////////////////////////////////////////////////////////
+/// Types of unmanaged data that can be returned
+///
+const STRING MgResourceUnmanagedDataType::Folders         = L"Folders";
+const STRING MgResourceUnmanagedDataType::Files           = L"Files";
+const STRING MgResourceUnmanagedDataType::Both            = L"Both";

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.h	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceDefs.h	2007-03-02 05:50:23 UTC (rev 1146)
@@ -279,6 +279,18 @@
     /// given resource. The trailing "/" is included.
     ///
     static const STRING DataFilePath;   ///\if INTERNAL value("%MG_DATA_FILE_PATH%") \endif
+
+    ////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Denotes beginning of data path alias.
+    ///
+    static const STRING DataPathAliasBegin;   ///\if INTERNAL value("%MG_DATA_PATH_ALIAS[") \endif
+
+    ////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Denotes end of data path alias.
+    ///
+    static const STRING DataPathAliasEnd;     ///\if INTERNAL value("]%") \endif
 };
 
 
@@ -432,6 +444,30 @@
 };
 /// \endcond
 
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Types of unmanaged data that can be returned
+///
+/// \ingroup Resource_Service_classes
+///
+class MG_PLATFORMBASE_API MgResourceUnmanagedDataType
+{
+PUBLISHED_API:
+    /// \if INTERNAL   
+    /// The "value(xxx)" comments are used by SWIG to build constants.php.  Do not alter them.
+    /// \endif
+
+    /// Return folders only
+    static const STRING Folders;     ///\if INTERNAL value("Folders") \endif
+
+    /// Return files only
+    static const STRING Files;       ///\if INTERNAL value("Files") \endif
+
+    /// Return both files and folders
+    static const STRING Both;        ///\if INTERNAL value("Both") \endif
+};
+
+
 #define DECLARE_DYNCREATE_RESOURCE() \
 public: \
     static MgObject* CreateObject();

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -204,7 +204,7 @@
 /// Resources of all types can be enumerated all at once, or only
 /// resources of a given type.
 ///
-MgByteReader* MgResourceService::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
+MgByteReader* MgResourceService::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter)
 {
     throw new MgNotImplementedException(L"MgResourceService.EnumerateUnmanagedData", __LINE__, __WFILE__, NULL, L"", NULL);
 }

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceService.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceService.h	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceService.h	2007-03-02 05:50:23 UTC (rev 1146)
@@ -1500,6 +1500,37 @@
     ///
     virtual bool ResourceExists(MgResourceIdentifier* resource);
 
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Enumerate unmanaged data
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgByteReader EnumerateUnmanagedData(string path, bool recursive, string type, string filter);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgByteReader EnumerateUnmanagedData(String path, boolean recursive, String type, String filter);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgByteReader EnumerateUnmanagedData(string path, bool recursive, string type, string filter);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param path (String/string)
+    /// Unmanaged data path
+    /// \param recursive (boolean/bool)
+    /// Flag to determine whether to recurse subfolders or not
+    /// \param type (String/string)
+    /// Folders, Files, or Both
+    /// \param filter (String/string)
+    /// file filter to be used on returned files
+    ///
+    /// \return
+    /// Returns an MgByteReader object containing the unmanaged data
+    /// in XML format using the \link UnmanagedDataList_schema UnmanagedDataList_schema \endlink
+    ///
+    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter);
+
+
 INTERNAL_API:
 
     ///////////////////////////////////////////////////////////////////////////
@@ -1635,15 +1666,6 @@
     virtual MgSerializableCollection* EnumerateParentMapDefinitions(
         MgSerializableCollection* resources) = 0;
 
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Enumerate unmanaged data
-    ///
-    /// \return
-    /// MgByteReader of unmanaged data
-    ///
-    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter);
-
 protected:
 
     /////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -24,16 +24,11 @@
 // Process-wide MgUnmanagedDataManager
 Ptr<MgUnmanagedDataManager> MgUnmanagedDataManager::sm_unmanagedDataManager = (MgUnmanagedDataManager*)NULL;
 
-const STRING MgUnmanagedDataManager::Folders              = L"FOLDERS";
-const STRING MgUnmanagedDataManager::Files                = L"FILES";
-const STRING MgUnmanagedDataManager::Both                 = L"BOTH";
-const STRING MgUnmanagedDataManager::OpenSquareBracket    = L"[";
-const STRING MgUnmanagedDataManager::ClosedSquareBracket  = L"]";
+const STRING MgUnmanagedDataManager::SquareBracketBegin      = L"[";
+const wchar_t MgUnmanagedDataManager::SquareBracketCharBegin = L'[';
+const STRING MgUnmanagedDataManager::SquareBracketEnd        = L"]";
+const wchar_t MgUnmanagedDataManager::SquareBracketCharEnd   = L']';
 
-const string MgUnmanagedDataManager::MappingBegin         = "%MG_[";
-const string MgUnmanagedDataManager::MappingEnd           = "]%";
-
-
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Constructs the object.
@@ -89,10 +84,10 @@
     else
     {
         // the first character must be open square bracket '['
-        if (path.at(0) == L'[')
+        if (path.at(0) == SquareBracketCharBegin)
         {
             // find the first closed square bracket ']'
-            size_t pos = path.find_first_of(L']');
+            size_t pos = path.find_first_of(SquareBracketCharEnd);
             size_t pathlen = path.length();
 
             if (pos > 1 && pos < pathlen)
@@ -239,7 +234,7 @@
     // append a slash to the folder if is NOT just the [alias]
     if (!entryName.empty() && !MgFileUtil::EndsWithSlash(id))
         MgFileUtil::AppendSlashToEndOfPath(id);
-    string unmanagedDataId = MgUtil::WideCharToMultiByte(id);
+    string unmanagedDataId = MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(id));
     list += "\t\t<UnmanagedDataId>";
     list += unmanagedDataId;
     list += "</UnmanagedDataId>\n";
@@ -272,7 +267,7 @@
     list += "\t<UnmanagedDataFile>\n";
 
     STRING id = FormatMappingName(mappingName) + FormatSubdir(subdir) + entryName;
-    string unmanagedDataId = MgUtil::WideCharToMultiByte(id);
+    string unmanagedDataId = MgUtil::WideCharToMultiByte(MgUtil::ReplaceEscapeCharInXml(id));
     list += "\t\t<UnmanagedDataId>";
     list += unmanagedDataId;
     list += "</UnmanagedDataId>\n";
@@ -338,7 +333,7 @@
 ///
 STRING MgUnmanagedDataManager::FormatMappingName(CREFSTRING name)
 {
-    return MgUnmanagedDataManager::OpenSquareBracket + name + MgUnmanagedDataManager::ClosedSquareBracket;
+    return MgUnmanagedDataManager::SquareBracketBegin + name + MgUnmanagedDataManager::SquareBracketEnd;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -398,10 +393,10 @@
 /// \brief
 /// Substitutes unmanaged data mappings
 ///
-int MgUnmanagedDataManager::SubstituteMappingTag(REFSTRING doc)
+int MgUnmanagedDataManager::SubstituteDataPathAliases(REFSTRING doc)
 {
     string temp = MgUtil::WideCharToMultiByte(doc);
-    int result = SubstituteMappingTag(temp);
+    int result = SubstituteDataPathAliases(temp);
 
     doc = MgUtil::MultiByteToWideChar(temp);
     return result;
@@ -409,19 +404,22 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Substitutes unmanaged data mappings
+/// Substitutes unmanaged data aliases
 ///
-int MgUnmanagedDataManager::SubstituteMappingTag(string& doc)
+int MgUnmanagedDataManager::SubstituteDataPathAliases(string& doc)
 {
     int count = 0;
-    size_t startPos, endPos;
-    size_t len1 = MgUnmanagedDataManager::MappingBegin.length();
-    size_t len2 = MgUnmanagedDataManager::MappingEnd.length();
+    size_t startPos = 0, endPos = 0, currStartPos = 0;
+    string dataPathAliasBegin = MgUtil::WideCharToMultiByte(MgResourceTag::DataPathAliasBegin);
+    string dataPathAliasEnd = MgUtil::WideCharToMultiByte(MgResourceTag::DataPathAliasEnd);
+    size_t len1 = dataPathAliasBegin.length();
+    size_t len2 = dataPathAliasEnd.length();
 
-    while (string::npos != (startPos = doc.find(MgUnmanagedDataManager::MappingBegin)))
+    while (string::npos != (startPos = doc.find(dataPathAliasBegin, currStartPos)))
     {
+        bool aliasSubstituted = false;
         // beginTag found, now look for endTag
-        while (string::npos != (endPos = doc.find(MgUnmanagedDataManager::MappingEnd)))
+        while (string::npos != (endPos = doc.find(dataPathAliasEnd, startPos + len1)))
         {
             // extract out the mapping name
             string mappingName = doc.substr(startPos + len1, endPos - startPos - len1);
@@ -443,11 +441,16 @@
                     size_t dirLen = mappingDir.length();
 
                     doc.replace(startPos, len1 + nameLen + len2, MgUtil::WideCharToMultiByte(mappingDir), 0, dirLen);
+                    currStartPos = startPos + dirLen;
+                    aliasSubstituted = true;
                     ++count;
-                    break;
                 }
             }
+            break;
         }
+
+        if (!aliasSubstituted)
+            currStartPos = endPos + len2;
     }
 
     return count;
@@ -457,7 +460,7 @@
 /// \brief
 /// Returns unmanaged data 
 ///
-MgByteReader* MgUnmanagedDataManager::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
+MgByteReader* MgUnmanagedDataManager::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter)
 {
     Ptr<MgByteReader> byteReader;
 
@@ -492,20 +495,20 @@
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
-        // select must be: 
+        // type must be: 
         //      "FOLDERS"
         //      "FILES"
         //      "BOTH"
 
-        bool storeFolders = ACE_OS::strcasecmp(select.c_str(), MgUnmanagedDataManager::Folders.c_str()) == 0 
-            || ACE_OS::strcasecmp(select.c_str(), MgUnmanagedDataManager::Both.c_str()) == 0;
+        bool storeFolders = ACE_OS::strcasecmp(type.c_str(), MgResourceUnmanagedDataType::Folders.c_str()) == 0 
+            || ACE_OS::strcasecmp(type.c_str(), MgResourceUnmanagedDataType::Both.c_str()) == 0;
         
-        bool storeFiles = ACE_OS::strcasecmp(select.c_str(), MgUnmanagedDataManager::Files.c_str()) == 0 
-            || ACE_OS::strcasecmp(select.c_str(), MgUnmanagedDataManager::Both.c_str()) == 0;
+        bool storeFiles = ACE_OS::strcasecmp(type.c_str(), MgResourceUnmanagedDataType::Files.c_str()) == 0 
+            || ACE_OS::strcasecmp(type.c_str(), MgResourceUnmanagedDataType::Both.c_str()) == 0;
 
         ACE_ASSERT(storeFolders || storeFiles);
 
-        // filter is ignored if select = "FOLDERS"
+        // filter is ignored if type = "FOLDERS"
         // filter can be:
         //      ""
         //      ".sdf"

Modified: trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h	2007-03-02 05:50:23 UTC (rev 1146)
@@ -56,13 +56,13 @@
 
     static MgUnmanagedDataManager* GetInstance();
     MgPropertyCollection* GetUnmanagedDataMappings();
-    static int SubstituteMappingTag(REFSTRING data);
-    static int SubstituteMappingTag(string& data);
+    static int SubstituteDataPathAliases(REFSTRING data);
+    static int SubstituteDataPathAliases(string& data);
     void Initialize();
 
     virtual void Dispose();
 
-    MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter);
+    MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter);
 
 /// Data Members
 
@@ -71,15 +71,10 @@
     static Ptr<MgUnmanagedDataManager> sm_unmanagedDataManager;
     Ptr<MgPropertyCollection> m_unmanagedDataMappings;
 
-    static const STRING Folders;
-    static const STRING Files;
-    static const STRING Both;
-
-    static const STRING OpenSquareBracket;
-    static const STRING ClosedSquareBracket;
-
-    static const string MappingBegin;
-    static const string MappingEnd;
+    static const STRING SquareBracketBegin;
+    static const wchar_t SquareBracketCharBegin;
+    static const STRING SquareBracketEnd;
+    static const wchar_t SquareBracketCharEnd;
 };
 
 #endif

Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetSchemaMapping.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -41,7 +41,7 @@
     FdoPtr<FdoIConnection> fdoConnection;
 
     STRING data = partialConnString;
-    MgUnmanagedDataManager::SubstituteMappingTag(data);
+    MgUnmanagedDataManager::SubstituteDataPathAliases(data);
 
     MgServerFeatureConnection msfc(providerName, data);
     if (( msfc.IsConnectionOpen() ) || ( msfc.IsConnectionPending() ))

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -69,11 +69,11 @@
 
     if (4 == m_packet.m_NumArguments)
     {
-        STRING path, select, filter;
+        STRING path, type, filter;
         bool recursive;
         m_stream->GetString(path);
         m_stream->GetBoolean(recursive);
-        m_stream->GetString(select);
+        m_stream->GetString(type);
         m_stream->GetString(filter);
 
         BeginExecution();
@@ -83,7 +83,7 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_BOOL(recursive);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(select.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(type.c_str());
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(filter.c_str());
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
@@ -91,7 +91,7 @@
         Validate();
 
         Ptr<MgByteReader> byteReader =
-            m_service->EnumerateUnmanagedData(path, recursive, select, filter);
+            m_service->EnumerateUnmanagedData(path, recursive, type, filter);
         
         EndExecution(byteReader);
     }

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -1833,7 +1833,7 @@
 ///----------------------------------------------------------------------------
 
 MgByteReader* MgServerResourceService::EnumerateUnmanagedData(
-    CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
+    CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter)
 {
     Ptr<MgByteReader> byteReader;
 
@@ -1841,7 +1841,7 @@
 
     MG_LOG_TRACE_ENTRY(L"MgServerResourceService::EnumerateUnmanagedData()");
 
-    byteReader = MgUnmanagedDataManager::GetInstance()->EnumerateUnmanagedData(path, recursive, select, filter);
+    byteReader = MgUnmanagedDataManager::GetInstance()->EnumerateUnmanagedData(path, recursive, type, filter);
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.EnumerateUnmanagedData")
 

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h	2007-03-02 05:50:23 UTC (rev 1146)
@@ -146,7 +146,7 @@
 
     // Unmanaged Data APIs
 
-    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter);
+    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING type, CREFSTRING filter);
 
     // Site Security related methods
 

Modified: trunk/MgDev/Server/src/Services/Resource/TagManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/TagManager.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Server/src/Services/Resource/TagManager.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -323,7 +323,7 @@
 
     if (dataBindingInfo.GetSubstituteUnmanagedDataMappings())
     {
-        count += MgUnmanagedDataManager::SubstituteMappingTag(doc);
+        count += MgUnmanagedDataManager::SubstituteDataPathAliases(doc);
     }
 
     CheckTagStrings(doc);

Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html	2007-03-02 05:50:23 UTC (rev 1146)
@@ -17,16 +17,14 @@
 <input type="text" name="PATH" value="" size="30">
 
 <p> Recursive:
-<select name="RECURSIVE">
-<option value="FALSE">FALSE</option>
-<option value="TRUE">TRUE</option>
+<input type="text" name="RECURSIVE" value="0" size="1" ID="Text6">
 </select>
 
-<p> Select:
-<select name="SELECT">
-<option value="FOLDERS">FOLDERS</option>
-<option value="FILES">FILES</option>
-<option value="BOTH">BOTH</option>
+<p> Type:
+<select name="TYPE">
+<option value="Folders">Folders</option>
+<option value="Files">Files</option>
+<option value="Both">Both</option>
 </select>
 
 <p> Filter:

Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -41,11 +41,28 @@
 
     // Get the recursive flag
     STRING recursive = hrParam->GetParameterValue(MgHttpResourceStrings::reqRecursive);
-    m_recursive = SZ_EQI(recursive.c_str(), L"TRUE");
 
-    // Get select
-    m_select = hrParam->GetParameterValue(MgHttpResourceStrings::reqSelect);
+    MG_HTTP_HANDLER_TRY()
 
+    if (recursive == L"1")
+        m_recursive = true;
+    else if (recursive == L"0" || recursive == L"")
+        m_recursive = false;
+    else
+    {
+        MgStringCollection arguments;
+        arguments.Add(MgHttpResourceStrings::reqRecursive);
+        arguments.Add(recursive);
+
+        throw new MgInvalidArgumentException(L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData",
+            __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
+    }
+    
+    MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData")
+
+    // Get type
+    m_type = hrParam->GetParameterValue(MgHttpResourceStrings::reqType);
+
     // Get filter
     m_filter = hrParam->GetParameterValue(MgHttpResourceStrings::reqFilter);
 }
@@ -72,7 +89,7 @@
     Ptr<MgResourceService> mgprService = (MgResourceService*)(CreateService(MgServiceType::ResourceService));
 
     // call the C++ API
-    Ptr<MgByteReader> byteReaderResult = mgprService->EnumerateUnmanagedData(m_path, m_recursive, m_select, m_filter);
+    Ptr<MgByteReader> byteReaderResult = mgprService->EnumerateUnmanagedData(m_path, m_recursive, m_type, m_filter);
     hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
 
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateUnmanagedData.Execute")

Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.h	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.h	2007-03-02 05:50:23 UTC (rev 1146)
@@ -46,7 +46,7 @@
 private:
     STRING m_path;
     bool m_recursive;
-    STRING m_select;
+    STRING m_type;
     STRING m_filter;
 };
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-03-02 05:50:23 UTC (rev 1146)
@@ -100,7 +100,6 @@
 const STRING MgHttpResourceStrings::reqIncludeDescendants = L"INCLUDEDESCENDANTS";
 const STRING MgHttpResourceStrings::reqPath = L"PATH";
 const STRING MgHttpResourceStrings::reqRecursive = L"RECURSIVE";
-const STRING MgHttpResourceStrings::reqSelect = L"SELECT";
 const STRING MgHttpResourceStrings::reqFilter = L"FILTER";
 
 // Resource Service Operation Requests

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-03-02 01:40:09 UTC (rev 1145)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-03-02 05:50:23 UTC (rev 1146)
@@ -104,7 +104,6 @@
     static const STRING reqIncludeDescendants;
     static const STRING reqPath;
     static const STRING reqRecursive;
-    static const STRING reqSelect;
     static const STRING reqFilter;
 
     // PREDEFINED FEATURE REQUEST PARAMETERS



More information about the mapguide-commits mailing list