[mapguide-commits] r8184 - in sandbox/jng/tiling: Common/MapGuideCommon/Services Common/PlatformBase/Services Server/src/Common/Manager Server/src/Services/Resource Server/src/Services/Tile UnitTest/WebTier/MapAgent/MapAgentForms Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Jun 3 09:07:04 PDT 2014
Author: jng
Date: 2014-06-03 09:07:04 -0700 (Tue, 03 Jun 2014)
New Revision: 8184
Added:
sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp
sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.h
sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.cpp
sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.h
sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html
sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.h
Modified:
sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.cpp
sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.h
sandbox/jng/tiling/Common/MapGuideCommon/Services/RenderingService.h
sandbox/jng/tiling/Common/PlatformBase/Services/ResourceService.h
sandbox/jng/tiling/Server/src/Common/Manager/ServiceManager.cpp
sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.h
sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.cpp
sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.h
sandbox/jng/tiling/Server/src/Services/Resource/ResourceOperationFactory.cpp
sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.cpp
sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.h
sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj
sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj.filters
sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceServiceBuild.cpp
sandbox/jng/tiling/Server/src/Services/Tile/OpClearCache.cpp
sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp
sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp
sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.cpp
sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj
sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj.filters
sandbox/jng/tiling/Server/src/Services/Tile/ServerTileServiceBuild.cpp
sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.cpp
sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.h
sandbox/jng/tiling/Server/src/Services/Tile/TileOperationFactory.cpp
sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/cleartilecacheform.html
sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizexform.html
sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizeyform.html
sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileimageform2.html
sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/tileserviceapi.html
sandbox/jng/tiling/Web/src/HttpHandler/HttpClearTileCache.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.h
sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.h
sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj
sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters
sandbox/jng/tiling/Web/src/HttpHandler/HttpHandlerBuild.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpRequest.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.cpp
sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.h
Log:
This submission includes the following changes:
- Hook up existing tile cache invalidation to also flush out caches for Tile Set Definitions. This required a new internal EnumerateParentTileSetDefinitions() added to MgResourceService, which serves the same purpose as EnumerateParentMapDefinitions() only for tile sets.
- Implement handlers for proxy method calls on new tile service methods.
- Add new mapagent test forms.
Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.cpp
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -1160,7 +1160,7 @@
MgResourceService::opIdEnumerateParentMapDefinitions, // Command code
1, // Number of arguments
Resource_Service, // Service ID
- BUILD_VERSION(1,0,0), // Operation version
+ BUILD_VERSION(3,0,0), // Operation version
MgCommand::knObject, resources, // Argument #1
MgCommand::knNone);
@@ -1171,6 +1171,32 @@
return (MgSerializableCollection*)cmd.GetReturnValue().val.m_obj;
}
+MgSerializableCollection* MgProxyResourceService::EnumerateParentTileSetDefinitions(
+ MgSerializableCollection* resources)
+{
+ MgCommand cmd;
+
+ MG_TRY()
+
+ assert(m_connProp != NULL);
+
+ cmd.ExecuteCommand(
+ m_connProp, // Connection
+ MgCommand::knObject, // Return type
+ MgResourceService::opIdEnumerateParentTileSetDefinitions, // Command code
+ 1, // Number of arguments
+ Resource_Service, // Service ID
+ BUILD_VERSION(1,0,0), // Operation version
+ MgCommand::knObject, resources, // Argument #1
+ MgCommand::knNone);
+
+ SetWarning(cmd.GetWarningObject());
+
+ MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateParentTileSetDefinitions")
+
+ return (MgSerializableCollection*)cmd.GetReturnValue().val.m_obj;
+}
+
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate the resource documents in the specified repository.
Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.h
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/ProxyResourceService.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -175,6 +175,25 @@
///////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Enumerate all the parent Tile Set Definition resources of the specified
+ /// resources.
+ ///
+ /// This method only works on "Library" and "Session" repositories.
+ //
+ /// \param resources
+ /// Child resources.
+ ///
+ /// \return
+ /// MgResourceIdentifier list of Map Definition resources.
+ ///
+ /// \exception MgInvalidRepositoryTypeException
+ /// \exception MgInvalidResourceTypeException
+ ///
+ virtual MgSerializableCollection* EnumerateParentTileSetDefinitions(
+ MgSerializableCollection* resources);
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Enumerate the resource documents in the specified repository.
///
/// \remarks
Modified: sandbox/jng/tiling/Common/MapGuideCommon/Services/RenderingService.h
===================================================================
--- sandbox/jng/tiling/Common/MapGuideCommon/Services/RenderingService.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Common/MapGuideCommon/Services/RenderingService.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -46,6 +46,8 @@
/// by this method. To render and cache the tile, use the
/// \link MgTileService::GetTile GetTile \endlink method instead
///
+ /// \deprecated This method is deprecated. Use the RenderTile that acceps width/height/dpi/format
+ ///
/// \param map
/// Input
/// map object containing current state of map.
Modified: sandbox/jng/tiling/Common/PlatformBase/Services/ResourceService.h
===================================================================
--- sandbox/jng/tiling/Common/PlatformBase/Services/ResourceService.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Common/PlatformBase/Services/ResourceService.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -1893,6 +1893,25 @@
virtual MgSerializableCollection* EnumerateParentMapDefinitions(
MgSerializableCollection* resources) = 0;
+ ///////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Enumerate all the parent Tile Set Definition resources of the specified
+ /// resources.
+ ///
+ /// This method only works on "Library" and "Session" repositories.
+ //
+ /// \param resources
+ /// Child resources.
+ ///
+ /// \return
+ /// MgResourceIdentifier list of Map Definition resources.
+ ///
+ /// \exception MgInvalidRepositoryTypeException
+ /// \exception MgInvalidResourceTypeException
+ ///
+ virtual MgSerializableCollection* EnumerateParentTileSetDefinitions(
+ MgSerializableCollection* resources) = 0;
+
//////////////////////////////////////////////////////////////////
/// \brief
/// Returns if permission has been granted for a resource
@@ -2040,6 +2059,7 @@
opIdResourceExists = 0x1111EF1B,
opIdEnumerateResourceDocuments = 0x1111EF1C,
opIdGetResourceContents = 0x1111EF1D,
+ opIdEnumerateParentTileSetDefinitions = 0x1111EF1E,
};
};
Modified: sandbox/jng/tiling/Server/src/Common/Manager/ServiceManager.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Common/Manager/ServiceManager.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Common/Manager/ServiceManager.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -502,6 +502,8 @@
{
affectedResources = resourceService->EnumerateParentMapDefinitions(changedResources);
tileService->NotifyResourcesChanged(affectedResources, false);
+ affectedResources = resourceService->EnumerateParentTileSetDefinitions(changedResources);
+ tileService->NotifyResourcesChanged(affectedResources, false);
}
// Dispatch resource change notifications to support servers.
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -747,6 +747,61 @@
MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgApplicationRepositoryManager.EnumerateParentMapDefinitions")
}
+///////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Enumerate all the parent Map Definition resources of the specified
+/// resources.
+///
+/// Note that child list will also be updated with additional members during
+/// the search.
+///
+void MgApplicationRepositoryManager::EnumerateParentTileSetDefinitions(
+ set<string>& childResources, set<STRING>& parentResources)
+{
+ MG_RESOURCE_SERVICE_TRY()
+
+ // If the child list contains some Map Definition resources, then
+ // insert them into the parent list.
+
+ for (set<string>::const_iterator i = childResources.begin();
+ i != childResources.end( ); ++i)
+ {
+ string mbResourcePathname = *i;
+ STRING wcResourcePathname;
+ MgUtil::MultiByteToWideChar(mbResourcePathname, wcResourcePathname);
+ MgResourceIdentifier resource(wcResourcePathname);
+
+ if (resource.IsResourceTypeOf(MgResourceType::TileSetDefinition))
+ {
+ parentResources.insert(wcResourcePathname);
+ }
+ }
+
+ MgApplicationResourceContentManager* resourceContentMan =
+ GetApplicationResourceContentManager();
+
+ // Scan through the repository tree to search for all the parent Map
+ // Definition resources that reference the specified child resources.
+
+ set<string> *prevSearchResources, *currSearchResources, *nextSearchResources;
+ set<string> inputResources, outputResources;
+
+ inputResources = childResources;
+ currSearchResources = &inputResources;
+ nextSearchResources = &outputResources;
+
+ while (!currSearchResources->empty())
+ {
+ resourceContentMan->EnumerateParentTileSetDefinitions(*currSearchResources,
+ *nextSearchResources, childResources, parentResources);
+ prevSearchResources = currSearchResources;
+ currSearchResources = nextSearchResources;
+ nextSearchResources = prevSearchResources;
+ }
+
+ MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgApplicationRepositoryManager.EnumerateParentTileSetDefinitions")
+}
+
///----------------------------------------------------------------------------
/// <summary>
/// Enumerates tagged data for the specified resource.
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ApplicationRepositoryManager.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -71,6 +71,8 @@
MgByteReader* EnumerateReferences(MgResourceIdentifier* resource);
void EnumerateParentMapDefinitions(
set<string>& childResources, set<STRING>& parentResources);
+ void EnumerateParentTileSetDefinitions(
+ set<string>& childResources, set<STRING>& parentResources);
// Resource Data Management APIs
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -275,6 +275,96 @@
MG_RESOURCE_CONTAINER_CATCH_AND_THROW(L"MgApplicationResourceContentManager.EnumerateParentMapDefinitions")
}
+///////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Enumerate all the parent Tile Set Definition resources of the specified
+/// resources.
+///
+/// Note that checking permissions is not required for this operation.
+///
+void MgApplicationResourceContentManager::EnumerateParentTileSetDefinitions(
+ const set<string>& currSearchResources, set<string>& nextSearchResources,
+ set<string>& childResources, set<STRING>& parentResources)
+{
+ MG_RESOURCE_SERVICE_TRY()
+
+ // Reset the next search list.
+
+ nextSearchResources.clear();
+
+ // Do nothing if the current search list is empty.
+
+ if (currSearchResources.empty())
+ {
+ return;
+ }
+
+ // Set up an XQuery.
+
+ string query = "collection('";
+ query += m_container.getName();
+ query += "')";
+ query += "//*/ResourceId[";
+
+ for (set<string>::const_iterator i = currSearchResources.begin();
+ i != currSearchResources.end( ); ++i)
+ {
+ if (i != currSearchResources.begin())
+ {
+ query += " or ";
+ }
+
+ query += ".=\"";
+ query += *i;
+ query += "\"";
+ }
+
+ query += "]";
+
+ // Execute the XQuery.
+
+ XmlManager& xmlMan = m_container.getManager();
+ XmlQueryContext queryContext = xmlMan.createQueryContext();
+ XmlResults results = IsTransacted() ?
+ xmlMan.query(GetXmlTxn(), query, queryContext, 0) :
+ xmlMan.query(query, queryContext, 0);
+ XmlDocument xmlDoc;
+
+ while (results.next(xmlDoc))
+ {
+ string mbResourcePathname = xmlDoc.getName();
+ STRING wcResourcePathname;
+ MgUtil::MultiByteToWideChar(mbResourcePathname, wcResourcePathname);
+ MgResourceIdentifier resource(wcResourcePathname);
+
+ if (!resource.IsFolder())
+ {
+ // Insert the resource into the parent list if it is a Tile Set Definition.
+ // Otherwise, insert it into the child list.
+
+ if (resource.IsResourceTypeOf(MgResourceType::TileSetDefinition))
+ {
+ parentResources.insert(wcResourcePathname);
+ }
+ else
+ {
+ std::pair<set<string>::iterator, bool> i =
+ childResources.insert(mbResourcePathname);
+
+ // Insert the resource into the next search list if it is not in
+ // the child list.
+
+ if (i.second)
+ {
+ nextSearchResources.insert(mbResourcePathname);
+ }
+ }
+ }
+ }
+
+ MG_RESOURCE_CONTAINER_CATCH_AND_THROW(L"MgApplicationResourceContentManager.EnumerateParentTileSetDefinitions")
+}
+
///----------------------------------------------------------------------------
/// <summary>
/// Enumerates tagged data for the specified resource.
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ApplicationResourceContentManager.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -53,6 +53,9 @@
void EnumerateParentMapDefinitions(
const set<string>& currSearchResources, set<string>& nextSearchResources,
set<string>& childResources, set<STRING>& parentResources);
+ void EnumerateParentTileSetDefinitions(
+ const set<string>& currSearchResources, set<string>& nextSearchResources,
+ set<string>& childResources, set<STRING>& parentResources);
// Resource Data Management APIs
Added: sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp (rev 0)
+++ sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,110 @@
+//
+// Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#include "ResourceServiceDefs.h"
+#include "OpEnumerateParentTileSetDefinitions.h"
+#include "ServerResourceService.h"
+#include "LogManager.h"
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Constructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpEnumerateParentTileSetDefinitions::MgOpEnumerateParentTileSetDefinitions()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Destructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpEnumerateParentTileSetDefinitions::~MgOpEnumerateParentTileSetDefinitions()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Executes the operation.
+/// </summary>
+///
+/// <exceptions>
+/// MgException
+/// </exceptions>
+///----------------------------------------------------------------------------
+void MgOpEnumerateParentTileSetDefinitions::Execute()
+{
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT(" (%t) MgOpEnumerateParentTileSetDefinitions::Execute()\n")));
+
+ MG_LOG_OPERATION_MESSAGE(L"EnumerateParentTileSetDefinitions");
+
+ MG_RESOURCE_SERVICE_TRY()
+
+ MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+
+ ACE_ASSERT(m_stream != NULL);
+
+ if (1 == m_packet.m_NumArguments)
+ {
+ Ptr<MgSerializableCollection> resources =
+ (MgSerializableCollection*)m_stream->GetObject();
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgSerializableCollection");
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ Ptr<MgSerializableCollection> mapDefinitions =
+ m_service->EnumerateParentTileSetDefinitions(resources);
+
+ EndExecution(mapDefinitions);
+ }
+ else
+ {
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+ }
+
+ if (!m_argsRead)
+ {
+ throw new MgOperationProcessingException(L"MgOpEnumerateParentTileSetDefinitions.Execute",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ // Successful operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+
+ MG_RESOURCE_SERVICE_CATCH(L"MgOpEnumerateParentTileSetDefinitions.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()
+}
Added: sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.h (rev 0)
+++ sandbox/jng/tiling/Server/src/Services/Resource/OpEnumerateParentTileSetDefinitions.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef MGOPENUMERATEPARENTTILESETDEFINITIONS_H
+#define MGOPENUMERATEPARENTTILESETDEFINITIONS_H
+
+#include "ResourceOperation.h"
+
+class MgOpEnumerateParentTileSetDefinitions : public MgResourceOperation
+{
+ public:
+ MgOpEnumerateParentTileSetDefinitions();
+ virtual ~MgOpEnumerateParentTileSetDefinitions();
+
+ public:
+ virtual void Execute();
+};
+
+#endif
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ResourceOperationFactory.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ResourceOperationFactory.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ResourceOperationFactory.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -39,6 +39,7 @@
#include "OpGetResourceModifiedDate.h"
#include "OpEnumerateResourceReferences.h"
#include "OpEnumerateParentMapDefinitions.h"
+#include "OpEnumerateParentTileSetDefinitions.h"
#include "OpChangeResourceOwner.h"
#include "OpInheritPermissionsFrom.h"
// Resource Data Management APIs
@@ -340,6 +341,18 @@
}
break;
+ case MgResourceService::opIdEnumerateParentTileSetDefinitions:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(3,0):
+ handler.reset(new MgOpEnumerateParentTileSetDefinitions());
+ break;
+ default:
+ throw new MgInvalidOperationVersionException(
+ L"MgResourceOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ break;
+
case MgResourceService::opIdChangeResourceOwner:
switch (VERSION_NO_PHASE(operationVersion))
{
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -1541,6 +1541,135 @@
return mapDefinitions.Detach();
}
+///////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Enumerate all the parent Tile Set Definition resources of the specified
+/// resources.
+///
+MgSerializableCollection* MgServerResourceService::EnumerateParentTileSetDefinitions(MgSerializableCollection* resources)
+{
+ Ptr<MgSerializableCollection> tileSetDefinitions;
+
+ MG_RESOURCE_SERVICE_TRY()
+
+ MG_LOG_TRACE_ENTRY(L"MgServerResourceService::EnumerateParentTileSetDefinitions()");
+
+ if (NULL == resources)
+ {
+ throw new MgNullArgumentException(
+ L"MgServerResourceService.EnumerateParentTileSetDefinitions",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ // Check if the resources come from the Library or Session repository.
+
+ set<string> childResources;
+ INT32 libraryResources = 0;
+ INT32 numResources = resources->GetCount();
+
+ for (INT32 i = 0; i < numResources; ++i)
+ {
+ Ptr<MgSerializable> serializableObj = resources->GetItem(i);
+ MgResourceIdentifier* resource = dynamic_cast<MgResourceIdentifier*>(
+ serializableObj.p);
+
+ if (NULL == resource)
+ {
+ throw new MgInvalidCastException(
+ L"MgServerResourceService.EnumerateParentTileSetDefinitions",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ if (!resource->IsFolder())
+ {
+ if (resource->IsRepositoryTypeOf(MgRepositoryType::Library))
+ {
+ childResources.insert(MgUtil::WideCharToMultiByte(
+ resource->ToString()));
+ ++libraryResources;
+ }
+ else if (resource->IsRepositoryTypeOf(MgRepositoryType::Session))
+ {
+ childResources.insert(MgUtil::WideCharToMultiByte(
+ resource->ToString()));
+ }
+ else
+ {
+ throw new MgInvalidRepositoryTypeException(
+ L"MgServerResourceService.EnumerateParentTileSetDefinitions",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ }
+ }
+
+ // Note that a Session resource may reference a Library resource but not
+ // the other way around, therefore:
+ //
+ // 1. If the resource comes from the Session repository, then we need to
+ // perform this operation on only the Session repository.
+ // 2. If the resource comes from the Library repository, then we need to
+ // perform this operation on both the Library and Session repositories.
+
+ set<STRING> parentResources;
+ numResources = static_cast<INT32>(childResources.size());
+
+ if (numResources > 0)
+ {
+ if (libraryResources > 0)
+ {
+ MgLibraryRepositoryManager libraryRepositoryMan(*sm_libraryRepository);
+
+ libraryRepositoryMan.Initialize(true);
+ libraryRepositoryMan.EnumerateParentTileSetDefinitions(childResources,
+ parentResources);
+ libraryRepositoryMan.Terminate();
+ }
+
+ if(sm_bSingleSessionRepository)
+ {
+ MgSessionRepositoryManager sessionRepositoryMan(*sm_sessionRepository);
+
+ sessionRepositoryMan.Initialize(true);
+ sessionRepositoryMan.EnumerateParentTileSetDefinitions(childResources,
+ parentResources);
+ sessionRepositoryMan.Terminate();
+ }
+ else
+ {
+ for (std::map<STRING, MgSessionRepository* >::iterator i = sm_sessionRepositories.begin();i != sm_sessionRepositories.end(); ++i)
+ {
+ MgSessionRepository* sessionRepository = i->second;
+ if(NULL != sessionRepository)
+ {
+ MgSessionRepositoryManager sessionRepositoryMan(*sessionRepository);
+
+ sessionRepositoryMan.Initialize(true);
+ sessionRepositoryMan.EnumerateParentTileSetDefinitions(childResources,
+ parentResources);
+ sessionRepositoryMan.Terminate();
+ }
+ }
+ }
+ }
+
+ if (!parentResources.empty())
+ {
+ tileSetDefinitions = new MgSerializableCollection();
+
+ for (set<STRING>::const_iterator i = parentResources.begin();
+ i != parentResources.end( ); ++i)
+ {
+ Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(*i);
+
+ tileSetDefinitions->Add(resource.p);
+ }
+ }
+
+ MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.EnumerateParentTileSetDefinitions")
+
+ return tileSetDefinitions.Detach();
+}
+
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate the resource documents in the specified repository.
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -97,6 +97,8 @@
MgResourceIdentifier* resource);
virtual MgSerializableCollection* EnumerateParentMapDefinitions(
MgSerializableCollection* resources);
+ virtual MgSerializableCollection* EnumerateParentTileSetDefinitions(
+ MgSerializableCollection* resources);
virtual STRING EnumerateResourceDocuments(MgStringCollection* resources,
CREFSTRING type, INT32 properties);
virtual void ChangeResourceOwner(MgResourceIdentifier* resource,
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj 2014-06-03 16:07:04 UTC (rev 8184)
@@ -254,6 +254,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="OpEnumerateParentTileSetDefinitions.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="OpEnumerateRepositories.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -691,6 +697,7 @@
<ClInclude Include="OpDeleteResource.h" />
<ClInclude Include="OpDeleteResourceData.h" />
<ClInclude Include="OpEnumerateParentMapDefinitions.h" />
+ <ClInclude Include="OpEnumerateParentTileSetDefinitions.h" />
<ClInclude Include="OpEnumerateRepositories.h" />
<ClInclude Include="OpEnumerateResourceData.h" />
<ClInclude Include="OpEnumerateResourceDocuments.h" />
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj.filters
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj.filters 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceService.vcxproj.filters 2014-06-03 16:07:04 UTC (rev 8184)
@@ -150,6 +150,9 @@
<ClCompile Include="ZipFileHandler.cpp" />
<ClCompile Include="ZipFileReader.cpp" />
<ClCompile Include="ZipFileWriter.cpp" />
+ <ClCompile Include="OpEnumerateParentTileSetDefinitions.cpp">
+ <Filter>Ops</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="OpApplyResourcePackage.h">
@@ -297,6 +300,9 @@
<ClInclude Include="ZipFileHandler.h" />
<ClInclude Include="ZipFileReader.h" />
<ClInclude Include="ZipFileWriter.h" />
+ <ClInclude Include="OpEnumerateParentTileSetDefinitions.h">
+ <Filter>Ops</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ServerResourceService.rc" />
Modified: sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceServiceBuild.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceServiceBuild.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Resource/ServerResourceServiceBuild.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -39,6 +39,7 @@
#include "OpDeleteResource.cpp"
#include "OpDeleteResourceData.cpp"
#include "OpEnumerateParentMapDefinitions.cpp"
+#include "OpEnumerateParentTileSetDefinitions.cpp"
#include "OpEnumerateRepositories.cpp"
#include "OpEnumerateResourceData.cpp"
#include "OpEnumerateResourceDocuments.cpp"
Modified: sandbox/jng/tiling/Server/src/Services/Tile/OpClearCache.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/OpClearCache.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/OpClearCache.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -62,21 +62,41 @@
if (1 == m_packet.m_NumArguments)
{
- Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
- Ptr<MgResourceIdentifier> resource = map->GetResourceId();
- map->SetDelayedLoadResourceService(m_resourceService);
+ Ptr<MgSerializable> obj = (MgSerializable*)m_stream->GetObject();
+ if (obj->IsOfClass(MapGuide_MapLayer_Map))
+ {
+ Ptr<MgMap> map = SAFE_ADDREF((MgMap*)obj.p);
+ Ptr<MgResourceIdentifier> resource = map->GetResourceId();
+ map->SetDelayedLoadResourceService(m_resourceService);
- BeginExecution();
+ BeginExecution();
- MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
- MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == resource) ? L"MgResourceIdentifier" : resource->ToString().c_str());
- MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == resource) ? L"MgResourceIdentifier" : resource->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
- Validate();
+ Validate();
- m_service->ClearCache(map);
+ m_service->ClearCache(map);
- EndExecution();
+ EndExecution();
+ }
+ else if (obj->IsOfClass(PlatformBase_ResourceService_ResourceIdentifier))
+ {
+ Ptr<MgResourceIdentifier> resource = SAFE_ADDREF((MgResourceIdentifier*)obj.p);
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == resource) ? L"MgResourceIdentifier" : resource->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ m_service->ClearCache(resource);
+
+ EndExecution();
+ }
}
else
{
Modified: sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeX.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -73,6 +73,22 @@
EndExecution(size);
}
+ else if (1 == m_packet.m_NumArguments)
+ {
+ BeginExecution();
+
+ Ptr<MgResourceIdentifier> resource = (MgResourceIdentifier*)m_stream->GetObject();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == resource) ? L"MgResourceIdentifier" : resource->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ INT32 size = m_service->GetDefaultTileSizeX(resource);
+
+ EndExecution(size);
+ }
else
{
MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
Modified: sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/OpGetDefaultTileSizeY.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -73,6 +73,22 @@
EndExecution(size);
}
+ else if (1 == m_packet.m_NumArguments)
+ {
+ BeginExecution();
+
+ Ptr<MgResourceIdentifier> resource = (MgResourceIdentifier*)m_stream->GetObject();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == resource) ? L"MgResourceIdentifier" : resource->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ INT32 size = m_service->GetDefaultTileSizeX(resource);
+
+ EndExecution(size);
+ }
else
{
MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
Added: sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.cpp (rev 0)
+++ sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,102 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#include "OpGetTileProviders.h"
+#include "LogManager.h"
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Constructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpGetTileProviders::MgOpGetTileProviders()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Destructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpGetTileProviders::~MgOpGetTileProviders()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Executes the operation.
+/// </summary>
+///
+/// <exceptions>
+/// MgException
+/// </exceptions>
+///----------------------------------------------------------------------------
+void MgOpGetTileProviders::Execute()
+{
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT(" (%t) MgOpGetTileProviders::Execute()\n")));
+
+ MG_LOG_OPERATION_MESSAGE(L"GetTileProviders");
+
+ MG_TRY()
+
+ MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+
+ ACE_ASSERT(m_stream != NULL);
+
+ if (0 == m_packet.m_NumArguments)
+ {
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ Ptr<MgByteReader> byteReader = m_service->GetTileProviders();
+
+ EndExecution(byteReader);
+ }
+ else
+ {
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+ }
+
+ if (!m_argsRead)
+ {
+ throw new MgOperationProcessingException(L"MgOpGetTileProviders.Execute",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ // Successful operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+
+ MG_CATCH(L"MgOpGetTileProviders.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_THROW()
+}
Added: sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.h (rev 0)
+++ sandbox/jng/tiling/Server/src/Services/Tile/OpGetTileProviders.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef MG_OP_GET_TILE_PROVIDERS_H
+#define MG_OP_GET_TILE_PROVIDERS_H
+
+#include "TileOperation.h"
+
+class MgOpGetTileProviders : public MgTileOperation
+{
+ public:
+ MgOpGetTileProviders();
+ virtual ~MgOpGetTileProviders();
+
+ public:
+ virtual void Execute();
+};
+
+#endif
Modified: sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -338,7 +338,7 @@
bool MgServerTileService::IsTileCacheEmpty() const
{
- return false;
+ return MgTileCacheDefault::IsTileCacheEmpty();
}
///////////////////////////////////////////////////////////////////////////////
@@ -364,7 +364,8 @@
dynamic_cast<MgResourceIdentifier*>(serializableObj.p);
ACE_ASSERT(NULL != resource);
- if (NULL != resource && resource->IsResourceTypeOf(MgResourceType::MapDefinition))
+ if (NULL != resource && (resource->IsResourceTypeOf(MgResourceType::MapDefinition)
+ || resource->IsResourceTypeOf(MgResourceType::TileSetDefinition)))
{
MG_TRY()
@@ -372,11 +373,14 @@
Ptr<MgTileCache> cache = GetTileCache(resource);
cache->Clear();
+ ACE_DEBUG ((LM_INFO, ACE_TEXT("(%t) Cleared tile cache for %W\n"), resource->ToString().c_str()));
+
MgTileCacheDefault* cacheDefault = dynamic_cast<MgTileCacheDefault*>(cache.p);
if (NULL != cacheDefault)
{
// clear any cached mgmap objects
cacheDefault->ClearMapCache(resource->ToString());
+ ACE_DEBUG ((LM_INFO, ACE_TEXT("(%t) Cleared mem-cached MgMap instances for %W\n"), resource->ToString().c_str()));
}
MG_CATCH(L"MgServerTileService.NotifyResourcesChanged")
Modified: sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj 2014-06-03 16:07:04 UTC (rev 8184)
@@ -222,6 +222,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="OpGetTileProviders.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="OpSetTile.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -283,6 +289,7 @@
<ClInclude Include="OpGetDefaultTileSizeX.h" />
<ClInclude Include="OpGetDefaultTileSizeY.h" />
<ClInclude Include="OpGetTile.h" />
+ <ClInclude Include="OpGetTileProviders.h" />
<ClInclude Include="OpSetTile.h" />
<ClInclude Include="TileCacheDefault.h" />
<ClInclude Include="TileCacheDefaultProvider.h" />
Modified: sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj.filters
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj.filters 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/ServerTileService.vcxproj.filters 2014-06-03 16:07:04 UTC (rev 8184)
@@ -34,6 +34,9 @@
<ClCompile Include="TileServiceHandler.cpp" />
<ClCompile Include="TileCacheDefault.cpp" />
<ClCompile Include="TileCacheDefaultProvider.cpp" />
+ <ClCompile Include="OpGetTileProviders.cpp">
+ <Filter>Ops</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="OpClearCache.h">
@@ -64,6 +67,9 @@
<ClInclude Include="TileServiceHandler.h" />
<ClInclude Include="TileCacheDefault.h" />
<ClInclude Include="TileCacheDefaultProvider.h" />
+ <ClInclude Include="OpGetTileProviders.h">
+ <Filter>Ops</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ServerTileService.rc" />
Modified: sandbox/jng/tiling/Server/src/Services/Tile/ServerTileServiceBuild.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/ServerTileServiceBuild.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/ServerTileServiceBuild.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -23,6 +23,7 @@
#include "OpSetTile.cpp"
#include "OpGetDefaultTileSizeX.cpp"
#include "OpGetDefaultTileSizeY.cpp"
+#include "OpGetTileProviders.cpp"
#include "TileCache.cpp"
#include "TileCacheDefault.cpp"
#include "TileCacheDefaultProvider.cpp"
Modified: sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -921,4 +921,11 @@
byteSink->ToFile(path);
}
-}
\ No newline at end of file
+}
+
+bool MgTileCacheDefault::IsTileCacheEmpty()
+{
+ ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, sm_mutex, false));
+
+ return sm_mapCache.empty();
+}
Modified: sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.h
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/TileCacheDefault.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -51,6 +51,8 @@
void ClearMapCache(CREFSTRING mapName);
+ static bool IsTileCacheEmpty();
+
protected:
virtual void Dispose()
{
Modified: sandbox/jng/tiling/Server/src/Services/Tile/TileOperationFactory.cpp
===================================================================
--- sandbox/jng/tiling/Server/src/Services/Tile/TileOperationFactory.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Server/src/Services/Tile/TileOperationFactory.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -98,6 +98,18 @@
}
break;
+ case MgTileServiceOpId::ClearCache2:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(3,0):
+ handler.reset(new MgOpClearCache());
+ break;
+ default:
+ throw new MgInvalidOperationVersionException(
+ L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ break;
+
case MgTileServiceOpId::GetDefaultTileSizeX:
switch (VERSION_NO_PHASE(operationVersion))
{
@@ -122,6 +134,42 @@
}
break;
+ case MgTileServiceOpId::GetDefaultTileSizeX2:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(3,0):
+ handler.reset(new MgOpGetDefaultTileSizeX());
+ break;
+ default:
+ throw new MgInvalidOperationVersionException(
+ L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ break;
+
+ case MgTileServiceOpId::GetDefaultTileSizeY2:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(3,0):
+ handler.reset(new MgOpGetDefaultTileSizeY());
+ break;
+ default:
+ throw new MgInvalidOperationVersionException(
+ L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ break;
+
+ case MgTileServiceOpId::GetTileProviders:
+ switch (VERSION_NO_PHASE(operationVersion))
+ {
+ case VERSION_SUPPORTED(3,0):
+ handler.reset(new MgOpGetTileProviders());
+ break;
+ default:
+ throw new MgInvalidOperationVersionException(
+ L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ break;
+
default:
throw new MgInvalidOperationException(
L"MgTileOperationFactory.GetOperation", __LINE__, __WFILE__, NULL, L"", NULL);
Modified: sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/cleartilecacheform.html
===================================================================
--- sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/cleartilecacheform.html 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/cleartilecacheform.html 2014-06-03 16:07:04 UTC (rev 8184)
@@ -13,7 +13,7 @@
<p>
Client Agent: <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p>
- Map definition: <input type="text" name="MAPDEFINITION" value="Library://" size="100" ID="Text3">
+ Map/TileSet definition: <input type="text" name="MAPDEFINITION" value="Library://" size="100" ID="Text3">
<p>
Session id (optional): <input type="text" name="SESSION" size="100" ID="Text4">
<p>
Modified: sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizexform.html
===================================================================
--- sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizexform.html 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizexform.html 2014-06-03 16:07:04 UTC (rev 8184)
@@ -9,10 +9,12 @@
<div nowrap="true">
<b>Operation:</b> <input type="text" name="OPERATION" value="GETDEFAULTTILESIZEX" size="50" ID="Text1">
<p>
- Version: <input type="text" name="VERSION" value="1.0.0" size="10" ID="Text2">
+ Version: <input type="text" name="VERSION" value="3.0.0" size="10" ID="Text2">
<p>
Client Agent: <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p>
+ Tile Set Definition: <input type="text" name="TILESET" value="" size="100">
+ <p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</div>
</form>
Modified: sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizeyform.html
===================================================================
--- sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizeyform.html 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/getdefaulttilesizeyform.html 2014-06-03 16:07:04 UTC (rev 8184)
@@ -9,10 +9,12 @@
<div nowrap="true">
<b>Operation:</b> <input type="text" name="OPERATION" value="GETDEFAULTTILESIZEY" size="50" ID="Text1">
<p>
- Version: <input type="text" name="VERSION" value="1.0.0" size="10" ID="Text2">
+ Version: <input type="text" name="VERSION" value="3.0.0" size="10" ID="Text2">
<p>
Client Agent: <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p>
+ Tile Set Definition: <input type="text" name="TILESET" value="" size="100">
+ <p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</div>
</form>
Modified: sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileimageform2.html
===================================================================
--- sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileimageform2.html 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileimageform2.html 2014-06-03 16:07:04 UTC (rev 8184)
@@ -13,7 +13,7 @@
<p>
Client Agent: <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p>
- Map name: <input type="text" name="MAPDEFINITION" value="Library://Samples/Sheboygan/MapsTiled/Sheboygan.MapDefinition" size="100" ID="Text4">
+ Map/TileSet Definition: <input type="text" name="MAPDEFINITION" value="Library://Samples/Sheboygan/MapsTiled/Sheboygan.MapDefinition" size="100" ID="Text4">
<p>
BaseMapLayerGroup name: <input type="text" name="BASEMAPLAYERGROUPNAME" value="Base Layer Group" size="100" ID="Text5">
<p>
Added: sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html
===================================================================
--- sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html (rev 0)
+++ sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,20 @@
+<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" ID="Form1">
+ <div nowrap="true">
+ <b>Operation:</b> <input type="text" name="OPERATION" value="GETTILEPROVIDERS" size="50" ID="Text1">
+ <p>
+ Version: <input type="text" name="VERSION" value="3.0.0" size="10" ID="Text2">
+ <p>
+ Client Agent: <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+ <p>
+ <input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
+ </div>
+ </form>
+ </body>
+</html>
Modified: sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/tileserviceapi.html
===================================================================
--- sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/tileserviceapi.html 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/UnitTest/WebTier/MapAgent/MapAgentForms/tileserviceapi.html 2014-06-03 16:07:04 UTC (rev 8184)
@@ -13,6 +13,8 @@
<LI>
<A href="gettileimageform2.html" target="showform">GetTileImage R2</a></LI>
<LI>
+ <A href="gettileprovidersform.html" target="showform">GetTileProviders</a></LI>
+ <LI>
<A href="cleartilecacheform.html" target="showform">ClearTileCache</a></LI>
<LI>
<A href="getdefaulttilesizexform.html" target="showform">GetDefaultTileSizeX</a></LI>
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpClearTileCache.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpClearTileCache.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpClearTileCache.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -67,20 +67,30 @@
}
// Need a resource identifier
- Ptr<MgResourceIdentifier> mapDefinition = new MgResourceIdentifier(m_mapDefinition);
+ Ptr<MgResourceIdentifier> resource = new MgResourceIdentifier(m_mapDefinition);
- // Get Resource Service instance
- Ptr<MgResourceService> resourceService = (MgResourceService*)CreateService(MgServiceType::ResourceService);
+ if (resource->IsResourceTypeOf(MgResourceType::MapDefinition))
+ {
+ // Get Resource Service instance
+ Ptr<MgResourceService> resourceService = (MgResourceService*)CreateService(MgServiceType::ResourceService);
- // Create MgMap
- Ptr<MgMap> map = new MgMap();
- map->Create(resourceService, mapDefinition, mapDefinition->GetName());
+ // Create MgMap
+ Ptr<MgMap> map = new MgMap();
+ map->Create(resourceService, resource, resource->GetName());
- // Get Proxy Tile Service instance
- Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
+ // Get Proxy Tile Service instance
+ Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
- // Call the C++ API
- service->ClearCache(map);
+ // Call the C++ API
+ service->ClearCache(map);
+ }
+ else if (resource->IsResourceTypeOf(MgResourceType::TileSetDefinition))
+ {
+ // Get Proxy Tile Service instance
+ Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
+ // Call the C++ API
+ service->ClearCache(resource);
+ }
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpClearTileCache.Execute")
}
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -35,6 +35,11 @@
InitializeCommonParameters(hRequest);
Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version == MG_API_VERSION(3,0,0))
+ {
+ m_tilesetId = params->GetParameterValue(MgHttpResourceStrings::reqTileSet);
+ }
}
/// <summary>
@@ -55,9 +60,19 @@
// Get Proxy Tile Service instance
Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
- INT32 size = service->GetDefaultTileSizeX();
-
- Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(size);
+ Ptr<MgHttpPrimitiveValue> value;
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version == MG_API_VERSION(3, 0, 0) && !m_tilesetId.empty())
+ {
+ Ptr<MgResourceIdentifier> tileSetId = new MgResourceIdentifier(m_tilesetId);
+ INT32 size = service->GetDefaultTileSizeX(tileSetId);
+ value = new MgHttpPrimitiveValue(size);
+ }
+ else
+ {
+ INT32 size = service->GetDefaultTileSizeX();
+ value = new MgHttpPrimitiveValue(size);
+ }
if(!value)
throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -65,3 +80,24 @@
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetDefaultTileSizeX.Execute")
}
+
+/// <summary>
+/// This method is responsible for checking if
+/// a valid version was given
+/// </summary>
+/// <returns>Returns nothing</returns>
+void MgHttpGetDefaultTileSizeX::ValidateOperationVersion()
+{
+ MG_HTTP_HANDLER_TRY()
+
+ // There are multiple supported versions
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version != MG_API_VERSION(1,0,0) &&
+ version != MG_API_VERSION(3,0,0))
+ {
+ throw new MgInvalidOperationVersionException(
+ L"MgHttpGetDefaultTileSizeX.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpGetDefaultTileSizeX.ValidateOperationVersion");
+}
\ No newline at end of file
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.h
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeX.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -51,7 +51,16 @@
/// </returns>
MgRequestClassification GetRequestClassification() { return MgHttpRequestResponseHandler::mrcViewer; }
+protected:
+ /// <summary>
+ /// This method is responsible for checking if
+ /// a valid version was given
+ /// </summary>
+ /// <returns>Returns nothing</returns>
+ virtual void ValidateOperationVersion();
+
private:
+ STRING m_tilesetId;
};
#endif // _FS_GET_DEFAULT_TILE_SIZE_X_H
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -35,6 +35,11 @@
InitializeCommonParameters(hRequest);
Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version == MG_API_VERSION(3,0,0))
+ {
+ m_tilesetId = params->GetParameterValue(MgHttpResourceStrings::reqTileSet);
+ }
}
/// <summary>
@@ -55,9 +60,19 @@
// Get Proxy Tile Service instance
Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
- INT32 size = service->GetDefaultTileSizeY();
-
- Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(size);
+ Ptr<MgHttpPrimitiveValue> value;
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version == MG_API_VERSION(3, 0, 0) && !m_tilesetId.empty())
+ {
+ Ptr<MgResourceIdentifier> tileSetId = new MgResourceIdentifier(m_tilesetId);
+ INT32 size = service->GetDefaultTileSizeY(tileSetId);
+ value = new MgHttpPrimitiveValue(size);
+ }
+ else
+ {
+ INT32 size = service->GetDefaultTileSizeY();
+ value = new MgHttpPrimitiveValue(size);
+ }
if(!value)
throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -65,3 +80,24 @@
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetDefaultTileSizeY.Execute")
}
+
+/// <summary>
+/// This method is responsible for checking if
+/// a valid version was given
+/// </summary>
+/// <returns>Returns nothing</returns>
+void MgHttpGetDefaultTileSizeY::ValidateOperationVersion()
+{
+ MG_HTTP_HANDLER_TRY()
+
+ // There are multiple supported versions
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version != MG_API_VERSION(1,0,0) &&
+ version != MG_API_VERSION(3,0,0))
+ {
+ throw new MgInvalidOperationVersionException(
+ L"MgHttpGetDefaultTileSizeY.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpGetDefaultTileSizeY.ValidateOperationVersion");
+}
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.h
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpGetDefaultTileSizeY.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -51,7 +51,16 @@
/// </returns>
MgRequestClassification GetRequestClassification() { return MgHttpRequestResponseHandler::mrcViewer; }
+protected:
+ /// <summary>
+ /// This method is responsible for checking if
+ /// a valid version was given
+ /// </summary>
+ /// <returns>Returns nothing</returns>
+ virtual void ValidateOperationVersion();
+
private:
+ STRING m_tilesetId;
};
#endif // _FS_GET_DEFAULT_TILE_SIZE_Y_H
Added: sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.cpp (rev 0)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,87 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#include "HttpHandler.h"
+#include "HttpGetTileProviders.h"
+
+HTTP_IMPLEMENT_CREATE_OBJECT(MgHttpGetTileProviders)
+
+/// <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>
+MgHttpGetTileProviders::MgHttpGetTileProviders(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 MgHttpGetTileProviders::Execute(MgHttpResponse& hResponse)
+{
+ Ptr<MgHttpResult> hResult = hResponse.GetResult();
+
+ MG_HTTP_HANDLER_TRY()
+
+ // Check common parameters
+ ValidateCommonParameters();
+
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version == MG_API_VERSION(3,0,0))
+ {
+ // Get Proxy Tile Service instance
+ Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
+
+ // Call the C++ API
+ Ptr<MgByteReader> providers = service->GetTileProviders();
+
+ // Set the result
+ hResult->SetResultObject(providers, providers->GetMimeType());
+ }
+
+ MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetTileProviders.Execute")
+}
+
+/// <summary>
+/// This method is responsible for checking if
+/// a valid version was given
+/// </summary>
+/// <returns>Returns nothing</returns>
+void MgHttpGetTileProviders::ValidateOperationVersion()
+{
+ MG_HTTP_HANDLER_TRY()
+
+ // There are multiple supported versions
+ INT32 version = m_userInfo->GetApiVersion();
+ if (version != MG_API_VERSION(3,0,0))
+ {
+ throw new MgInvalidOperationVersionException(
+ L"MgHttpGetTileProviders.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpGetTileProviders.ValidateOperationVersion");
+}
Added: sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.h
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.h (rev 0)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpGetTileProviders.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -0,0 +1,64 @@
+//
+// Copyright (C) 2004-2014 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef _FS_GET_TILE_PROVIDERS_H
+#define _FS_GET_TILE_PROVIDERS_H
+
+class MgHttpGetTileProviders : 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>
+ MgHttpGetTileProviders(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);
+
+ /// <summary>
+ /// Returns the classification of this request/response handler
+ /// </summary>
+ /// <returns>
+ /// Classification of handler
+ /// </returns>
+ MgRequestClassification GetRequestClassification() { return MgHttpRequestResponseHandler::mrcViewer; }
+
+protected:
+ /// <summary>
+ /// This method is responsible for checking if
+ /// a valid version was given
+ /// </summary>
+ /// <returns>Returns nothing</returns>
+ virtual void ValidateOperationVersion();
+
+};
+
+#endif // _FS_GET_TILE_PROVIDERS_H
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj 2014-06-03 16:07:04 UTC (rev 8184)
@@ -312,6 +312,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
+ <ClCompile Include="HttpGetTileProviders.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="HttpInheritPermissionsFrom.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -968,6 +974,7 @@
<ClInclude Include="HttpGetResourceContent.h" />
<ClInclude Include="HttpGetResourceData.h" />
<ClInclude Include="HttpGetResourceHeader.h" />
+ <ClInclude Include="HttpGetTileProviders.h" />
<ClInclude Include="HttpInheritPermissionsFrom.h" />
<ClInclude Include="HttpMoveResource.h" />
<ClInclude Include="HttpRenameResourceData.h" />
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpHandler.vcxproj.filters 2014-06-03 16:07:04 UTC (rev 8184)
@@ -386,6 +386,10 @@
<ClCompile Include="ReaderByteSourceImpl.cpp">
<Filter>Byte Source Adapters</Filter>
</ClCompile>
+ <ClCompile Include="HttpDescribeRuntimeMap.cpp" />
+ <ClCompile Include="HttpGetTileProviders.cpp">
+ <Filter>Tile Service</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="HttpApplyResourcePackage.h">
@@ -757,6 +761,10 @@
<ClInclude Include="ReaderByteSourceImpl.h">
<Filter>Byte Source Adapters</Filter>
</ClInclude>
+ <ClInclude Include="HttpDescribeRuntimeMap.h" />
+ <ClInclude Include="HttpGetTileProviders.h">
+ <Filter>Tile Service</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="HttpHandler.rc" />
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpHandlerBuild.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpHandlerBuild.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpHandlerBuild.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -92,6 +92,7 @@
#include "HttpGetSiteVersion.cpp"
#include "HttpGetSpatialContexts.cpp"
#include "HttpGetTileImage.cpp"
+#include "HttpGetTileProviders.cpp"
#include "HttpGetVisibleMapExtent.cpp"
#include "HttpHeader.cpp"
#include "HttpInheritPermissionsFrom.cpp"
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpRequest.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpRequest.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpRequest.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -91,6 +91,7 @@
// Http Tile Service operations
#include "HttpGetTileImage.h"
#include "HttpClearTileCache.h"
+#include "HttpGetTileProviders.h"
// Http Kml Service operations
#include "HttpKmlGetMap.h"
@@ -401,6 +402,7 @@
httpClassCreators[MgHttpResourceStrings::opQueryMapFeatures] = MgHttpQueryMapFeatures::CreateObject;
httpClassCreators[MgHttpResourceStrings::opGetTileImage] = MgHttpGetTileImage::CreateObject;
httpClassCreators[MgHttpResourceStrings::opClearTileCache] = MgHttpClearTileCache::CreateObject;
+ httpClassCreators[MgHttpResourceStrings::opGetTileProviders] = MgHttpGetTileProviders::CreateObject;
httpClassCreators[MgHttpResourceStrings::opWmsGetCapabilities] = MgHttpWmsGetCapabilities::CreateObject;
httpClassCreators[MgHttpResourceStrings::opWmsGetMap] = MgHttpWmsGetMap::CreateObject;
httpClassCreators[MgHttpResourceStrings::opWmsCapabilities] = MgHttpWmsGetCapabilities::CreateObject;
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.cpp 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.cpp 2014-06-03 16:07:04 UTC (rev 8184)
@@ -261,12 +261,14 @@
// Predefined Tile Service Request Parameters
const STRING MgHttpResourceStrings::reqTileMapDefinition = L"MAPDEFINITION";
+const STRING MgHttpResourceStrings::reqTileSet = L"TILESET";
// Tile Service Operation Requests
const STRING MgHttpResourceStrings::opGetTileImage = L"GETTILEIMAGE";
const STRING MgHttpResourceStrings::opClearTileCache = L"CLEARTILECACHE";
const STRING MgHttpResourceStrings::opGetDefaultTileSizeX = L"GETDEFAULTTILESIZEX";
const STRING MgHttpResourceStrings::opGetDefaultTileSizeY = L"GETDEFAULTTILESIZEY";
+const STRING MgHttpResourceStrings::opGetTileProviders = L"GETTILEPROVIDERS";
// Predefined Kml Service Request Parameters
const STRING MgHttpResourceStrings::reqKmlMapDefinition = L"MAPDEFINITION";
Modified: sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.h 2014-06-03 11:21:59 UTC (rev 8183)
+++ sandbox/jng/tiling/Web/src/HttpHandler/HttpResourceStrings.h 2014-06-03 16:07:04 UTC (rev 8184)
@@ -189,6 +189,7 @@
// PREDEFINED TILE REQUEST PARAMETERS
static const STRING reqTileMapDefinition;
+ static const STRING reqTileSet;
// PREDEFINED KML REQUEST PARAMETERS
static const STRING reqKmlMapDefinition;
@@ -319,6 +320,7 @@
static const STRING opClearTileCache;
static const STRING opGetDefaultTileSizeX;
static const STRING opGetDefaultTileSizeY;
+ static const STRING opGetTileProviders;
// Kml services
static const STRING opGetMapKml;
More information about the mapguide-commits
mailing list