[mapguide-commits] r9643 - sandbox/jng/mapstatecache2/Server/src/Services/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jan 30 03:21:14 PST 2020
Author: jng
Date: 2020-01-30 03:21:13 -0800 (Thu, 30 Jan 2020)
New Revision: 9643
Added:
sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.cpp
sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.h
Log:
The previous sandbox left out these 2 files from the initial commit. Re-create these files.
Added: sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.cpp
===================================================================
--- sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.cpp (rev 0)
+++ sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.cpp 2020-01-30 11:21:13 UTC (rev 9643)
@@ -0,0 +1,199 @@
+//
+// Copyright (C) 2004-2020 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 "ServerMappingServiceDefs.h"
+#include "OpCreateRuntimeMap.h"
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Constructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpCreateMap::MgOpCreateMap()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Destructs the object.
+/// </summary>
+///----------------------------------------------------------------------------
+MgOpCreateMap::~MgOpCreateMap()
+{
+}
+
+
+///----------------------------------------------------------------------------
+/// <summary>
+/// Executes the operation.
+/// </summary>
+///
+/// <exceptions>
+/// MgException
+/// </exceptions>
+///----------------------------------------------------------------------------
+void MgOpCreateMap::Execute()
+{
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT(" (%t) MgOpCreateMap::Execute()\n")));
+
+ MG_LOG_OPERATION_MESSAGE(L"CreateMap");
+
+ MG_TRY()
+
+ MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+
+ ACE_ASSERT(m_stream != NULL);
+
+ if (8 == m_packet.m_NumArguments)
+ {
+ STRING targetMapName;
+ STRING sessionId;
+ STRING iconFormat;
+ INT32 iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange;
+
+ Ptr<MgResourceIdentifier> mapDefinition = (MgResourceIdentifier*)m_stream->GetObject();
+ m_stream->GetString(targetMapName);
+ m_stream->GetString(sessionId);
+ m_stream->GetString(iconFormat);
+ m_stream->GetInt32(iconWidth);
+ m_stream->GetInt32(iconHeight);
+ m_stream->GetInt32(requestedFeatures);
+ m_stream->GetInt32(iconsPerScaleRange);
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == mapDefinition) ? L"MgResourceIdentifier" : mapDefinition->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(targetMapName);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(sessionId);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(iconFormat);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconWidth);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconHeight);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(requestedFeatures);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(iconsPerScaleRange);
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ Ptr<MgByteReader> byteReader =
+ m_service->CreateRuntimeMap(mapDefinition, targetMapName, sessionId, iconFormat, iconWidth, iconHeight, requestedFeatures, iconsPerScaleRange);
+
+ EndExecution(byteReader);
+ }
+ else if (8 == m_packet.m_NumArguments)
+ {
+ STRING mapName;
+ INT32 displayWidth;
+ INT32 displayHeight;
+ double x;
+ double y;
+ double scale;
+ INT32 dpi;
+
+ Ptr<MgResourceIdentifier> mapDefinition = (MgResourceIdentifier*)m_stream->GetObject();
+ m_stream->GetString(mapName);
+ m_stream->GetInt32(displayWidth);
+ m_stream->GetInt32(displayHeight);
+ m_stream->GetDouble(x);
+ m_stream->GetDouble(y);
+ m_stream->GetDouble(scale);
+ m_stream->GetInt32(dpi);
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == mapDefinition) ? L"MgResourceIdentifier" : mapDefinition->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(mapName);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(displayWidth);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(displayHeight);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_DOUBLE(x);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_DOUBLE(y);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_DOUBLE(scale);
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_INT32(dpi);
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ Ptr<MgMap> map = m_service->CreateMap(mapDefinition, mapName, displayWidth, displayHeight, x, y, scale, dpi);
+
+ EndExecution(map);
+ }
+ else if (2 == m_packet.m_NumArguments)
+ {
+ STRING mapName;
+
+ Ptr<MgResourceIdentifier> mapDefinition = (MgResourceIdentifier*)m_stream->GetObject();
+ m_stream->GetString(mapName);
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING((NULL == mapDefinition) ? L"MgResourceIdentifier" : mapDefinition->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(mapName);
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ Ptr<MgMap> map = m_service->CreateMap(mapDefinition, mapName);
+
+ EndExecution(map);
+ }
+ else
+ {
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+ }
+
+ if (!m_argsRead)
+ {
+ throw new MgOperationProcessingException(L"MgOpCreateMap.Execute",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
+ // Successful operation
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+
+ MG_CATCH(L"MgOpCreateMap.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/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.h
===================================================================
--- sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.h (rev 0)
+++ sandbox/jng/mapstatecache2/Server/src/Services/Mapping/OpCreateMap.h 2020-01-30 11:21:13 UTC (rev 9643)
@@ -0,0 +1,31 @@
+//
+// Copyright (C) 2004-2020 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_CREATE_MAP_H
+#define MG_OP_CREATE_MAP_H
+
+class MgOpCreateMap : public MgMappingOperation
+{
+ public:
+ MgOpCreateMap();
+ virtual ~MgOpCreateMap();
+
+ public:
+ virtual void Execute();
+};
+
+#endif
\ No newline at end of file
More information about the mapguide-commits
mailing list