[mapguide-commits] r1075 - in trunk/MgDev: Common/Foundation/System Common/MapGuideCommon/Services Common/PlatformBase/Services Common/Schema Server/src/Common/Manager Server/src/Services/Resource Server/src/Services/ServerAdmin UnitTest/WebTier/MapAgent/MapAgentForms Web/src/HttpHandler Web/src/mapadmin

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 26 19:26:59 EST 2007


Author: tonyfang
Date: 2007-01-26 19:26:59 -0500 (Fri, 26 Jan 2007)
New Revision: 1075

Added:
   trunk/MgDev/Common/Schema/UnmanagedDataList-1.0.0.xsd
   trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.h
   trunk/MgDev/Web/src/mapadmin/addunmanageddata.php
   trunk/MgDev/Web/src/mapadmin/editunmanageddata.php
   trunk/MgDev/Web/src/mapadmin/unmanageddatamanagement.php
Removed:
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.cpp
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.h
   trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddatamappingsform.html
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.h
Modified:
   trunk/MgDev/Common/Foundation/System/FileUtil.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.h
   trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h
   trunk/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h
   trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp
   trunk/MgDev/Common/PlatformBase/Services/ResourceService.h
   trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
   trunk/MgDev/Server/src/Common/Manager/ServerManager.h
   trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
   trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h
   trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
   trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.h
   trunk/MgDev/Server/src/Services/Resource/Makefile.am
   trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp
   trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp
   trunk/MgDev/Server/src/Services/Resource/OperationInfo.h
   trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj
   trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/Makefile.am
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj
   trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp
   trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html
   trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/resourceserviceapi.html
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.h
   trunk/MgDev/Web/src/HttpHandler/HttpHandler.vcproj
   trunk/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
   trunk/MgDev/Web/src/HttpHandler/Makefile.am
   trunk/MgDev/Web/src/mapadmin/msgs.php
   trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php
   trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php
   trunk/MgDev/Web/src/mapadmin/sessionvars.php
Log:
MapGuide RFC 12 - Unmanaged Data API Changes

Modified: trunk/MgDev/Common/Foundation/System/FileUtil.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/FileUtil.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/Foundation/System/FileUtil.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -135,7 +135,7 @@
 /// path to file name, e.g. "c:\temp\readme.txt"
 /// </param>
 /// <param name="extension">
-/// file extension, e.g. ".txt"
+/// file extension, e.g. ".txt" or "txt"
 /// </param>
 ///----------------------------------------------------------------------------
 bool MgFileUtil::EndsWithExtension(CREFSTRING pathname, CREFSTRING extension)
@@ -147,8 +147,13 @@
     }
 
     bool result = false;
+
+    size_t offset = 0;
+    if (!BeginsWithDot(extension))
+        offset = 1;
+
     size_t len = extension.length();
-    size_t pos = pathname.find_last_of(L'.');
+    size_t pos = pathname.find_last_of(L'.') + offset;
 
     if (STRING::npos != pos && (pathname.length() == pos + len))
     {

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1059,48 +1059,26 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Enumerates the unmanaged data files
-/// Resources of all types can be enumerated all at once, or only
-/// resources of a given type.
+/// Enumerates the unmanaged data
 ///
-MgStringCollection* MgProxyResourceService::EnumerateUnmanagedData(
-    CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth)
+MgByteReader* MgProxyResourceService::EnumerateUnmanagedData(
+    CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
 {
     MgCommand cmd;
 
     cmd.ExecuteCommand(m_connProp,
                         MgCommand::knObject,
                         MgResourceService::opIdEnumerateUnmanagedData,
-                        3,
+                        4,
                         Resource_Service,
                         1,
-                        MgCommand::knString, &mappingName,
-                        MgCommand::knString, &dataTypeFilter,
-                        MgCommand::knInt32, depth,
+                        MgCommand::knString, &path,
+                        MgCommand::knInt8, (int)recursive,
+                        MgCommand::knString, &select,
+                        MgCommand::knString, &filter,
                         MgCommand::knNone);
 
     SetWarning(cmd.GetWarningObject());
 
-    return (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
+    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
 }
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Enumerates the unmanaged data mappings
-///
-MgStringCollection* MgProxyResourceService::EnumerateUnmanagedDataMappings()
-{
-    MgCommand cmd;
-
-    cmd.ExecuteCommand(m_connProp,
-                        MgCommand::knObject,
-                        MgResourceService::opIdEnumerateUnmanagedDataMappings,
-                        0,
-                        Resource_Service,
-                        1,
-                        MgCommand::knNone);
-
-    SetWarning(cmd.GetWarningObject());
-
-    return (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
-}

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyResourceService.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -667,11 +667,16 @@
     virtual MgByteReader* EnumerateReferences(MgResourceIdentifier* resource);
 
 
-    virtual MgStringCollection* EnumerateUnmanagedData(CREFSTRING mappingName,
-        CREFSTRING dataTypeFilter, INT32 depth);
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Enumerates unmanaged data
+    ///
+    /// \return
+    /// MgByteReader object representing unmanaged data
+    /// 
+    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive,
+        CREFSTRING select, CREFSTRING filter);
 
-    virtual MgStringCollection* EnumerateUnmanagedDataMappings();
-
 protected:
 
     //////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -205,6 +205,43 @@
 
 ///////////////////////////////////////////////////////////////////////////////////
 /// <summary>
+/// Removes the configuration properties for the specified property section.
+/// If the properties are not specified, then the entire section will be removed.
+/// </summary>
+/// <param name="propertySection">
+/// The property section to set.
+/// </param>
+/// <param name="properties">
+/// The collection of configuration properties associated with the specified property section that you want to remove.
+/// </param>
+/// <returns>
+/// Nothing
+/// </returns>
+///
+/// EXCEPTIONS:
+/// MgConnectionNotOpenException
+/// MgInvalidPropertySectionException
+/// MgPropertySectionNotAvailableException
+/// MgPropertySectionReadOnlyException
+/// MgInvalidPropertyException
+void MgServerAdmin::RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties)
+{
+    MgCommand cmd;
+    cmd.ExecuteCommand(m_connProp,                            // Connection
+                        MgCommand::knVoid,                      // Return type expected
+                        MgServerAdminServiceOpId::RemoveConfigurationProperties, // Command Code
+                        2,                                      // No of arguments
+                        ServerAdmin_Service,                    // Service Id
+                        1,                                      // Operation version
+                        MgCommand::knString, &propertySection,  // Argument#1
+                        MgCommand::knObject, properties,        // Argument#2
+                        MgCommand::knNone);
+
+    SetWarning(cmd.GetWarningObject());
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+/// <summary>
 /// Clears the specified log.
 /// </summary>
 /// <param name="log">

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerAdmin.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -150,6 +150,27 @@
     ///
     void SetConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
 
+    ///////////////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Removes the configuration properties for the specified property section.
+    /// If the properties are not specified, then the entire section will be removed.
+    ///
+    /// \param propertySection
+    /// The property section to remove.
+    /// \param properties
+    /// The collection of configuration properties associated with the specified property section that you want to remove.
+    ///
+    /// \return
+    /// Nothing
+    ///
+    /// \exception MgConnectionNotOpenException
+    /// \exception MgInvalidPropertySectionException
+    /// \exception MgPropertySectionNotAvailableException
+    /// \exception MgPropertySectionReadOnlyException
+    /// \exception MgInvalidPropertyException
+    ///
+    void RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
+
     /////////////////////////////////////////////////////////////////
     /// \brief
     /// Clears the specified log.

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerAdminDefs.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -208,6 +208,7 @@
     static const int SetDocument                    = 0x1111EA19;
     static const int NotifyResourcesChanged         = 0x1111EA1A;
     static const int MakePackage                    = 0x1111EA1B;
+    static const int RemoveConfigurationProperties  = 0x1111EA1C;
 };
 
 #define DECLARE_DYNCREATE_SERVERADMIN() \

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceService.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -204,17 +204,7 @@
 /// Resources of all types can be enumerated all at once, or only
 /// resources of a given type.
 ///
-MgStringCollection* MgResourceService::EnumerateUnmanagedData(
-    CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth)
+MgByteReader* MgResourceService::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
 {
     throw new MgNotImplementedException(L"MgResourceService.EnumerateUnmanagedData", __LINE__, __WFILE__, NULL, L"", NULL);
 }
-
-//////////////////////////////////////////////////////////////////
-/// \brief
-/// Enumerates the unmanaged data mappings
-///
-MgStringCollection* MgResourceService::EnumerateUnmanagedDataMappings()
-{
-    throw new MgNotImplementedException(L"MgResourceService.EnumerateUnmanagedDataMappings", __LINE__, __WFILE__, NULL, L"", NULL);
-}

Modified: trunk/MgDev/Common/PlatformBase/Services/ResourceService.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/ResourceService.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/PlatformBase/Services/ResourceService.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1679,20 +1679,10 @@
     /// Enumerate unmanaged data
     ///
     /// \return
-    /// MgStringCollection list of unmanaged data paths
+    /// MgByteReader of unmanaged data
     ///
-    virtual MgStringCollection* EnumerateUnmanagedData(
-        CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth);
+    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter);
 
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Enumerate unmanaged data mappings
-    ///
-    /// \return
-    /// MgStringCollection list of unmanaged data mappings
-    ///
-    virtual MgStringCollection* EnumerateUnmanagedDataMappings();
-
 protected:
 
     /////////////////////////////////////////////////////////////////
@@ -1763,7 +1753,6 @@
         opIdGetResourceModifiedDate         = 0x1111EF18,
         opIdEnumerateParentMapDefinitions   = 0x1111EF19,
         opIdEnumerateUnmanagedData          = 0x1111EF1A,
-        opIdEnumerateUnmanagedDataMappings  = 0x1111EF1B,
     };
 };
 

Added: trunk/MgDev/Common/Schema/UnmanagedDataList-1.0.0.xsd
===================================================================
--- trunk/MgDev/Common/Schema/UnmanagedDataList-1.0.0.xsd	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Common/Schema/UnmanagedDataList-1.0.0.xsd	2007-01-27 00:26:59 UTC (rev 1075)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <xs:element name="UnmanagedDataList">
+    <xs:annotation>
+      <xs:documentation>Unmanaged data list</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="UnmanagedDataFolder">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="UnmanagedDataId" type="xs:string"/>
+              <xs:element name="CreatedDate" type="xs:dateTime"/>
+              <xs:element name="ModifiedDate" type="xs:dateTime"/>
+              <xs:element name="NumberOfFolders" type="xs:integer"/>
+              <xs:element name="NumberOfFiles" type="xs:integer"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="UnmanagedDataFile">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="UnmanagedDataId" type="xs:string"/>
+              <xs:element name="CreatedDate" type="xs:dateTime"/>
+              <xs:element name="ModifiedDate" type="xs:dateTime"/>
+              <xs:element name="Size" type="xs:integer"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
\ No newline at end of file

Modified: trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -334,6 +334,57 @@
 
 ///////////////////////////////////////////////////////////////////////////////////
 /// <summary>
+/// Removes the configuration properties for the specified property section.
+/// If the properties are not specified, then the entire section will be removed.
+/// </summary>
+void MgServerManager::RemoveConfigurationProperties(CREFSTRING propertySection, 
+    MgPropertyCollection* properties)
+{
+    MG_TRY()
+
+    MG_LOG_TRACE_ENTRY(L"MgServerManager::SetConfigurationProperties()");
+
+    if (NULL == properties)
+    {
+        throw new MgNullArgumentException(
+            L"MgServerManager::SetConfigurationProperties", 
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    MgConfiguration* pConfiguration = MgConfiguration::GetInstance();
+
+    if (NULL == pConfiguration)
+    {
+        throw new MgNullReferenceException(
+            L"MgServerManager::SetConfigurationProperties", 
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    // Set the properties
+    pConfiguration->RemoveProperties(propertySection, properties);
+
+    // Enable/disable specified services for this local server if applicable.
+    if (MgConfigProperties::HostPropertiesSection == propertySection)
+    {
+        MgServiceManager* serviceManager = MgServiceManager::GetInstance();
+        assert(NULL != serviceManager);
+
+        serviceManager->EnableServices(properties);
+    }
+
+    // Certain properties can be updated without requiring a server restart
+    LoadConfigurationProperties();
+
+    MgLogManager* logManager = MgLogManager::GetInstance();
+    assert(NULL != logManager);
+    logManager->LoadConfigurationProperties();
+
+    MG_CATCH_AND_THROW(L"MgServerManager.SetConfigurationProperties")
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+/// <summary>
 /// Gets the information properties for the server.
 /// </summary>
 MgPropertyCollection* MgServerManager::GetInformationProperties()

Modified: trunk/MgDev/Server/src/Common/Manager/ServerManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServerManager.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Common/Manager/ServerManager.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -57,6 +57,7 @@
 
     MgPropertyCollection* GetConfigurationProperties(CREFSTRING propertySection);
     void SetConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
+    void RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
 
     MgPropertyCollection* GetInformationProperties();
 

Modified: trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -24,25 +24,9 @@
 // Process-wide MgUnmanagedDataManager
 Ptr<MgUnmanagedDataManager> MgUnmanagedDataManager::sm_unmanagedDataManager = (MgUnmanagedDataManager*)NULL;
 
-const STRING MgUnmanagedDataManager::Sdf                  = L".SDF";
-const STRING MgUnmanagedDataManager::Shp                  = L".SHP";
-const STRING MgUnmanagedDataManager::Dwf                  = L".DWF";
-const STRING MgUnmanagedDataManager::Raster               = L".RASTER";
-const STRING MgUnmanagedDataManager::Odbc                 = L"ODBC";
-const STRING MgUnmanagedDataManager::Folder               = L"FOLDER";
-const STRING MgUnmanagedDataManager::Jpg                  = L".JPG";
-const STRING MgUnmanagedDataManager::Jpeg                 = L".JPEG";
-const STRING MgUnmanagedDataManager::Jpe                  = L".JPE";
-const STRING MgUnmanagedDataManager::Png                  = L".PNG";
-const STRING MgUnmanagedDataManager::Bmp                  = L".BMP";
-const STRING MgUnmanagedDataManager::Cal                  = L".CAL";
-const STRING MgUnmanagedDataManager::Tga                  = L".TGA";
-const STRING MgUnmanagedDataManager::Tif                  = L".TIF";
-const STRING MgUnmanagedDataManager::Tiff                 = L".TIFF";
-const STRING MgUnmanagedDataManager::Sid                  = L".SID";
-const STRING MgUnmanagedDataManager::Ecw                  = L".ECW";
-const STRING MgUnmanagedDataManager::Bil                  = L".BIL";
-const STRING MgUnmanagedDataManager::Mdb                  = L".MDB";
+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"]";
 
@@ -75,20 +59,114 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Recursive method that returns all files for a given mapping name
+/// Parses the path into mappingName and subfolder
+/// The path must be in the form of:
+///     "[mappingName]subfolder1/subfolder2"
 ///
-void MgUnmanagedDataManager::GetFiles(MgStringCollection* files, CREFSTRING mappingName, CREFSTRING rootdir, CREFSTRING subdir, CREFSTRING dataTypeFilter, INT32 depth)
+bool MgUnmanagedDataManager::ParsePath(CREFSTRING path, REFSTRING mappingName, REFSTRING subfolder)
 {
+    bool result = false;
+
+    if (path.empty())
+    {
+        result = true;
+    }
+    else
+    {
+        // the first character must be open square bracket '['
+        if (path.at(0) == L'[')
+        {
+            // find the first closed square bracket ']'
+            size_t pos = path.find_first_of(L']');
+            size_t pathlen = path.length();
+
+            if (pos > 1 && pos < pathlen)
+            {
+                // extract the mapping name
+                mappingName = path.substr(1, pos - 1);
+
+                if (pos + 1 < pathlen)
+                {
+                    subfolder = path.substr(pos + 1, pathlen - pos + 1);
+                }
+
+                result = true;
+            }
+        }
+    }
+    return result;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Parses the filter into an MgStringCollection
+///
+void MgUnmanagedDataManager::ParseFilter(CREFSTRING filter, MgStringCollection* filters)
+{
+    if (!filter.empty())
+    {
+        wchar_t* token = const_cast<wchar_t*>(filter.c_str());
+        const wchar_t* delimit = L"; \t\r\n\v\f";
+        wchar_t* state = NULL;
+
+        for (token = _wcstok(token, delimit, &state);
+             token != NULL;
+             token = _wcstok(NULL, delimit, &state))
+        {
+            filters->Add(token);
+        }
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Returns true is file ends in one of the extensions in filters
+///
+bool MgUnmanagedDataManager::FilterFile(CREFSTRING file, const MgStringCollection* filters)
+{
+    bool result = false;
+
+    INT32 numFilters = filters->GetCount();
+    if (numFilters == 0)
+    {
+        // no filters, return all files 
+        result = true;
+    }
+    else
+    {
+        for (int i = 0; i < numFilters; i++)
+        {
+            if (MgFileUtil::EndsWithExtension(file, filters->GetItem(i)))
+            {
+                result = true;
+                break;
+            }
+        }
+    }
+    return result;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Recursive method that returns all files and/or folders for a given mapping 
+/// name
+///
+void MgUnmanagedDataManager::GetFilesAndFolders(string& list, CREFSTRING mappingName, CREFSTRING rootdir, CREFSTRING subdir, const MgStringCollection* filters, bool storeFolders, bool storeFiles, bool recursive)
+{
     STRING fulldir = rootdir;
-    MgFileUtil::AppendSlashToEndOfPath(fulldir);
+    if (!MgFileUtil::EndsWithSlash(fulldir))
+        MgFileUtil::AppendSlashToEndOfPath(fulldir);
+
     if (!subdir.empty())
     {
         fulldir += subdir;
-        MgFileUtil::AppendSlashToEndOfPath(fulldir);
+        if (!MgFileUtil::EndsWithSlash(fulldir))
+            MgFileUtil::AppendSlashToEndOfPath(fulldir);
     }
 
     // Open the directory
-    ACE_DIR* directory = directory = ACE_OS::opendir(ACE_TEXT_WCHAR_TO_TCHAR(fulldir.c_str()));
+    ACE_DIR* directory = ACE_OS::opendir(ACE_TEXT_WCHAR_TO_TCHAR(fulldir.c_str()));
 
     if (directory != NULL)
     {
@@ -99,23 +177,34 @@
         {
             STRING entryName = MG_TCHAR_TO_WCHAR(direntry->d_name);
             STRING fullDataPathname = fulldir + entryName;
+            MgDateTime createdDate = MgFileUtil::GetFileCreationTime(fullDataPathname);
+            MgDateTime modifiedDate = MgFileUtil::GetFileModificationTime(fullDataPathname);
 
             if (MgFileUtil::IsFile(fullDataPathname)
-                && IsValidFileType(entryName, dataTypeFilter))
+                && storeFiles
+                && FilterFile(entryName, filters))
             {
-                // Add to list of files
-                files->Add(FormatMappingName(mappingName) + FormatSubdir(subdir) + entryName);
+                INT64 fileSize = MgFileUtil::GetFileSize(fullDataPathname);
+  
+                AddFile(list, mappingName, subdir, entryName, fileSize, createdDate, modifiedDate);
             }
             else if (MgFileUtil::IsDirectory(fullDataPathname) 
                 && entryName.compare(L"..") != 0 // skip ..
-                && entryName.compare(L".") != 0 // skip .
-                && (depth == -1 || depth > 0))
+                && entryName.compare(L".") != 0) // skip .
             {
-                if (depth > 0)
-                    depth--;
+                if (storeFolders)
+                {
+                    // Add folders
+                    INT32 numFolders = 0;
+                    INT32 numFiles = 0;
+                    GetNumberOfFilesAndSubfolders(fullDataPathname, numFolders, numFiles);
 
-                // recursive call to get files in subdirecories
-                GetFiles(files, mappingName, rootdir, FormatSubdir(subdir) + entryName, dataTypeFilter, depth);
+                    AddFolder(list, mappingName, subdir, entryName, numFolders, numFiles, createdDate, modifiedDate);
+                }
+
+                // recursive call to get files in subfolders
+                if (recursive)
+                    GetFilesAndFolders(list, mappingName, rootdir, FormatSubdir(subdir) + entryName, filters, storeFolders, storeFiles, recursive);
             }
         }
 
@@ -125,6 +214,111 @@
  
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
+/// Appends folder details to xml string
+///
+void MgUnmanagedDataManager::AddFolder(string& list, CREFSTRING mappingName, CREFSTRING subdir, CREFSTRING entryName, INT32 numFolders, INT32 numFiles, MgDateTime createdDate, MgDateTime modifiedDate)
+{
+    list += "\t<UnmanagedDataFolder>\n";
+
+    STRING id = FormatMappingName(mappingName) + FormatSubdir(subdir) + entryName;
+    // 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);
+    list += "\t\t<UnmanagedDataId>";
+    list += unmanagedDataId;
+    list += "</UnmanagedDataId>\n";
+
+    list += "\t\t<CreatedDate>";
+    list += createdDate.ToXmlStringUtf8();
+    list += "</CreatedDate>\n";
+
+    list += "\t\t<ModifiedDate>";
+    list += modifiedDate.ToXmlStringUtf8();
+    list += "</ModifiedDate>\n";
+
+    STRING numFoldersStr;
+    MgUtil::Int32ToString(numFolders, numFoldersStr);
+    list += "\t\t<NumberOfFolders>";
+    list += MgUtil::WideCharToMultiByte(numFoldersStr);
+    list += "</NumberOfFolders>\n";
+
+    string numFilesStr;
+    MgUtil::Int32ToString(numFiles, numFilesStr);
+    list += "\t\t<NumberOfFiles>";
+    list += numFilesStr;
+    list += "</NumberOfFiles>\n";
+
+    list += "\t</UnmanagedDataFolder>\n";
+}
+ 
+void MgUnmanagedDataManager::AddFile(string& list, CREFSTRING mappingName, CREFSTRING subdir, CREFSTRING entryName, INT64 fileSize, MgDateTime createdDate, MgDateTime modifiedDate)
+{
+    list += "\t<UnmanagedDataFile>\n";
+
+    STRING id = FormatMappingName(mappingName) + FormatSubdir(subdir) + entryName;
+    string unmanagedDataId = MgUtil::WideCharToMultiByte(id);
+    list += "\t\t<UnmanagedDataId>";
+    list += unmanagedDataId;
+    list += "</UnmanagedDataId>\n";
+
+    list += "\t\t<CreatedDate>";
+    list += createdDate.ToXmlStringUtf8();
+    list += "</CreatedDate>\n";
+
+    list += "\t\t<ModifiedDate>";
+    list += modifiedDate.ToXmlStringUtf8();
+    list += "</ModifiedDate>\n";
+
+    string fileSizeStr;
+    MgUtil::Int64ToString(fileSize, fileSizeStr);
+    list += "\t\t<Size>";
+    list += fileSizeStr;
+    list += "</Size>\n";
+
+    list += "\t</UnmanagedDataFile>\n";
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Retrieves number of folders and files in the specified folder path
+/// pre-condition: assumes dirpath is a valid folder
+///
+void MgUnmanagedDataManager::GetNumberOfFilesAndSubfolders(CREFSTRING dirpath, INT32& numFolders, INT32& numFiles)
+{
+    ACE_DIR* directory = ACE_OS::opendir(ACE_TEXT_WCHAR_TO_TCHAR(dirpath.c_str()));
+    if (directory != NULL)
+    {
+        dirent* direntry = NULL;
+
+        // Go through the directory entries
+        while ((direntry = ACE_OS::readdir(directory)) != NULL)
+        {
+            STRING entryName = MG_TCHAR_TO_WCHAR(direntry->d_name);
+
+            STRING fullDataPathname = dirpath;
+            if (!MgFileUtil::EndsWithSlash(fullDataPathname))
+                MgFileUtil::AppendSlashToEndOfPath(fullDataPathname);
+
+            fullDataPathname += entryName;
+
+            if (MgFileUtil::IsFile(fullDataPathname))
+            {
+                ++numFiles;
+            }
+            else if (MgFileUtil::IsDirectory(fullDataPathname) 
+                && entryName.compare(L"..") != 0 // skip ..
+                && entryName.compare(L".") != 0) // skip .
+            {
+                ++numFolders;
+            }
+        }
+        ACE_OS::closedir(directory);
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
 /// Recursive method that returns all subdirectories for a given mapping name
 ///
 void MgUnmanagedDataManager::GetDirectories(MgStringCollection* dirs, CREFSTRING mappingName, CREFSTRING rootdir, CREFSTRING subdir, INT32 depth)
@@ -174,116 +368,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Is valid data type filter
-///
-bool MgUnmanagedDataManager::IsValidDataTypeFilter(CREFSTRING dataTypeFilter)
-{
-    // TODO: other file types?
-    return (dataTypeFilter.empty()
-        || ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Sdf.c_str()) == 0
-        || ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Shp.c_str()) == 0
-        || ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Dwf.c_str()) == 0
-        || ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Raster.c_str()) == 0
-        || ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Odbc.c_str()) == 0
-        || ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Folder.c_str()) == 0);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// checks that a given file is of a specified type
-///
-bool MgUnmanagedDataManager::IsValidFileType(CREFSTRING file, CREFSTRING dataTypeFilter)
-{
-    bool result = false;
-
-    if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Sdf.c_str()) == 0)
-        result = IsSdfFile(file);
-    else if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Shp.c_str()) == 0)
-        result = IsShpFile(file);
-    else if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Dwf.c_str()) == 0)
-        result = IsDwfFile(file);
-    else if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Raster.c_str()) == 0)
-        result = IsRasterFile(file);
-    else if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Odbc.c_str()) == 0)
-        result = IsOdbcFile(file);
-    else if (dataTypeFilter.empty())
-        result = IsAnyValidFile(file);
-
-    return result;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Is valid sdf data file
-///
-bool MgUnmanagedDataManager::IsSdfFile(CREFSTRING file)
-{
-    return MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Sdf);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Is valid shp data file
-///
-bool MgUnmanagedDataManager::IsShpFile(CREFSTRING file)
-{
-    return MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Shp);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Is valid dwf data file
-///
-bool MgUnmanagedDataManager::IsDwfFile(CREFSTRING file)
-{
-    return MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Dwf);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Is valid raster data file
-///
-bool MgUnmanagedDataManager::IsRasterFile(CREFSTRING file)
-{
-    return MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Jpg)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Jpeg)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Jpe)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Png)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Bmp)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Cal)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Tga)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Tif)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Tiff)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Sid)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Ecw)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Bil);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Is valid odbc data file
-///
-bool MgUnmanagedDataManager::IsOdbcFile(CREFSTRING file)
-{
-    // TODO: other file types?
-    return MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Mdb);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Is valid unmanaged data file
-///
-bool MgUnmanagedDataManager::IsAnyValidFile(CREFSTRING file)
-{
-    return MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Sdf)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Shp)
-        || MgFileUtil::EndsWithExtension(file, MgUnmanagedDataManager::Dwf)
-        || IsRasterFile(file)
-        || IsOdbcFile(file);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
 /// Surrounds name with square brackets
 ///
 STRING MgUnmanagedDataManager::FormatMappingName(CREFSTRING name)
@@ -336,11 +420,11 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Returns string collection containing unmanaged data 
+/// Returns unmanaged data 
 ///
-MgStringCollection* MgUnmanagedDataManager::EnumerateUnmanagedData(CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth)
+MgByteReader* MgUnmanagedDataManager::EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
 {
-    Ptr<MgStringCollection> dataPaths = new MgStringCollection();
+    Ptr<MgByteReader> byteReader;
 
     MG_TRY()
 
@@ -348,20 +432,61 @@
 
     MgConfiguration* config = MgConfiguration::GetInstance();
     Ptr<MgPropertyCollection> properties = config->GetProperties(MgConfigProperties::UnmanagedDataMappingsSection);
-
+   
     if (properties != NULL)
     {
-        if (!IsValidDataTypeFilter(dataTypeFilter))
+        // this XML follows the ResourceList-1.0.0.xsd schema
+        string list = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+        list += "<ResourceList xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"ResourceList-1.0.0.xsd\">\n";
+
+        // check arguments...
+
+        // pull out the mapping name from the path
+        // path must be in the form of:
+        //      ""
+        //      "[alias1]"
+        //      "[alias1]subfolder1"
+        //      "[alias1]subfolder1/"
+        //      "[alias1]subfolder1/subfolder2/"
+
+        STRING mappingName = L"", subfolder = L"";
+        if (!ParsePath(path, mappingName, subfolder))
         {
             MgStringCollection arguments;
             arguments.Add(L"1");
-            arguments.Add(dataTypeFilter);
+            arguments.Add(path);
 
             throw new MgInvalidArgumentException(L"MgUnmanagedDataManager::EnumerateUnmanagedData",
                 __LINE__, __WFILE__, &arguments, L"", NULL);
         }
 
-        // are we looking in a specific mapping?
+        // select 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 storeFiles = ACE_OS::strcasecmp(select.c_str(), MgUnmanagedDataManager::Files.c_str()) == 0 
+            || ACE_OS::strcasecmp(select.c_str(), MgUnmanagedDataManager::Both.c_str()) == 0;
+
+        ACE_ASSERT(storeFolders || storeFiles);
+
+
+        // filter is ignored if select = "FOLDERS"
+        // filter can be:
+        //      ""
+        //      ".sdf"
+        //      ".sdf;.pdf;.shp"
+        //      "sdf"
+        //      "sdf;dwf;png"
+
+        MgStringCollection filters;
+        if (storeFiles)
+            ParseFilter(filter, &filters);
+
+        // are we looking in a specific path?
         if (!mappingName.empty())
         {
             STRING mappingDir = L"";
@@ -386,26 +511,20 @@
             {
                 MgStringCollection arguments;
                 arguments.Add(L"1");
-                arguments.Add(mappingName);
+                arguments.Add(path);
 
                 throw new MgInvalidArgumentException(L"MgUnmanagedDataManager::EnumerateUnmanagedData",
                     __LINE__, __WFILE__, &arguments, L"", NULL);
             }
             else
             {
-                // get the files from that directory (recursive) --> use another method
-                dataPaths = new MgStringCollection();
-
-                if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Folder.c_str()) == 0)
-                    GetDirectories(dataPaths, mappingName, mappingDir, L"", depth);
-                else
-                    GetFiles(dataPaths, mappingName, mappingDir, L"", dataTypeFilter, depth);
+                // get the files and/or folders from that folder and subfolder (recursive)
+                GetFilesAndFolders(list, mappingName, mappingDir, subfolder, &filters, storeFolders, storeFiles, recursive);
             }
         }
         else
         {
-            // getting files from all available mappings
-
+            // getting files starting from virtual root (all mappings)
             // iterate thru mappings
             for (int i = 0; i < properties->GetCount(); i++)
             {
@@ -414,41 +533,38 @@
                 STRING mapName = stringProp->GetName();
                 STRING mapDir = stringProp->GetValue();
 
-                if (ACE_OS::strcasecmp(dataTypeFilter.c_str(), MgUnmanagedDataManager::Folder.c_str()) == 0)
-                    GetDirectories(dataPaths, mapName, mapDir, L"", depth);
-                else
-                    GetFiles(dataPaths, mapName, mapDir, L"", dataTypeFilter, depth);
+                if (MgFileUtil::IsDirectory(mapDir))
+                {
+                    if (storeFolders)
+                    {
+                        MgDateTime createdDate = MgFileUtil::GetFileCreationTime(mapDir);
+                        MgDateTime modifiedDate = MgFileUtil::GetFileModificationTime(mapDir);
+
+                        INT32 numFolders = 0;
+                        INT32 numFiles = 0;
+
+                        GetNumberOfFilesAndSubfolders(mapDir, numFolders, numFiles);
+
+                        // add top-level mappings
+                        AddFolder(list, mapName, L"", L"", numFolders, numFiles, createdDate, modifiedDate);
+                    }
+
+                    if (recursive)
+                        GetFilesAndFolders(list, mapName, mapDir, L"", &filters, storeFolders, storeFiles, recursive);
+                }
             }
         }
-    }
-    MG_CATCH_AND_THROW(L"MgUnmanagedDataManager.EnumerateUnmanagedData")
 
-    return dataPaths.Detach();
-}
+        list += "</ResourceList>";
 
+        Ptr<MgByteSource> byteSource = new MgByteSource(
+        (unsigned char*)list.c_str(), (INT32)list.length());
 
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Returns string collection containing unmanaged data mappings
-///
-MgStringCollection* MgUnmanagedDataManager::EnumerateUnmanagedDataMappings()
-{
-    Ptr<MgStringCollection> mappings = new MgStringCollection();
-
-    MgConfiguration* config = MgConfiguration::GetInstance();
-        
-    Ptr<MgPropertyCollection> properties = config->GetProperties(MgConfigProperties::UnmanagedDataMappingsSection);
-    if (properties != NULL)
-    {
-        for (int i = 0; i < properties->GetCount(); i++)
-        {
-            Ptr<MgStringProperty> stringProp = (MgStringProperty*)properties->GetItem(i);
-            STRING name = stringProp->GetName();
-            mappings->Add(name);
-        }
+        byteSource->SetMimeType(MgMimeType::Xml);
+        byteReader = byteSource->GetReader();
     }
+    
+    MG_CATCH_AND_THROW(L"MgUnmanagedDataManager.EnumerateUnmanagedData")
 
-    return mappings.Detach();
+    return byteReader.Detach();
 }
-
-

Modified: trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Common/Manager/UnmanagedDataManager.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -36,18 +36,20 @@
     MgUnmanagedDataManager(const MgUnmanagedDataManager&);
     MgUnmanagedDataManager& operator=(const MgUnmanagedDataManager&);
 
-    void GetFiles(MgStringCollection* files, CREFSTRING mappingName, CREFSTRING rootdir, CREFSTRING subdir, CREFSTRING dataTypeFilter, INT32 depth);
+
+    bool ParsePath(CREFSTRING path, REFSTRING mappingName, REFSTRING subfolder);
+    void ParseFilter(CREFSTRING filter, MgStringCollection* filters);
+    bool FilterFile(CREFSTRING file, const MgStringCollection* filters);
+
+    void GetFilesAndFolders(string& list, CREFSTRING mappingName, CREFSTRING rootdir, CREFSTRING subdir, const MgStringCollection* filters, bool storeFolders, bool storeFiles, bool recursive);
+
+    // TODO: delete
     void GetDirectories(MgStringCollection* dirs, CREFSTRING mappingName, CREFSTRING rootdir, CREFSTRING subdir, INT32 depth);
 
-    bool IsValidDataTypeFilter(CREFSTRING dataTypeFilter);
-    bool IsValidFileType(CREFSTRING file, CREFSTRING dataTypeFilter);
+    void AddFolder(string& list, CREFSTRING mappingName, CREFSTRING subdir, CREFSTRING entryName, INT32 numFolders, INT32 numFiles, MgDateTime createdDate, MgDateTime modifiedDate);
+    void AddFile(string& list, CREFSTRING mappingName, CREFSTRING subdir, CREFSTRING entryName, INT64 fileSize, MgDateTime createdDate, MgDateTime modifiedDate);
 
-    bool IsSdfFile(CREFSTRING file);
-    bool IsShpFile(CREFSTRING file);
-    bool IsDwfFile(CREFSTRING file);
-    bool IsRasterFile(CREFSTRING file);
-    bool IsOdbcFile(CREFSTRING file);
-    bool IsAnyValidFile(CREFSTRING file);
+    void GetNumberOfFilesAndSubfolders(CREFSTRING dirpath, INT32& numFolders, INT32& numFiles);
 
     STRING FormatMappingName(CREFSTRING name);
     STRING FormatSubdir(CREFSTRING subdir);
@@ -59,8 +61,7 @@
     static MgUnmanagedDataManager* GetInstance();
     virtual void Dispose();
 
-    MgStringCollection* EnumerateUnmanagedData(CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth);
-    MgStringCollection* EnumerateUnmanagedDataMappings();
+    MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter);
 
 /// Data Members
 
@@ -68,25 +69,10 @@
 
     static Ptr<MgUnmanagedDataManager> sm_unmanagedDataManager;
 
-    static const STRING Sdf;
-    static const STRING Shp;
-    static const STRING Dwf;
-    static const STRING Raster;
-    static const STRING Odbc;
-    static const STRING Folder;
-    static const STRING Jpg;
-    static const STRING Jpeg;
-    static const STRING Jpe;
-    static const STRING Png;
-    static const STRING Bmp;
-    static const STRING Cal;
-    static const STRING Tga;
-    static const STRING Tif;
-    static const STRING Tiff;
-    static const STRING Sid;
-    static const STRING Ecw;
-    static const STRING Bil;
-    static const STRING Mdb;
+    static const STRING Folders;
+    static const STRING Files;
+    static const STRING Both;
+
     static const STRING OpenSquareBracket;
     static const STRING ClosedSquareBracket;
 };

Modified: trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1467,43 +1467,4 @@
     destResourceTags = destTagMan.GetTags();
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgApplicationRepositoryManager.CopyResourceData")
-}
-
-/*
-MgStringCollection* MgApplicationRepositoryManager::EnumerateUnmanagedData(
-    CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth)
-{
-	// TODO:
-    //throw new MgNotImplementedException(L"MgResourceService.EnumerateUnmanagedData", __LINE__, __WFILE__, NULL, L"", NULL);
-    Ptr<MgStringCollection> dataPaths;
-
-	dataPaths = new MgStringCollection();
-	dataPaths->Add(L"Ueto Aya");
-	dataPaths->Add(L"Ito Misaki");
-
-
-    return dataPaths.Detach();
-}
-
-//////////////////////////////////////////////////////////////////
-/// \brief
-/// Enumerates the unmanaged data
-/// Resources of all types can be enumerated all at once, or only
-/// resources of a given type.
-///
-MgStringCollection* MgApplicationRepositoryManager::EnumerateUnmanagedDataMappings()
-{
-	// TODO:
-    //throw new MgNotImplementedException(L"MgResourceService.EnumerateUnmanagedDataMappings", __LINE__, __WFILE__, NULL, L"", NULL);
-
-    Ptr<MgStringCollection> mappings;
-
-	mappings = new MgStringCollection();
-	mappings->Add(L"Song Hye Gyo");
-	mappings->Add(L"Kim Tae Hee");
-	mappings->Add(L"Kim Sun Ah");
-
-
-    return mappings.Detach();
-}
-*/
+}
\ No newline at end of file

Modified: trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -85,12 +85,6 @@
     MgByteReader* GetResourceData(MgResourceIdentifier* resource,
         CREFSTRING dataName, CREFSTRING preProcessTags);
 
-	// Unmanaged Data APIs
-
-//    virtual MgStringCollection* EnumerateUnmanagedData(CREFSTRING mappingName, 
-//		CREFSTRING dataTypeFilter, UINT32 depth);
-//    virtual MgStringCollection* EnumerateUnmanagedDataMappings();
-
     // Helper Methods
 
     void DeleteResourceData(CREFSTRING resourceTags, MgResourceIdentifier* resource);

Modified: trunk/MgDev/Server/src/Services/Resource/Makefile.am
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/Makefile.am	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/Makefile.am	2007-01-27 00:26:59 UTC (rev 1075)
@@ -57,7 +57,6 @@
   OpEnumerateResourceReferences.cpp \
   OpEnumerateResources.cpp \
   OpEnumerateUnmanagedData.cpp \
-  OpEnumerateUnmanagedDataMappings.cpp \
   OperationInfo.cpp \
   OperationParameter.cpp \
   OpGetRepositoryContent.cpp \
@@ -135,7 +134,6 @@
   OpEnumerateResourceReferences.h \
   OpEnumerateResources.h \
   OpEnumerateUnmanagedData.h \
-  OpEnumerateUnmanagedDataMappings.h \
   OperationInfo.h \
   OperationParameter.h \
   OpGetRepositoryContent.h \

Modified: trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedData.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -67,30 +67,33 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (3 == m_packet.m_NumArguments)
+    if (4 == m_packet.m_NumArguments)
     {
-        STRING mappingName, dataTypeFilter;
-        INT32 depth;
-        m_stream->GetString(mappingName);
-        m_stream->GetString(dataTypeFilter);
-        m_stream->GetInt32(depth);
+        STRING path, select, filter;
+        bool recursive;
+        m_stream->GetString(path);
+        m_stream->GetBoolean(recursive);
+        m_stream->GetString(select);
+        m_stream->GetString(filter);
 
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(mappingName.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(path.c_str());
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(dataTypeFilter.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(recursive);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_INT32(depth);
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(select.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(filter.c_str());
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
-        Ptr<MgStringCollection> dataPaths =
-            m_service->EnumerateUnmanagedData(mappingName, dataTypeFilter, depth);
+        Ptr<MgByteReader> byteReader =
+            m_service->EnumerateUnmanagedData(path, recursive, select, filter);
         
-        EndExecution(dataPaths);
+        EndExecution(byteReader);
     }
     else
     {

Deleted: trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1,112 +0,0 @@
-//
-//  Copyright (C) 2004-2006  Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "ResourceServiceDefs.h"
-#include "OpEnumerateUnmanagedDataMappings.h"
-#include "ServerResourceService.h"
-#include "LogManager.h"
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Constructs the object.
-/// </summary>
-///----------------------------------------------------------------------------
-
-MgOpEnumerateUnmanagedDataMappings::MgOpEnumerateUnmanagedDataMappings()
-{
-}
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Destructs the object.
-/// </summary>
-///----------------------------------------------------------------------------
-
-MgOpEnumerateUnmanagedDataMappings::~MgOpEnumerateUnmanagedDataMappings()
-{
-}
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Executes the operation.
-/// </summary>
-///
-/// <exceptions>
-/// MgException
-/// </exceptions>
-///----------------------------------------------------------------------------
-
-void MgOpEnumerateUnmanagedDataMappings::Execute()
-{
-    ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpEnumerateUnmanagedDataMappings::Execute()\n")));
-    
-
-
-
-
-
-    MG_LOG_OPERATION_MESSAGE(L"EnumerateUnmanagedDataMappings");
-
-    MG_RESOURCE_SERVICE_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();
-
-        Ptr<MgStringCollection> mappings = m_service->EnumerateUnmanagedDataMappings();
-
-        EndExecution(mappings);
-    }
-    else
-    {
-        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
-        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
-    }
-
-    if (!m_argsRead)
-    {
-        throw new MgOperationProcessingException(L"MgOpEnumerateUnmanagedDataMappings.Execute",
-            __LINE__, __WFILE__, NULL, L"", NULL);
-    }
-
-    // Successful operation
-    MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
-
-    MG_RESOURCE_SERVICE_CATCH(L"MgOpEnumerateUnmanagedDataMappings.Execute")
-
-    if (mgException != NULL)
-    {
-
-
-        // Failed operation
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
-    }
-
-    // Add access log entry for operation
-    MG_LOG_OPERATION_MESSAGE_ACCESS_ENTRY();
-
-    MG_RESOURCE_SERVICE_THROW()
-}

Deleted: trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/OpEnumerateUnmanagedDataMappings.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1,33 +0,0 @@
-//
-//  Copyright (C) 2004-2006  Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MGOPENUMERATEUNMANAGEDDATAMAPPINGS_H
-#define MGOPENUMERATEUNMANAGEDDATAMAPPINGS_H
-
-#include "ResourceOperation.h"
-
-class MgOpEnumerateUnmanagedDataMappings : public MgResourceOperation
-{
-public:
-
-    MgOpEnumerateUnmanagedDataMappings();
-    virtual ~MgOpEnumerateUnmanagedDataMappings();
-
-    virtual void Execute();
-};
-
-#endif

Modified: trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/OperationInfo.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -47,7 +47,6 @@
 const STRING MgOperationName::GetResourceData=L"GETRESOURCEDATA";
 
 const STRING MgOperationName::EnumerateUnmanagedData=L"ENUMERATEUNMANAGEDDATA";
-const STRING MgOperationName::EnumerateUnmanagedDataMappings=L"ENUMERATEUNMANAGEDDATAMAPPINGS";
 
 const STRING MgOperationInfo::sm_currentVersion = L"1.0.0";
 const MgOperationParameter MgOperationInfo::sm_blankParameter;

Modified: trunk/MgDev/Server/src/Services/Resource/OperationInfo.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/OperationInfo.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/OperationInfo.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -52,7 +52,6 @@
     static const STRING GetResourceData;
 
     static const STRING EnumerateUnmanagedData;
-    static const STRING EnumerateUnmanagedDataMappings;
 };
 
 class MgOperationInfo

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceOperationFactory.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -46,7 +46,6 @@
 #include "OpGetResourceData.h"
 // Unmanaged Data APIs
 #include "OpEnumerateUnmanagedData.h"
-#include "OpEnumerateUnmanagedDataMappings.h"
 
 ///----------------------------------------------------------------------------
 /// <summary>
@@ -397,19 +396,6 @@
         }
         break;
 
-    case MgResourceService::opIdEnumerateUnmanagedDataMappings:
-        switch (operationVersion)
-        {
-        case 1:
-            handler.reset(new MgOpEnumerateUnmanagedDataMappings());
-            break;
-        default:
-            throw new MgInvalidOperationVersionException(
-                L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
-        }
-        break;
-
-
     default:
         throw new MgInvalidOperationException(
             L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1808,49 +1808,22 @@
 ///
 ///----------------------------------------------------------------------------
 
-MgStringCollection* MgServerResourceService::EnumerateUnmanagedData(
-	CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth)
+MgByteReader* MgServerResourceService::EnumerateUnmanagedData(
+	CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter)
 {
-    Ptr<MgStringCollection> dataPaths;
+    Ptr<MgByteReader> byteReader;
 
     MG_RESOURCE_SERVICE_TRY()
 
     MG_LOG_TRACE_ENTRY(L"MgServerResourceService::EnumerateUnmanagedData()");
 
-    dataPaths = MgUnmanagedDataManager::GetInstance()->EnumerateUnmanagedData(mappingName, dataTypeFilter, depth);
+    byteReader = MgUnmanagedDataManager::GetInstance()->EnumerateUnmanagedData(path, recursive, select, filter);
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.EnumerateUnmanagedData")
 
-    return dataPaths.Detach();
+    return byteReader.Detach();
 }
 
-///----------------------------------------------------------------------------
-/// <summary>
-/// Gets a list of unmanaged data mappings
-/// </summary>
-///
-/// <returns>
-/// Result containing the list of data mappings.
-/// </returns>
-///
-///----------------------------------------------------------------------------
-
-MgStringCollection* MgServerResourceService::EnumerateUnmanagedDataMappings()
-{
-    Ptr<MgStringCollection> mappings;
-
-    MG_RESOURCE_SERVICE_TRY()
-
-    MG_LOG_TRACE_ENTRY(L"MgServerResourceService::EnumerateUnmanagedDataMappings()");
-
-    mappings = MgUnmanagedDataManager::GetInstance()->EnumerateUnmanagedDataMappings();
-
-    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.EnumerateUnmanagedDataMappings")
-
-    return mappings.Detach();
-}
-
-
 ///////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Grants the specified roles to the specified users.

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -146,8 +146,7 @@
 
 	// Unmanaged Data APIs
 
-    virtual MgStringCollection* EnumerateUnmanagedData(CREFSTRING mappingName, CREFSTRING dataTypeFilter, INT32 depth);
-    virtual MgStringCollection* EnumerateUnmanagedDataMappings();
+    virtual MgByteReader* EnumerateUnmanagedData(CREFSTRING path, bool recursive, CREFSTRING select, CREFSTRING filter);
 
     // Site Security related methods
 

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj	2007-01-27 00:26:59 UTC (rev 1075)
@@ -500,30 +500,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\OpEnumerateUnmanagedDataMappings.cpp"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath=".\OpEnumerateUnmanagedDataMappings.h"
-				>
-			</File>
-			<File
 				RelativePath=".\OperationInfo.cpp"
 				>
 				<FileConfiguration

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -55,7 +55,6 @@
 #include "OpSetResourceData.cpp"
 #include "OpUpdateRepository.cpp"
 #include "OpEnumerateUnmanagedData.cpp"
-#include "OpEnumerateUnmanagedDataMappings.cpp"
 #include "Repository.cpp"
 #include "RepositoryManager.cpp"
 #include "ResourceContainer.cpp"

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/Makefile.am
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/Makefile.am	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/Makefile.am	2007-01-27 00:26:59 UTC (rev 1075)
@@ -42,6 +42,7 @@
   OpRegisterServicesOnServers.cpp \
   OpRenameLog.cpp \
   OpSetConfigurationProperties.cpp \
+  OpRemoveConfigurationProperties.cpp \
   OpSetDocument.cpp \
   OpTakeOffline.cpp \
   OpUnregisterServicesOnServers.cpp \

Added: trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -0,0 +1,120 @@
+//
+//  Copyright (C) 2004-2006  Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "MapGuideCommon.h"
+#include "ServerAdminService.h"
+#include "OpRemoveConfigurationProperties.h"
+#include "LogManager.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// Constructs the object.
+/// </summary>
+
+MgOpRemoveConfigurationProperties::MgOpRemoveConfigurationProperties()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// Destructs the object.
+/// </summary>
+
+MgOpRemoveConfigurationProperties::~MgOpRemoveConfigurationProperties()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// <summary>
+/// Executes the operation.
+/// </summary>
+///
+/// <exceptions>
+/// MgException
+/// </exceptions>
+void MgOpRemoveConfigurationProperties::Execute()
+{
+    ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpRemoveConfigurationProperties::Execute()\n")));
+    
+
+
+
+
+
+    MG_LOG_OPERATION_MESSAGE(L"RemoveConfigurationProperties");
+
+    MG_TRY()
+
+    MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+
+    ACE_ASSERT(m_stream != NULL);
+
+    if (2 == m_packet.m_NumArguments)
+    {
+        STRING propertySection;
+        m_stream->GetString(propertySection);
+
+        Ptr<MgPropertyCollection> pPropertyCollection;
+        pPropertyCollection = (MgPropertyCollection*)m_stream->GetObject();
+
+        BeginExecution();
+
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(propertySection.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgPropertyCollection");
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+        // Validate operation
+        Validate();
+
+        m_service->RemoveConfigurationProperties(propertySection, pPropertyCollection);
+
+        
+        EndExecution();
+    }
+    else
+    {
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+    }
+
+    if (!m_argsRead)
+    {
+        throw new MgOperationProcessingException(L"MgOpRemoveConfigurationProperties.Execute",
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    // Successful operation
+    MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+
+    MG_CATCH(L"MgOpRemoveConfigurationProperties.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()
+}

Added: trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.h
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/OpRemoveConfigurationProperties.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -0,0 +1,33 @@
+//
+//  Copyright (C) 2004-2006  Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef MGOPREMOVECONFIGURATIONPROPERTIES_H
+#define MGOPREMOVECONFIGURATIONPROPERTIES_H
+
+#include "ServerAdminOperation.h"
+
+class MgOpRemoveConfigurationProperties : public MgServerAdminOperation
+{
+public:
+
+    MgOpRemoveConfigurationProperties();
+    virtual ~MgOpRemoveConfigurationProperties();
+
+    virtual void Execute();
+};
+
+#endif

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminOperationFactory.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -43,6 +43,7 @@
 #include "OpRegisterServicesOnServers.h"
 #include "OpRenameLog.h"
 #include "OpSetConfigurationProperties.h"
+#include "OpRemoveConfigurationProperties.h"
 #include "OpSetDocument.h"
 #include "OpSetLogDelimiter.h"
 #include "OpSetMaximumLogSize.h"
@@ -113,6 +114,17 @@
         }
         break;
 
+    case MgServerAdminServiceOpId::RemoveConfigurationProperties:
+        switch (operationVersion)
+        {
+        case 1:
+            handler.reset(new MgOpRemoveConfigurationProperties());
+            break;
+        default:
+            break;
+        }
+        break;
+
     case MgServerAdminServiceOpId::BringOnline:
         switch (operationVersion)
         {

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -504,6 +504,28 @@
 
 //////////////////////////////////////////////////////////////////
 /// <summary>
+/// Removes the configuration properties for the specified property section.
+/// If the properties are not specified, then the entire section will be removed.
+/// </summary>
+void MgServerAdminService::RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties)
+{
+    MG_TRY()
+
+    MG_LOG_TRACE_ENTRY(L"MgServerAdminService::SetConfigurationProperties()");
+
+    MgServerManager* pMan = MgServerManager::GetInstance();
+    if (NULL == pMan)
+    {
+        throw new MgNullReferenceException(L"MgServerAdminService::SetConfigurationProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    pMan->RemoveConfigurationProperties(propertySection, properties);
+
+    MG_CATCH_AND_THROW(L"MgServerAdminService.SetConfigurationProperties");
+}
+
+//////////////////////////////////////////////////////////////////
+/// <summary>
 /// Gets the information properties for the server.
 /// </summary>
 MgPropertyCollection* MgServerAdminService::GetInformationProperties()

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -39,6 +39,7 @@
 public:
     MgPropertyCollection* GetConfigurationProperties(CREFSTRING propertySection);
     void SetConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
+    void RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
 
     void BringOnline();
     void TakeOffline();

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.vcproj	2007-01-27 00:26:59 UTC (rev 1075)
@@ -706,6 +706,30 @@
 				>
 			</File>
 			<File
+				RelativePath=".\OpRemoveConfigurationProperties.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\OpRemoveConfigurationProperties.h"
+				>
+			</File>
+			<File
 				RelativePath=".\OpRenameLog.cpp"
 				>
 				<FileConfiguration

Modified: trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Server/src/Services/ServerAdmin/ServerAdminServiceBuild.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -40,6 +40,7 @@
 #include "OpRegisterServicesOnServers.cpp"
 #include "OpRenameLog.cpp"
 #include "OpSetConfigurationProperties.cpp"
+#include "OpRemoveConfigurationProperties.cpp"
 #include "OpSetDocument.cpp"
 #include "OpSetLogDelimiter.cpp"
 #include "OpSetMaximumLogSize.cpp"

Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddataform.html	2007-01-27 00:26:59 UTC (rev 1075)
@@ -12,12 +12,14 @@
 <input type="text" name="VERSION" value="1.0.0" size="10">
 <p> Locale:
 <input type="text" name="LOCALE" value="en" size="10">
-<p> Mapping Name:
-<input type="text" name="MAPPINGNAME" value="" size="30">
-<p> Data Filter Type:
-<input type="text" name="DATATYPEFILTER" value="" size="30">
-<p> Depth:
-<input type="text" name="DEPTH" value="-1" size="10">
+<p> Path:
+<input type="text" name="PATH" value="" size="30">
+<p> Recursive:
+<input type="text" name="RECURSIVE" value="FALSE" size="30">
+<p> Select:
+<input type="text" name="SELECT" value="FOLDERS" size="30">
+<p> Filter:
+<input type="text" name="FILTER" value="" size="30">
 <p>
 <input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
 </form>

Deleted: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddatamappingsform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddatamappingsform.html	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateunmanageddatamappingsform.html	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1,19 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<script type="text/javascript" src="setactiontarget.js" >
-</script>
-</head>
-<body>
-<form name="input" action="" method="get">
-<b>Operation:</b>
-<input type="text" name="OPERATION" value="ENUMERATEUNMANAGEDDATAMAPPINGS" size="50">
-<p> Version:
-<input type="text" name="VERSION" value="1.0.0" size="10">
-<p> Locale:
-<input type="text" name="LOCALE" value="en" size="10">
-<p>
-<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
-</form>
-</body>
-</html>

Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/resourceserviceapi.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/resourceserviceapi.html	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/resourceserviceapi.html	2007-01-27 00:26:59 UTC (rev 1075)
@@ -29,7 +29,6 @@
 <li><a href="changeresourceownerform.html" target="showform">ChangeResourceOwner</a>
 <li><a href="inheritpermissionsfromform.html" target="showform">InheritPermissionsFrom</a>
 <p>
-<li><a href="enumerateunmanageddatamappingsform.html" target="showform">EnumerateUnmanagedDataMappings</a>
 <li><a href="enumerateunmanageddataform.html" target="showform">EnumerateUnmanagedData</a>
 </ul>
 </body>

Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -36,15 +36,18 @@
 
     Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();
 
-    // Get mapping name
-    m_mappingName = hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingName);
+    // Get path
+    m_path = hrParam->GetParameterValue(MgHttpResourceStrings::reqPath);
 
-    // Get data type filter
-    m_dataTypeFilter = hrParam->GetParameterValue(MgHttpResourceStrings::reqDataTypeFilter);
+    // Get the recursive flag
+    STRING recursive = hrParam->GetParameterValue(MgHttpResourceStrings::reqRecursive);
+    m_recursive = SZ_EQI(recursive.c_str(), L"TRUE");
 
-	// Get depth and convert to integer
-    string depth_str = MgUtil::WideCharToMultiByte(hrParam->GetParameterValue(MgHttpResourceStrings::reqDepth));
-    m_depth = atoi(depth_str.c_str());
+    // Get select
+    m_select = hrParam->GetParameterValue(MgHttpResourceStrings::reqSelect);
+
+    // Get filter
+    m_filter = hrParam->GetParameterValue(MgHttpResourceStrings::reqFilter);
 }
 
 /// <summary>
@@ -69,8 +72,8 @@
     Ptr<MgResourceService> mgprService = (MgResourceService*)(CreateService(MgServiceType::ResourceService));
 
     // call the C++ API
-    Ptr<MgStringCollection> dataPaths = mgprService->EnumerateUnmanagedData(m_mappingName, m_dataTypeFilter, m_depth);
-    hResult->SetResultObject(dataPaths, MgMimeType::Xml);
+    Ptr<MgByteReader> byteReaderResult = mgprService->EnumerateUnmanagedData(m_path, m_recursive, m_select, 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-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedData.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -44,9 +44,10 @@
     void Execute(MgHttpResponse& hResponse);
 
 private:
-    STRING m_mappingName;
-    STRING m_dataTypeFilter;
-    INT32 m_depth;
+    STRING m_path;
+    bool m_recursive;
+    STRING m_select;
+    STRING m_filter;
 };
 
 #endif

Deleted: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1,64 +0,0 @@
-//
-//  Copyright (C) 2004-2006  Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "HttpHandler.h"
-#include "HttpEnumerateUnmanagedDataMappings.h"
-
-HTTP_IMPLEMENT_CREATE_OBJECT(MgHttpEnumerateUnmanagedDataMappings)
-
-/// <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>
-MgHttpEnumerateUnmanagedDataMappings::MgHttpEnumerateUnmanagedDataMappings(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 MgHttpEnumerateUnmanagedDataMappings::Execute(MgHttpResponse& hResponse)
-{
-    Ptr<MgHttpResult> hResult;
-
-    MG_HTTP_HANDLER_TRY()
-
-    hResult = hResponse.GetResult();
-
-    // Check common parameters
-    ValidateCommonParameters();
-
-    // Create ProxyResourceService instance
-    Ptr<MgResourceService> mgprService = (MgResourceService*)(CreateService(MgServiceType::ResourceService));
-
-    // call the C++ API
-    Ptr<MgStringCollection> mappings = mgprService->EnumerateUnmanagedDataMappings();
-    hResult->SetResultObject(mappings, MgMimeType::Xml);
-
-    MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateUnmanagedDataMappings.Execute")
-}

Deleted: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUnmanagedDataMappings.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -1,47 +0,0 @@
-//
-//  Copyright (C) 2004-2006  Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef _RS_ENUMERATE_UNMANAGED_DATA_MAPPINGS_H
-#define _RS_ENUMERATE_UNMANAGED_DATA_MAPPINGS_H
-
-class MgHttpEnumerateUnmanagedDataMappings : 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>
-    MgHttpEnumerateUnmanagedDataMappings(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);
-};
-
-#endif

Modified: trunk/MgDev/Web/src/HttpHandler/HttpHandler.vcproj
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpHandler.vcproj	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpHandler.vcproj	2007-01-27 00:26:59 UTC (rev 1075)
@@ -474,30 +474,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\HttpEnumerateUnmanagedDataMappings.cpp"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath=".\HttpEnumerateUnmanagedDataMappings.h"
-				>
-			</File>
-			<File
 				RelativePath=".\HttpGetRepositoryContent.cpp"
 				>
 				<FileConfiguration

Modified: trunk/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpHandlerBuild.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -113,7 +113,6 @@
 #include "HttpKmlGetLayer.cpp"
 #include "HttpKmlGetFeatures.cpp"
 #include "HttpEnumerateUnmanagedData.cpp"
-#include "HttpEnumerateUnmanagedDataMappings.cpp"
 #include "WmsMapUtil.cpp"
 
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpRequest.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -38,7 +38,6 @@
 #include "HttpEnumerateUsers.h"
 #include "HttpEnumerateGroups.h"
 #include "HttpEnumerateUnmanagedData.h"
-#include "HttpEnumerateUnmanagedDataMappings.h"
 
 // Http Drawing Service operations
 #include "HttpGetDrawing.h"
@@ -386,7 +385,6 @@
     httpClassCreators[MgHttpResourceStrings::opCsGetBaseLibrary] = MgHttpCsGetBaseLibrary::CreateObject;
     httpClassCreators[MgHttpResourceStrings::opCsIsValid] = MgHttpCsIsValid::CreateObject;
     httpClassCreators[MgHttpResourceStrings::opEnumerateUnmanagedData] = MgHttpEnumerateUnmanagedData::CreateObject;
-    httpClassCreators[MgHttpResourceStrings::opEnumerateUnmanagedDataMappings] = MgHttpEnumerateUnmanagedDataMappings::CreateObject;
 
     httpPostHandlerCreators.push_back(MgHttpWfsGetCapabilities::ProcessPostRequest);
     httpPostHandlerCreators.push_back(MgHttpWfsDescribeFeatureType::ProcessPostRequest);

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-01-27 00:26:59 UTC (rev 1075)
@@ -98,8 +98,10 @@
 const STRING MgHttpResourceStrings::reqPackage = L"PACKAGE";
 const STRING MgHttpResourceStrings::reqOwner = L"OWNER";
 const STRING MgHttpResourceStrings::reqIncludeDescendants = L"INCLUDEDESCENDANTS";
-const STRING MgHttpResourceStrings::reqMappingName = L"MAPPINGNAME";
-const STRING MgHttpResourceStrings::reqDataTypeFilter = L"DATATYPEFILTER";
+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
 const STRING MgHttpResourceStrings::opEnumerateRepositories = L"ENUMERATEREPOSITORIES";
@@ -128,7 +130,6 @@
 const STRING MgHttpResourceStrings::opGetResourceData = L"GETRESOURCEDATA";
 
 const STRING MgHttpResourceStrings::opEnumerateUnmanagedData = L"ENUMERATEUNMANAGEDDATA";
-const STRING MgHttpResourceStrings::opEnumerateUnmanagedDataMappings = L"ENUMERATEUNMANAGEDDATAMAPPINGS";
 
 // Predefined Feature Service Request Parameters
 const STRING MgHttpResourceStrings::reqFeatProperty = L"PROPERTY";

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-01-27 00:26:59 UTC (rev 1075)
@@ -102,8 +102,10 @@
     static const STRING reqPackage;
     static const STRING reqOwner;
     static const STRING reqIncludeDescendants;
-    static const STRING reqMappingName;
-    static const STRING reqDataTypeFilter;
+    static const STRING reqPath;
+    static const STRING reqRecursive;
+    static const STRING reqSelect;
+    static const STRING reqFilter;
 
     // PREDEFINED FEATURE REQUEST PARAMETERS
     static const STRING reqFeatProperty;
@@ -241,7 +243,6 @@
     static const STRING opGetResourceData;
 
     static const STRING opEnumerateUnmanagedData;
-    static const STRING opEnumerateUnmanagedDataMappings;
 
     // Feature services
     static const STRING opGetFeatureProviders;

Modified: trunk/MgDev/Web/src/HttpHandler/Makefile.am
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/Makefile.am	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/HttpHandler/Makefile.am	2007-01-27 00:26:59 UTC (rev 1075)
@@ -45,7 +45,6 @@
   HttpEnumerateResourceReferences.cpp \
   HttpEnumerateResources.cpp \
   HttpEnumerateUnmanagedData.cpp \
-  HttpEnumerateUnmanagedDataMappings.cpp \
   HttpEnumerateUsers.cpp \
   HttpExecuteSqlQuery.cpp \
   HttpGetCapabilities.cpp \
@@ -159,7 +158,6 @@
   HttpEnumerateResourceReferences.h \
   HttpEnumerateResources.h \
   HttpEnumerateUnmanagedData.h \
-  HttpEnumerateUnmanagedDataMappings.h \
   HttpEnumerateUsers.h \
   HttpExecuteSqlQuery.h \
   HttpGetCapabilities.h \

Added: trunk/MgDev/Web/src/mapadmin/addunmanageddata.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/addunmanageddata.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/addunmanageddata.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -0,0 +1,163 @@
+<?php  // PHP Preprocessing --------------------------------------------------------------------------------------------------------------
+
+//
+//  Copyright (C) 2004-2006  Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+try
+{
+    include 'resizableadmin.php';
+
+    LoadSessionVars();
+
+    // Did the user logout?
+    CheckForLogout();
+
+    // Are we cancelling?  If so, there is nothing to do.
+    CheckForCancel( 'unmanageddatamanagement.php' );
+
+    // Define local vars
+    $menuCategory = UNMANAGEDDATA_MANAGEMENT_MENU_ITEM;
+    $menuItem = ADD_UNMANAGEDDATA_MENU_ITEM;
+    $pageTitle = ADD_UNMANAGEDDATA_TITLE;
+    $helpPage = 'HelpDocs/adding_and_deleting_unmanageddata.htm';
+    $pageName = 'AddUnmanagedDataPage';
+    $formName = 'AddUnmanagedDataForm';
+    $homePage = 'unmanageddatamanagement.php';
+
+    $mappingName = "";
+    $mappingNameID = 'mappingName';
+    $location = "";
+    $locationID = 'location';
+
+    $confirmationMsg = "";
+    $errorMsg = "";
+
+    $mappings = array();
+
+    $siteServerAddress = "";
+    $selectedServerID = "Server";
+    $serverAdmin = 0;
+    $confirmationMsg = "";
+    $errorMsg = "";
+    $pageEnabled = false;
+
+    // Get Server
+    $siteServerAddress = $site->GetCurrentSiteAddress();
+    GetServerSelection( $selectedServerID, $selectedServer );
+    $serverRec = GetDataForServer( $selectedServer );
+    if ( $serverRec == NULL )
+        throw new Exception( sprintf( $errNotFound, $selectedServer ) );
+    if ( !$serverRec->poweredUp )
+        throw new Exception( sprintf( $errServerIsDown, $selectedServer ) );
+
+    // Get props values from server
+    $serverAdmin = new MgServerAdmin();
+    $serverAdmin->Open( $selectedServer, $userInfo );
+
+    $mappings = GetUnmanagedDataMappings( $serverAdmin );
+
+
+    // Is this our first time here?
+    if ( FirstTimeHere( $pageName ) )
+    {
+        // do nothing here
+    }
+    // Otherwise, Save button must have been hit
+    else
+    {
+        // Get submitted data
+        if ( array_key_exists( $mappingNameID, $_POST ) )
+            $mappingName = $_POST[ $mappingNameID ];
+        if ( array_key_exists( $locationID, $_POST ) )
+            $location = $_POST[ $locationID ];
+
+        // Validate inputs.
+        if ( empty( $mappingName ) )
+            throw new Exception( $errMappingNameMissing );
+        if ( array_key_exists( $mappingName, $mappings ) )
+            throw new Exception( $errMappingNameExists );
+        if ( empty( $location ) )
+            throw new Exception( $errLocationMissing );
+
+        // Add new mapping.
+        SetUnmanagedDataMapping( $serverAdmin, $mappingName, $location );
+        $serverAdmin->Close();
+
+        // Everything is OK.
+        $confirmationMsg = sprintf( $confSuccessfulAddition, $mappingName );
+        $selectedMapping = $mappingName;
+        SaveSessionVars();
+        header( 'Location:  unmanageddatamanagement.php?'.strip_tags(SID) );
+        exit();
+    }
+}
+catch ( MgException $e )
+{
+    CheckForFatalMgException( $e );
+    $errorMsg = $e->GetMessage();
+}
+catch ( Exception $e )
+{
+    $errorMsg = $e->getMessage();
+}
+?>
+
+<!-- PAGE DEFINITION ----------------------------------------------------------------------------------------------------->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+
+    <?php OutputHeader( $pageTitle ); ?>
+
+<body>
+    <table cellspacing="0" cellpadding="0" border="0" class="main">
+        <tr>
+            <?php DisplaySiteHeader( true, true, true, true, $formName, $homePage ); ?>
+        </tr>
+        <tr>
+            <?php DisplayLefthandSash( $menuItem ); ?>
+
+            <!-- Contents Area ------------------------------------------------------------------------------------------------->
+            <?php BeginContentArea( $formName ); ?>
+
+                <?php
+                    DeclareHiddenVars( $pageName );
+                    DisplayTitleBar( $pageTitle, $helpPage );
+                    DisplaySaveCancelBar();
+                    DisplayConfirmationMsg( $confirmationMsg );
+                    DisplayErrorMsg( $errorMsg );
+                ?>
+
+                <!-- Input Area -->
+                <table border="0" cellspacing="0" class="inputForm">
+                    <tr>
+                        <td class="addUserInputLabel">Mapping Name :</td>
+                        <td class="inputFormValue"><input class="inputFormValue" name="<?php echo $mappingNameID?>" type="text" value="<?php echo $mappingName?>"></td>
+                    </tr>
+                    <tr>
+                        <td class="addUserInputLabel">Location :</td>
+                        <td class="inputFormValue"><input class="inputFormValue" name="<?php echo $locationID?>" type="text" value="<?php echo $location?>"></td>
+                    </tr>
+                </table>
+            <?php EndContentArea( true, $formName, $mappingNameID ); ?>
+            <!-- End of Contents Area --------------------------------------------------------------------------------------------->
+
+        </tr>
+
+    </table>
+</body>
+
+</html>

Added: trunk/MgDev/Web/src/mapadmin/editunmanageddata.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/editunmanageddata.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/editunmanageddata.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -0,0 +1,175 @@
+<?php  // PHP Preprocessing --------------------------------------------------------------------------------------------------------------
+
+//
+//  Copyright (C) 2004-2006  Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+try
+{
+    include 'resizableadmin.php';
+
+    LoadSessionVars();
+
+    // Did the user logout?
+    CheckForLogout();
+
+    // Are we cancelling?  If so, there is nothing to do.
+    CheckForCancel( 'unmanageddatamanagement.php' );
+
+    // Local global vals.
+    $menuCategory = UNMANAGEDDATA_MANAGEMENT_MENU_ITEM;
+    $menuItem = EDIT_UNMANAGEDDATA_MENU_ITEM;
+    $pageTitle = EDIT_UNMANAGEDDATA_TITLE;
+    $helpPage = 'HelpDocs/adding_and_deleting_unmanageddata.htm';
+    $pageName = 'EditUnmanagedDataPage';
+    $formName = 'EditUnmanagedDataForm';
+    $homePage = 'unmanageddatamanagement.php';
+
+    $selectedMappingID = 'SelectedMapping';
+
+    $mappingName = "";
+    $mappingNameID = 'mappingName';
+    $location = "";
+    $locationID = 'location';
+
+    $errorMsg = "";
+    $confirmationMsg = "";
+
+    $mappings = array();
+
+    $siteServerAddress = "";
+    $selectedServerID = "Server";
+    $serverAdmin = 0;
+    $confirmationMsg = "";
+    $errorMsg = "";
+    $pageEnabled = false;
+
+    // Get Server
+    $siteServerAddress = $site->GetCurrentSiteAddress();
+    GetServerSelection( $selectedServerID, $selectedServer );
+    $serverRec = GetDataForServer( $selectedServer );
+    if ( $serverRec == NULL )
+        throw new Exception( sprintf( $errNotFound, $selectedServer ) );
+    if ( !$serverRec->poweredUp )
+        throw new Exception( sprintf( $errServerIsDown, $selectedServer ) );
+
+    // Get props values from server
+    $serverAdmin = new MgServerAdmin();
+    $serverAdmin->Open( $selectedServer, $userInfo );
+
+    $mappings = GetUnmanagedDataMappings( $serverAdmin );
+
+
+    // Is this our first time here?
+    if ( FirstTimeHere( $pageName ) )
+    {
+        // Was the selected user passed in the URL?
+        if ( array_key_exists( $selectedMappingID, $_GET ) )
+        $selectedMapping = $_GET[ $selectedMappingID ];
+
+        // Get info for selected user
+        $mappingName = $selectedMapping;
+        $location = $mappings[ $mappingName ];
+
+        $serverAdmin->Close();
+    }
+    // The save button was hit.
+    else
+    {
+        // Get submitted data
+        if ( array_key_exists( $mappingNameID, $_POST ) )
+            $mappingName = $_POST[ $mappingNameID ];
+        if ( array_key_exists( $locationID, $_POST ) )
+            $location = $_POST[ $locationID ];
+
+        // Validate inputs.
+        if ( empty( $mappingName ) )
+            throw new Exception( $errMappingNameMissing );
+        if ( empty( $location ) )
+            throw new Exception( $errLocationMissing );
+
+        // Update parameters of user.
+        SetUnmanagedDataMapping( $serverAdmin, $mappingName, $location );
+        if ($mappingName != $selectedMapping)
+        {
+            DeleteUnmanagedDataMapping( $serverAdmin, $selectedMapping );
+        }
+        $serverAdmin->Close();
+
+        // Everything is OK.
+        $confirmationMsg = sprintf( $confSuccessfulAddition, $mappingName );
+        $selectedMapping = $mappingName;
+        SaveSessionVars();
+        header( 'Location:  unmanageddatamanagement.php?'.strip_tags(SID) );
+        exit();
+    }
+}
+catch ( MgException $e )
+{
+    CheckForFatalMgException( $e );
+    $errorMsg = $e->GetMessage();
+}
+catch ( Exception $e )
+{
+    $errorMsg = $e->getMessage();
+}
+?>
+
+<!-- PAGE DEFINITION ----------------------------------------------------------------------------------------------------->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+
+    <?php OutputHeader( $pageTitle ); ?>
+
+<body>
+    <table cellspacing="0" cellpadding="0" border="0" class="main">
+        <tr>
+            <?php DisplaySiteHeader( true, true, true, true, $formName, $homePage ); ?>
+        </tr>
+        <tr>
+            <?php DisplayLefthandSash( $menuItem ); ?>
+
+            <!-- Contents Area ------------------------------------------------------------------------------------------------->
+            <?php BeginContentArea( $formName ); ?>
+
+                <?php
+                    DeclareHiddenVars( $pageName );
+                    DisplayTitleBar( $pageTitle, $helpPage );
+                    DisplaySaveCancelBar();
+                    DisplayConfirmationMsg( $confirmationMsg );
+                    DisplayErrorMsg( $errorMsg );
+                ?>
+
+                <!-- Input Area -->
+                <table border="0" cellspacing="0" class="inputForm">
+                    <tr>
+                        <td class="editUserInputLabel">Mapping Name :</td>
+                        <td class="inputFormValue"><input class="inputFormValue" name="<?php echo $mappingNameID?>" type="text" value="<?php echo $mappingName?>" size="60"></td>
+                    </tr>
+                    <tr>
+                        <td class="editUserInputLabel">Location :</td>
+                        <td class="inputFormValue"><input class="inputFormValue" name="<?php echo $locationID?>" type="text" value="<?php echo $location?>" size="60"></td>
+                    </tr>
+                </table>
+            <?php EndContentArea( true, $formName, $mappingNameID );?>
+            <!-- End of Contents Area --------------------------------------------------------------------------------------------->
+
+        </tr>
+
+    </table>
+</body>
+
+</html>

Modified: trunk/MgDev/Web/src/mapadmin/msgs.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/msgs.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/msgs.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -29,6 +29,9 @@
     $errUserNameMissing = "User's name is not specified.";
     $errNoGroupSelectionForDelete = "Group must be selected in order to delete.";
     $errGroupNameMissing = "Group's name is not specified.";
+    $errMappingNameMissing = "Mapping name is not specified.";
+    $errMappingNameExists = "Mapping name already exists.";
+    $errLocationMissing = "Location is not specified.";
     $errInvalidInput = "Input values are invalid.";
     $errInvalidServerName = "Server name must be specified.";
     $errInvalidServerAddress = "Server IP address must be specified.";
@@ -67,9 +70,9 @@
     $errServerAddressMissing = "Server address is not specified.";
     $errServerIsDown = "%s is down.";
     $errCannotOpenFolder = 'Cannot access "%s".  Please ensure that the path exists and you have access permission.';
-	$errNoPackageSpecified = "No package specified.";
-	$errNoResourceSpecified = "No resource folder specified.";
-	$errCannotCreatePackage = "Cannot create package %s from folder %s:  ";
+    $errNoPackageSpecified = "No package specified.";
+    $errNoResourceSpecified = "No resource folder specified.";
+    $errCannotCreatePackage = "Cannot create package %s from folder %s:  ";
     $errNoPackagesFound = "No packages found.";
     $errNoPackageLog = "No package log specified.";
     $errNoPackageSelectionForDelete = "Package must be selected in order to delete.";
@@ -83,7 +86,7 @@
     $errInvalidTileCachePath = "Tile service tile cache path must be specified.";
     $errInvalidSessionTimeOut = "Site service session timeout is invalid.";
     $errInvalidSessionTimerInt = "Site service session timer interval is invalid.";
-	$errCannotGetPackageStatus = "Cannot get package status: %s";
+    $errCannotGetPackageStatus = "Cannot get package status: %s";
 
     // Confirmation Messages:
     $confSuccessfulDeletion = "%s has been successfully deleted.";

Modified: trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -68,6 +68,9 @@
     define( 'CONFIGURE_SERVICES_TITLE',         "Configure Services" );
     define( 'LOG_MANAGEMENT_TITLE',             "Manage Logs" );
     define( 'SELECT_SITE_SERVER_TITLE',         "Select Site Server" );
+    define( 'UNMANAGEDDATA_MANAGEMENT_TITLE',   "Configure Unmanaged Data" );
+    define( 'ADD_UNMANAGEDDATA_TITLE',          "Add Mapping" );
+    define( 'EDIT_UNMANAGEDDATA_TITLE',         "Edit Mapping" );
 
     define( 'ADD_GROUP_TITLE',                  "Add Group" );
     define( 'EDIT_GROUP_TITLE',                 "Edit Group" );
@@ -84,6 +87,14 @@
 
     define( 'CONFIGURE_WFS_TITLE',              "Configure WFS" );
 
+
+    define( 'UNMANAGEDDATA_MANAGEMENT_MENU_ITEM',                    "Configure Unmanaged Data" );
+    define( 'ADD_UNMANAGEDDATA_MENU_ITEM',                           "Add Mapping" );
+    define( 'EDIT_UNMANAGEDDATA_MENU_ITEM',                          "Edit Mapping" );
+    $unmanagedDataMenuGroup[ UNMANAGEDDATA_MANAGEMENT_MENU_ITEM ] =  'unmanageddatamanagement.php';
+    $unmanagedDataMenuGroup[ ADD_UNMANAGEDDATA_MENU_ITEM ] =         'addunmanageddata.php';
+    $unmanagedDataMenuGroup[ EDIT_UNMANAGEDDATA_MENU_ITEM ] =        'editunmanageddata.php';
+
     define( 'HELP_TITLE',                       "Help" );
 
 
@@ -343,7 +354,7 @@
         $class = "navLinkHeading";
         foreach( $menuGroup as $menuItem => $href )
         {
-            if ( $currMenuItem != $menuItem && ($menuItem == EDIT_GROUP_MENU_ITEM || $menuItem == EDIT_USER_MENU_ITEM) )
+            if ( $currMenuItem != $menuItem && ($menuItem == EDIT_GROUP_MENU_ITEM || $menuItem == EDIT_USER_MENU_ITEM || $menuItem == EDIT_UNMANAGEDDATA_MENU_ITEM ) )
                 continue;
             echo '      <tr>',"\n";
             if ( $currMenuItem == $menuItem )
@@ -366,6 +377,7 @@
         global $packagesMenuGroup;
         global $wmsMenuGroup;
         global $wfsMenuGroup;
+        global $unmanagedDataMenuGroup;
 
         echo '<td class="lhSash">',"\n";
         echo '  <table cellspacing="0" cellpadding="0" border="0">',"\n";
@@ -384,7 +396,8 @@
         echo "<tr><td><hr></td></tr>\n";
         DisplayMenuGroup( $currMenuItem, CONFIGURE_WFS_MENU_ITEM, $wfsMenuGroup );
         echo "<tr><td><hr></td></tr>\n";
-
+        DisplayMenuGroup( $currMenuItem, UNMANAGEDDATA_MANAGEMENT_MENU_ITEM, $unmanagedDataMenuGroup );
+        echo "<tr><td><hr></td></tr>\n";
         echo '  </table>',"\n";
         echo '</td>',"\n";
     }
@@ -455,11 +468,11 @@
             echo '<br>',"\n";
         }
     }
-    
+
     function DisplaySiteServerSelector( $selectedSiteServerID )
     {
         global $site;
-        
+
         echo '<select class="serverSelector" name="',$selectedSiteServerID.NO_PERSISTENCE_FLAG,'" size="1" >', "\n";
         for($i = 0; $i < $site->GetSiteServerCount(); $i++)
         {
@@ -474,7 +487,7 @@
         }
         echo '</select>', "\n";
     }
-    
+
     function GetSiteServerSelection( $selectedSiteServerID )
     {
         global $site;
@@ -1291,6 +1304,7 @@
             $props->dataCacheSize = $post[ FEATURE_SERVICE_DATA_CACHE_SIZE_ID ];
     }
 
+
     function DisplayFeatureServicePropVals( $enabled, $props )
     {
         $sectionFields = array( FEATURE_SERVICE_CONN_POOL_SIZE_ID, FEATURE_SERVICE_CONN_TIMEOUT_ID, FEATURE_SERVICE_CONN_TIMER_INT_ID, FEATURE_SERVICE_DATA_CACHE_SIZE_ID );

Modified: trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -143,6 +143,11 @@
         // Parse XML in $buffer
         parseUnicodeData( $buffer, $targetTable, 'User', 'userRecParser' );
 
+        // test
+        echo '$targetTable==> ';
+        echo print_r($targetTable);
+
+
         SortTable( $targetTable, $userSortColumn, $userSortDirection );
     }
 
@@ -858,6 +863,64 @@
         return $versionProp->GetValue();
     }
 
+    function GetUnmanagedDataMappings( $serverAdmin )
+    {
+        $mappings = array();
+        $props = $serverAdmin->GetConfigurationProperties( MgConfigProperties::UnmanagedDataMappingsSection );
+
+        for ( $i = 0; $i < $props->GetCount(); $i++)
+        {
+            $prop = $props->GetItem($i);
+            $mappings[$prop->GetName()] = $prop->GetValue();
+        }
+
+        return $mappings;
+    }
+
+    // if $mappingName already exists, then that mapping is updated
+    // if $mappingName does NOT exist, it is added
+    function SetUnmanagedDataMapping( $serverAdmin, $mappingName, $location )
+    {
+        $props = new MgPropertyCollection();
+        $prop = new MgStringProperty( $mappingName, $location );
+
+        $props->Add( $prop );
+
+        $serverAdmin->SetConfigurationProperties( MgConfigProperties::UnmanagedDataMappingsSection, $props );
+    }
+
+    function DeleteUnmanagedDataMapping( $serverAdmin, $mappingName )
+    {
+        $success = false;
+
+        $props = new MgPropertyCollection();
+        $prop = new MgStringProperty( $mappingName, "" ); // value doesn't matter
+        $props->Add( $prop );
+
+        $serverAdmin->RemoveConfigurationProperties( MgConfigProperties::UnmanagedDataMappingsSection, $props );
+        $success = true;
+
+        return $success;
+    }
+
+    function LoadMappingTable( &$targetTable, $table, $firstIndex, $lastIndex )
+    {
+        $targetTable = array();
+
+        $iMapping = -1;
+        foreach ( $table as $key => $val )
+        {
+            $iMapping++;
+            if ( $iMapping < $firstIndex )
+                continue;
+            if ( $iMapping > $lastIndex )
+                break;
+
+            $targetTable[ $key ] = $val;
+        }
+    }
+
+
     ////// Properties //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
     class GeneralPropsRecord
@@ -1454,12 +1517,12 @@
     $logDelimiters[ SPACE_DELIMITER ] = " ";
     $logDelimiters[ NO_DELIMITER ] = "";
 
-	define( 'ARCHIVE_NONE',			"None" );
+    define( 'ARCHIVE_NONE',         "None" );
     define( 'ARCHIVE_DAILY',        "Day" );
     define( 'ARCHIVE_MONTHLY',        "Month" );
     define( 'ARCHIVE_YEARLY',        "Year" );
-    $archiveFrequencies[ ARCHIVE_NONE	 ] = "";
-	$archiveFrequencies[ ARCHIVE_DAILY   ] = "%d";
+    $archiveFrequencies[ ARCHIVE_NONE    ] = "";
+    $archiveFrequencies[ ARCHIVE_DAILY   ] = "%d";
     $archiveFrequencies[ ARCHIVE_MONTHLY ] = "%m";
     $archiveFrequencies[ ARCHIVE_YEARLY  ] = "%y";
 
@@ -1767,19 +1830,19 @@
 
         function PackageTableRecord( $serverAdmin, $packageName )
         {
-			global $errCannotGetPackageStatus;
-			
-			$this->status = "";
-			
-			try
-			{
-	            $statusInfo = $serverAdmin->GetPackageStatus( $packageName );
-				$this->status = ( $statusInfo != NULL ) ? $statusInfo->GetStatusMessage() : "";
-			}
-			catch ( MgException $e )
-			{
-				$this->status = sprintf( $errCannotGetPackageStatus, $e->GetMessage() );
-			}
+            global $errCannotGetPackageStatus;
+
+            $this->status = "";
+
+            try
+            {
+                $statusInfo = $serverAdmin->GetPackageStatus( $packageName );
+                $this->status = ( $statusInfo != NULL ) ? $statusInfo->GetStatusMessage() : "";
+            }
+            catch ( MgException $e )
+            {
+                $this->status = sprintf( $errCannotGetPackageStatus, $e->GetMessage() );
+            }
         }
     }
 

Modified: trunk/MgDev/Web/src/mapadmin/sessionvars.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/sessionvars.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/sessionvars.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -30,6 +30,7 @@
     $selectedService = "";
     $selectedLog = ACCESS_LOG;
     $selectedPackage = "";
+    $selectedMapping = "";
     $packageLoadErrorMsg = "";
     $packageMakeErrorMsg = "";
     $packageLoadConfirmationMsg = "";
@@ -59,6 +60,7 @@
         global $selectedService;
         global $selectedLog;
         global $selectedPackage;
+        global $selectedMapping;
         global $packageLoadErrorMsg;
         global $packageMakeErrorMsg;
         global $packageLoadConfirmationMsg;
@@ -84,6 +86,7 @@
         $selectedService = "";
         $selectedLog = ACCESS_LOG;
         $selectedPackage = "";
+        $selectedMapping = "";
         $packageLoadErrorMsg = "";
         $packageMakeErrorMsg = "";
         $packageLoadConfirmationMsg = "";
@@ -123,6 +126,7 @@
         global $selectedService;
         global $selectedLog;
         global $selectedPackage;
+        global $selectedMapping;
         global $packageLoadErrorMsg;
         global $packageMakeErrorMsg;
         global $packageLoadConfirmationMsg;
@@ -153,6 +157,7 @@
             $selectedService = $_SESSION[ 'selectedService' ];
             $selectedLog = $_SESSION[ 'selectedLog' ];
             $selectedPackage = $_SESSION[ 'selectedPackage' ];
+            $selectedMapping = $_SESSION[ 'selectedMapping' ];
             $packageLoadErrorMsg = $_SESSION[ 'packageLoadErrorMsg' ];
             $packageMakeErrorMsg = $_SESSION[ 'packageMakeErrorMsg' ];
             $packageLoadConfirmationMsg = $_SESSION[ 'packageLoadConfirmationMsg' ];
@@ -200,6 +205,7 @@
         global $selectedService;
         global $selectedLog;
         global $selectedPackage;
+        global $selectedMapping;
         global $packageLoadErrorMsg;
         global $packageMakeErrorMsg;
         global $packageLoadConfirmationMsg;
@@ -225,6 +231,7 @@
         $_SESSION[ 'selectedService' ] = $selectedService;
         $_SESSION[ 'selectedLog' ] = $selectedLog;
         $_SESSION[ 'selectedPackage' ] = $selectedPackage;
+        $_SESSION[ 'selectedMapping' ] = $selectedMapping;
         $_SESSION[ 'packageLoadErrorMsg' ] = $packageLoadErrorMsg;
         $_SESSION[ 'packageMakeErrorMsg' ] = $packageMakeErrorMsg;
         $_SESSION[ 'packageLoadConfirmationMsg' ] = $packageLoadConfirmationMsg;

Added: trunk/MgDev/Web/src/mapadmin/unmanageddatamanagement.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/unmanageddatamanagement.php	2007-01-26 19:37:39 UTC (rev 1074)
+++ trunk/MgDev/Web/src/mapadmin/unmanageddatamanagement.php	2007-01-27 00:26:59 UTC (rev 1075)
@@ -0,0 +1,270 @@
+<?php  // PHP Preprocessing --------------------------------------------------------------------------------------------------------------
+
+//
+//  Copyright (C) 2004-2006  Autodesk, Inc.
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of version 2.1 of the GNU Lesser
+//  General Public License as published by the Free Software Foundation.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+try
+{
+    include 'resizableadmin.php';
+
+    LoadSessionVars();
+
+    // Did the user logout?
+    CheckForLogout();
+
+    // Define Local values
+    $menuCategory = UNMANAGEDDATA_MANAGEMENT_MENU_ITEM;
+    $pageTitle = UNMANAGEDDATA_MANAGEMENT_MENU_ITEM;
+
+    $helpPage = 'HelpDocs/managing_unmanageddata.htm';
+    $pageName = 'UnmanagedDataManagementPage';
+    $formName = 'UnmanagedDataManagementForm';
+    $homePage = NULL;
+
+    $selectedMappingID = 'SelectedMapping';
+    $mappingTable = array();
+
+    $pageSize = 25;
+    $firstPageIndex = -1;
+    $lastPageIndex = -1;
+
+    $mappings = array();
+
+    $numMappings = 0;
+    $currPage = 1;
+    $sortDirection= DEFAULT_SORT_DIRECTION;
+    $sortDirectionID = SORT_DIRECTION_ID;
+    $sortColumn = NAME_SORT_COLUMN;
+    $sortColumnID = SORT_COLUMN_ID;
+
+
+    $siteServerAddress = "";
+    $selectedServerID = "Server";
+    $serverAdmin = 0;
+    $refreshRequested = false;
+    $confirmationMsg = "";
+    $errorMsg = "";
+    $pageEnabled = false;
+
+    // Get Server
+    $siteServerAddress = $site->GetCurrentSiteAddress();
+    GetServerSelection( $selectedServerID, $selectedServer );
+    $serverRec = GetDataForServer( $selectedServer );
+    if ( $serverRec == NULL )
+        throw new Exception( sprintf( $errNotFound, $selectedServer ) );
+    if ( !$serverRec->poweredUp )
+        throw new Exception( sprintf( $errServerIsDown, $selectedServer ) );
+
+
+    // Get props values from server
+    $serverAdmin = new MgServerAdmin();
+    $serverAdmin->Open( $selectedServer, $userInfo );
+
+    $mappings = GetUnmanagedDataMappings( $serverAdmin );
+
+    // Get input values
+    if ( array_key_exists( $selectedMappingID, $_GET ) )
+        $selectedMapping = $_GET[$selectedMappingID];
+    else
+    if ( array_key_exists( $selectedMappingID, $_POST ) )
+        $selectedMapping = $_POST[$selectedMappingID];
+
+    if ( array_key_exists( $sortDirectionID, $_GET ) )
+        $sortDirection = $_GET[$sortDirectionID];
+    else
+    if ( array_key_exists( $sortDirectionID, $_POST ) )
+        $sortDirection = $_POST[$sortDirectionID];
+    SetUserSortDirection( $sortDirection );
+
+    if ( array_key_exists( $sortColumnID, $_GET ) )
+        $sortColumn = $_GET[$sortColumnID];
+    else
+    if ( array_key_exists( $sortColumnID, $_POST ) )
+        $sortColumn = $_POST[$sortColumnID];
+    SetUserSortColumn( $sortColumn );
+
+    // Are we switching to another page?
+    CheckForPageSwitch();
+
+    // Are we deleting the selected mapping?
+    //if ( CheckForDeleteSelection() && DeleteUnmanagedDataMapping( $serverAdmin, $mappings, $selectedMapping ) )
+    if ( CheckForDeleteSelection() && DeleteUnmanagedDataMapping( $serverAdmin, $selectedMapping ) )
+    {
+        $confirmationMsg = sprintf( $confSuccessfulDeletion, $selectedMapping );
+        $mappings = GetUnmanagedDataMappings( $serverAdmin );
+    }
+    $serverAdmin->Close();
+
+}
+catch ( MgException $e )
+{
+    CheckForFatalMgException( $e );
+    $errorMsg = $e->GetMessage();
+}
+catch ( Exception $e )
+{
+    $errorMsg = $e->getMessage();
+}
+
+// Load display data
+try
+{
+    // sort mappings
+    if ($sortColumn == NAME_SORT_COLUMN)
+        if ($sortDirection == ASCENDING_SORT_DIRECTION)
+            ksort($mappings);
+        else
+            krsort($mappings);
+    else
+        if ($sortDirection == ASCENDING_SORT_DIRECTION)
+            asort($mappings);
+        else
+            arsort($mappings);
+
+    $numMappings = sizeof( $mappings );
+    $mappingsKeys = array_keys( $mappings );
+
+    $currPage = GetPageNumber( $mappingsKeys, $selectedMapping, $pageSize );
+    GetPageRange( $currPage, $numMappings, $pageSize, $firstPageIndex, $lastPageIndex );
+
+    LoadMappingTable( $mappingTable, $mappings, $firstPageIndex, $lastPageIndex );
+
+    if ( !array_key_exists( $selectedMapping, $mappingTable ) && $numMappings > 0 )
+    {
+        $selectedMapping = $mappingsKeys[ $firstPageIndex ];
+    }
+    else if ( $numMappings == 0 )
+    {
+        $selectedMapping = '';
+    }
+}
+catch ( MgException $e )
+{
+    CheckForFatalMgException( $e );
+    if ( empty( $errorMsg ) )
+        $errorMsg = $e->GetMessage();
+}
+catch ( Exception $e )
+{
+    if ( empty( $errorMsg ) )
+        $errorMsg = $e->getMessage();
+}
+?>
+
+<!-- PAGE DEFINITION ----------------------------------------------------------------------------------------------------->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+
+    <?php OutputHeader( $pageTitle ); ?>
+
+<body>
+
+    <table cellspacing="0" cellpadding="0" border="0" class="main">
+        <tr>
+            <?php DisplaySiteHeader( true, true, true, true, $formName, $homePage ); ?>
+        </tr>
+        <tr>
+            <?php DisplayLefthandSash( $menuCategory ); ?>
+
+            <!-- Contents Area ------------------------------------------------------------------------------------------------->
+            <?php BeginContentArea( $formName ); ?>
+
+                <?php
+                    DeclareHiddenVars( $pageName );
+                    DisplayTitleBar( $pageTitle, $helpPage );
+                    DisplayConfirmationMsg( $confirmationMsg );
+                    DisplayErrorMsg( $errorMsg );
+                ?>
+                    <input type="hidden" name="<?php echo TABLE_PAGE_ID?>" value="<?php echo $currPage?>">
+                    <input type="hidden" name="<?php echo $sortColumnID?>" value="<?php echo $sortColumn?>">
+                    <input type="hidden" name="<?php echo $sortDirectionID?>" value="<?php echo $sortDirection?>">
+                    <input type="hidden" name="<?php echo $selectedMappingID?>" value="<?php echo $selectedMapping?>">
+
+                <?php
+                    DisplayPaginationControl( $currPage, $numMappings, $pageSize, 'unmanageddatamanagement.php', $sortColumn, $sortDirection );
+
+                    // Toolbar
+                    $buttons = array();
+                    $button = new ToolbarButtonRecord();
+                        $button->label = "Add Mapping";
+                        $button->icon = "images/new.gif";
+                        $button->action = "SetElementValue('".NEXT_PAGE_ID."', 'addunmanageddata.php');";
+                    $buttons[0] = $button;
+                    $button = new ToolbarButtonRecord();
+                        $button->label = "Edit Mapping";
+                        $button->icon = "images/edit.gif";
+                        $button->disabled = !empty( $selectedMapping ) ? false : true;
+                        $button->action = "SetElementValue('".NEXT_PAGE_ID."', 'editunmanageddata.php');";
+                    $buttons[1] = $button;
+                    $button = new ToolbarButtonRecord();
+                        $button->label = "Delete Mapping";
+                        $button->icon = "images/delete.gif";
+                        $button->submitForm = false;
+                        $button->disabled = !empty( $selectedMapping ) ? false : true;
+                        $button->action = "ConditionalSubmitForm( '".$formName."', 'Are you sure you want to delete the selected mapping?', '".DELETE_SELECTION_ID."', true );";
+                    $buttons[2] = $button;
+                    DisplayToolbar( $buttons, $formName );
+                ?>
+
+                <!-- Unmanaged Data Table-->
+                <table border="0" cellspacing="2" cellpadding="2" class="dataTable">
+                    <tr>
+                        <?php
+                            $mappingNameSortIconStr    = ( $sortColumn === NAME_SORT_COLUMN ) ? '   <img src="'.GetSortIcon( $sortDirection ).'">' : '';
+                            $locationSortIconStr       = ( $sortColumn === ID_SORT_COLUMN )   ? '   <img src="'.GetSortIcon( $sortDirection ).'">' : '';
+                            $sortDirectionStr          = "SetElementValue( '".$sortDirectionID."', '".GetSortDirection( $sortDirection )."' );";
+                            $sortByMappingNameStr      = "SetElementValue( '".$sortColumnID."', '".NAME_SORT_COLUMN."');";
+                            $sortByLocationStr         = "SetElementValue( '".$sortColumnID."', '".ID_SORT_COLUMN."');";
+                        ?>
+                        <td class="dataHeader">&nbsp;</td>
+                        <td class="dataHeader"><a href="#" onClick="<?php echo $sortDirectionStr.$sortByMappingNameStr?>SubmitForm('<?php echo $formName?>');">Mapping Name<?php echo $mappingNameSortIconStr ?></a> </td>
+                        <td class="dataHeader"><a href="#" onClick="<?php echo $sortDirectionStr.$sortByLocationStr?>SubmitForm('<?php echo $formName?>');">Location<?php echo $locationSortIconStr ?></a> </td>
+                    </tr>
+
+                    <?php
+                        $initOkToDeleteVal = 'true';
+
+                        foreach ( $mappingTable as $key => $val )
+                        {
+                            if ( $key == $selectedMapping )
+                                $checkedStr = " checked ";
+                            else
+                                $checkedStr = "";
+
+                            $mappingSelectionOnClickStr = "SetElementValue( '".$selectedMappingID."', '".$key."');";
+
+                    ?>
+                            <tr>
+                                <td class="dataCell"><input name="mappingSelector" type="radio" value="<?php echo $key ?>" <?php echo $checkedStr ?> onClick="<?php echo $mappingSelectionOnClickStr ?>" ></td>
+                                <td class="dataCell"><a href="editunmanageddata.php?<?php echo $selectedMappingID?>=<?php echo $key?>"><?php echo $key ?></a></td>
+                                <td class="dataCell"><?php echo $val ?></td>
+                            </tr>
+                    <?php
+                        }
+                    ?>
+                </table>
+                <?php DisplayPaginationControl( $currPage, $numMappings, $pageSize, 'unmanageddatamanagement.php', $sortColumn, $sortDirection ); ?>
+
+            <?php EndContentArea( true, $formName, NULL ); ?>
+            <!-- End of Contents Area --------------------------------------------------------------------------------------------->
+
+        </tr>
+
+    </table>
+
+</body>
+</html>



More information about the mapguide-commits mailing list