[mapguide-commits] r6251 - trunk/MgDev/Server/src/Services/Feature
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sat Nov 26 07:34:54 EST 2011
Author: jng
Date: 2011-11-26 04:34:54 -0800 (Sat, 26 Nov 2011)
New Revision: 6251
Removed:
trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.cpp
trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.h
Modified:
trunk/MgDev/Server/src/Services/Feature/FeatureServiceCommand.cpp
trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp
trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp
trunk/MgDev/Server/src/Services/Feature/SelectCommand.h
trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj
trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj
trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj.filters
trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceBuild.cpp
trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceDefs.h
trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
Log:
#1866: Fix up the RFC123 implementation. The standard select command provides the required Join APIs so update the MgSelectCommand to expose these new APIs. Because we don't use extended select command anymore, we have no use for it and so it is removed from the project.
Deleted: trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.cpp 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.cpp 2011-11-26 12:34:54 UTC (rev 6251)
@@ -1,417 +0,0 @@
-//
-// 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 "ServerFeatureServiceDefs.h"
-#include "MapGuideCommon.h"
-#include "Services/FeatureService.h"
-#include "FeatureServiceCommand.h"
-#include "ExtendedSelectCommand.h"
-#include "SelectAggregateCommand.h"
-#include "ServerFeatureReader.h"
-#include "ServerFeatureConnection.h"
-#include "FdoFeatureReader.h"
-#include "FdoFilterCollection.h"
-#include "FdoReaderCollection.h"
-#include "Util/FdoExpressionEngineUtilDataReader.h"
-#include "FdoForcedOneToOneFeatureReader.h"
-
-// The maximum size of the subfilter for a selection query. Tune this value for optimal selection perfomance.
-#define MG_MAX_SUBFILTER_SIZE 250
-
-MgExtendedSelectCommand::MgExtendedSelectCommand(MgResourceIdentifier* resource)
-{
- CHECKNULL((MgResourceIdentifier*)resource, L"MgExtendedSelectCommand.MgSelectCommand");
-
- // Connect to provider
- m_connection = new MgServerFeatureConnection(resource);
- if ((NULL != m_connection.p) && ( m_connection->IsConnectionOpen() ))
- {
- m_providerName = m_connection->GetProviderName();
- }
- else
- {
- throw new MgConnectionFailedException(L"MgExtendedSelectCommand.MgSelectCommand", __LINE__, __WFILE__, NULL, L"", NULL);
- }
- // Create FdoISelect command
- FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
- m_command = (FdoIExtendedSelect*)fdoConn->CreateCommand(FdoCommandType_ExtendedSelect);
- CHECKNULL((FdoIExtendedSelect*)m_command, L"MgExtendedSelectCommand.MgSelectCommand");
-}
-
-MgExtendedSelectCommand::~MgExtendedSelectCommand()
-{
- m_command = NULL;
- m_filter = NULL;
-}
-
-FdoIdentifierCollection* MgExtendedSelectCommand::GetPropertyNames()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetPropertyNames");
- return m_command->GetPropertyNames();
-}
-
-FdoJoinCriteriaCollection* MgExtendedSelectCommand::GetJoinCriteria()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetJoinCriteria");
- return m_command->GetJoinCriteria();
-}
-
-void MgExtendedSelectCommand::SetAlias(FdoString* alias)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetDistinct");
- m_command->SetAlias(alias);
-}
-
-void MgExtendedSelectCommand::SetDistinct(bool value)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetDistinct");
- // This operation is not supported by FdoISelect
- // m_command->SetDistinct(value);
-
- // throw new MgInvalidOperationException(L"MgExtendedSelectCommand.SetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-bool MgExtendedSelectCommand::GetDistinct()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetDistinct");
- // This operation is not supported by FdoISelect
- // return m_command->GetDistinct();
-
- // throw new MgInvalidOperationException(L"MgExtendedSelectCommand.GetDistinct", __LINE__, __WFILE__, NULL, L"", NULL);
-
- return false;
-}
-
-void MgExtendedSelectCommand::SetFetchSize(FdoInt32 fetchSize)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetFetchSize");
- m_command->SetFetchSize(fetchSize);
-}
-
-FdoInt32 MgExtendedSelectCommand::GetFetchSize()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetFetchSize");
- return m_command->GetFetchSize();
-}
-
-FdoIdentifierCollection* MgExtendedSelectCommand::GetOrdering()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetOrdering");
- return m_command->GetOrdering();
-}
-
-void MgExtendedSelectCommand::SetOrderingOption(FdoOrderingOption option)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetOrderingOption");
- ((FdoIBaseSelect*)m_command)->SetOrderingOption(option);
-}
-
-FdoOrderingOption MgExtendedSelectCommand::GetOrderingOption()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetOrderingOption");
- return ((FdoIBaseSelect*)m_command)->GetOrderingOption();
-}
-
-FdoIdentifierCollection* MgExtendedSelectCommand::GetGrouping()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetGrouping");
- // This operation is not supported by FdoISelect
- // return m_command->GetGrouping();
-
- // throw new MgInvalidOperationException(L"MgExtendedSelectCommand.GetGrouping", __LINE__, __WFILE__, NULL, L"", NULL);
- return NULL;
-}
-
-void MgExtendedSelectCommand::SetGroupingFilter(FdoFilter* filter)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetGroupingFilter");
- // This operation is not supported by FdoISelect
- // m_command->SetGroupingFilter(filter);
-
- // throw new MgInvalidOperationException(L"MgExtendedSelectCommand.SetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-FdoFilter* MgExtendedSelectCommand::GetGroupingFilter()
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.GetGroupingFilter");
- // This operation is not supported by FdoISelect
- // return m_command->GetGroupingFilter(filter);
-
- // throw new MgInvalidOperationException(L"MgExtendedSelectCommand.GetGroupingFilter", __LINE__, __WFILE__, NULL, L"", NULL);
- return NULL;
-}
-
-void MgExtendedSelectCommand::SetFeatureClassName(FdoString* value)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetFeatureClassName");
- m_command->SetFeatureClassName(value);
-}
-
-void MgExtendedSelectCommand::SetFilter(FdoString* value)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetFilter");
- m_command->SetFilter(value);
-#ifdef DEBUG_FDO_JOIN
- ACE_DEBUG((LM_INFO, ACE_TEXT("\n\t(%t) [FDO Join] Set Filter: %W"), value));
-#endif
-}
-
-void MgExtendedSelectCommand::SetFilter(FdoFilter* value)
-{
- CHECKNULL((FdoISelect*)m_command, L"MgExtendedSelectCommand.SetFilter");
- m_command->SetFilter(value);
-#ifdef DEBUG_FDO_JOIN
- ACE_DEBUG((LM_INFO, ACE_TEXT("\n\t(%t) [FDO Join] Set Filter: %W"), value->ToString()));
-#endif
- m_filter = FDO_SAFE_ADDREF(value);
-}
-
-MgReader* MgExtendedSelectCommand::Execute()
-{
- throw new MgNotImplementedException(L"MgExtendedSelectCommand.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgReader* MgExtendedSelectCommand::ExecuteJoined(MgStringCollection* idPropNames, bool bForceOneToOne)
-{
- Ptr<MgReader> ret;
-
- MG_FEATURE_SERVICE_TRY()
-
- FdoPtr<FdoIFeatureReader> fdoReader = m_command->Execute();
- if (bForceOneToOne)
- {
- FdoPtr<FdoStringCollection> names = MgServerFeatureUtil::MgToFdoStringCollection(idPropNames, false);
- FdoPtr<FdoIFeatureReader> forcedReader = new MgFdoForcedOneToOneFeatureReader(fdoReader, names);
- ret = new MgServerFeatureReader(m_connection, forcedReader);
- }
- else
- {
- ret = new MgServerFeatureReader(m_connection, fdoReader);
- }
- MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgExtendedSelectCommand.ExecuteJoined")
-
- return ret.Detach();
-}
-
-bool MgExtendedSelectCommand::IsSupportedFunction(FdoFunction* fdoFunc)
-{
- FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
- return this->IsFdoSupportedFunction(fdoConn, fdoFunc);
-}
-
-bool MgExtendedSelectCommand::SupportsSelectGrouping()
-{
- FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
- return MgFeatureServiceCommand::SupportsSelectGrouping(fdoConn);
-}
-
-bool MgExtendedSelectCommand::SupportsSelectOrdering()
-{
- FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
- return MgFeatureServiceCommand::SupportsSelectOrdering(fdoConn);
-}
-
-bool MgExtendedSelectCommand::SupportsSelectDistinct()
-{
- FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
- return MgFeatureServiceCommand::SupportsSelectDistinct(fdoConn);
-}
-
-FdoFilter* MgExtendedSelectCommand::GetFilter()
-{
- return FDO_SAFE_ADDREF(m_filter.p);
-}
-
-MgFdoFilterCollection* MgExtendedSelectCommand::GetSubFilters()
-{
- // Break up a filter into a bunch of smaller filters
-
- // For now we just reduce a simple case with datastore limitations in handling the number of OR conditions.
- // This is the case where a filter has only OR spatial conditions that can be broken up into a collection
- // of smaller OR filters.
-
- class FdoCommonFilterFragmenter : public virtual FdoIFilterProcessor
- {
- private:
- FdoPtr<FdoFilter> m_newFilter;
- FdoPtr<FdoIGeometry> m_geomRight;
- FdoPtr<FdoIGeometry> m_geomLeft;
-
- int m_OrCount;
- std::vector<FdoFilter*> m_filters;
- bool m_isFragmented;
-
- protected:
- void HandleFilter( FdoFilter *filter )
- {
- filter->Process( this );
- }
- public:
-
- FdoCommonFilterFragmenter( ):m_isFragmented(true)
- {
- m_OrCount = 0;
- m_filters.clear();
- }
-
- int GetOrCount() { return m_OrCount; }
- std::vector<FdoFilter*>& GetFilters() { return m_filters; }
- bool IsFragmented() { return m_isFragmented; }
- FdoFilter* GetNewFilter() { return m_newFilter ? FDO_SAFE_ADDREF(m_newFilter.p) : NULL; }
-
- virtual void Dispose()
- {
- delete this;
- }
-
- virtual void ProcessBinaryLogicalOperator(FdoBinaryLogicalOperator& filter)
- {
- if( filter.GetOperation() != FdoBinaryLogicalOperations_Or )
- {
- m_isFragmented = false;
- return;
- }
-
- HandleFilter( FdoPtr<FdoFilter>(filter.GetRightOperand()) );
- m_newFilter = filter.GetLeftOperand();
-
- m_OrCount++;
- }
- virtual void ProcessComparisonCondition(FdoComparisonCondition& filter)
- {
- // Add filter to collection
- m_filters.push_back(&filter);
- return;
- }
- virtual void ProcessDistanceCondition(FdoDistanceCondition& filter)
- {
- m_isFragmented = false;
- return;
- }
-
- virtual void ProcessInCondition(FdoInCondition& filter)
- {
- m_isFragmented = false;
- return;
- }
- virtual void ProcessNullCondition(FdoNullCondition& filter)
- {
- m_isFragmented = false;
- return;
- }
- virtual void ProcessSpatialCondition(FdoSpatialCondition& filter)
- {
- m_isFragmented = false;
- return;
- }
-
- virtual void ProcessUnaryLogicalOperator(FdoUnaryLogicalOperator& filter)
- {
- m_isFragmented = false;
- return;
- }
- };
-
-
- FdoCommonFilterFragmenter fragmenter;
- if (m_filter)
- m_filter->Process( &fragmenter );
-
- FdoPtr<FdoFilter> newFilter = fragmenter.GetNewFilter();
- while (newFilter != NULL)
- {
- newFilter->Process( &fragmenter );
- FdoPtr<FdoFilter> tempFilter = fragmenter.GetNewFilter();
- if (tempFilter != newFilter)
- {
- newFilter = tempFilter;
- }
- else
- {
- newFilter = NULL;
- }
- }
-
-#ifdef _DEBUG
- int nCount = fragmenter.GetOrCount();
- if ( nCount > 0)
- {
- char temp[1024];
- sprintf(temp, "Or_Count = %d", nCount); // NOXLATE
- printf("%s\n", temp);
- }
-#endif
-
- FdoPtr<MgFdoFilterCollection> filters = MgFdoFilterCollection::Create();
-
- if (fragmenter.IsFragmented() && fragmenter.GetOrCount() > 0)
- {
- int nSelectionCount = 0;
-
- std::vector<FdoFilter*>::iterator filterIter;
- bool bFirst = true;
-
- FdoStringP filterString;
- std::vector<FdoFilter*>& fragmentedFilters = fragmenter.GetFilters();
-
-
- bool bIsAddedToCollection = false;
-
- for (filterIter = fragmentedFilters.begin(); filterIter != fragmentedFilters.end(); filterIter++)
- {
- FdoStringP tempString = (*filterIter)->ToString();
- FdoStringP orString = L" OR "; // NOXLATE
- if (bFirst)
- {
- filterString = tempString;
- bFirst = false;
- }
- else
- {
- filterString = filterString + orString + tempString;
- nSelectionCount++;
- }
-
- if (nSelectionCount >= MG_MAX_SUBFILTER_SIZE)
- {
- FdoPtr<FdoFilter> filter = FdoFilter::Parse(filterString);
- filters->Add(filter);
- bFirst = true;
- filterString = L"";
- nSelectionCount = 0;
- bIsAddedToCollection = true;
- }
- else
- {
- bIsAddedToCollection = false;
- }
- }
-
- if ( !bIsAddedToCollection )
- {
- FdoPtr<FdoFilter> filter = FdoFilter::Parse(filterString);
- filters->Add(filter);
- }
-
- }
- else
- {
- filters->Add(m_filter);
- }
-
- return filters.Detach();
-}
Deleted: trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.h 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ExtendedSelectCommand.h 2011-11-26 12:34:54 UTC (rev 6251)
@@ -1,83 +0,0 @@
-//
-// 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 _MGEXTENDEDSELECTCOMMAND_H_
-#define _MGEXTENDEDSELECTCOMMAND_H_
-
-class MgFdoFeatureReader;
-class MgFdoReaderCollection;
-class MgFdoFilterCollection;
-
-class MgExtendedSelectCommand : public MgFeatureServiceCommand
-{
- DECLARE_CLASSNAME(MgExtendedSelectCommand)
-
-public:
- MgExtendedSelectCommand(MgResourceIdentifier* resource);
- virtual ~MgExtendedSelectCommand();
-
- virtual FdoIdentifierCollection* GetPropertyNames();
-
- virtual void SetDistinct( bool value );
- virtual bool GetDistinct( );
-
- virtual void SetFetchSize(FdoInt32 fetchSize);
- virtual FdoInt32 GetFetchSize();
-
- virtual FdoIdentifierCollection* GetOrdering();
- virtual void SetOrderingOption( FdoOrderingOption option );
- virtual FdoOrderingOption GetOrderingOption( );
-
- virtual FdoIdentifierCollection* GetGrouping();
- virtual void SetGroupingFilter( FdoFilter* filter );
- virtual FdoFilter* GetGroupingFilter( );
-
- virtual void SetFeatureClassName(FdoString* value);
- virtual void SetFilter(FdoString* value);
- virtual void SetFilter(FdoFilter* value);
-
- virtual FdoFilter* GetFilter();
-
- virtual MgReader* Execute(); //Not used
- MgReader* ExecuteJoined(MgStringCollection* idPropNames, bool bForceOneToOne);
-
- virtual bool IsSupportedFunction(FdoFunction* fdoFunc);
-
- virtual bool SupportsSelectGrouping();
- virtual bool SupportsSelectOrdering();
- virtual bool SupportsSelectDistinct();
-
- virtual void Dispose()
- {
- delete this;
- }
-
- virtual FdoJoinCriteriaCollection* GetJoinCriteria();
-
- virtual void SetAlias(FdoString* alias);
-
-private:
- Ptr<MgServerFeatureConnection> m_connection;
- STRING m_providerName;
- FdoPtr<FdoIExtendedSelect> m_command;
-
- FdoPtr<FdoFilter> m_filter;
-
- MgFdoFilterCollection* GetSubFilters();
-};
-
-#endif
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureServiceCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureServiceCommand.cpp 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureServiceCommand.cpp 2011-11-26 12:34:54 UTC (rev 6251)
@@ -20,7 +20,6 @@
#include "Services/FeatureService.h"
#include "FeatureServiceCommand.h"
#include "SelectCommand.h"
-#include "ExtendedSelectCommand.h"
#include "SelectAggregateCommand.h"
MgFeatureServiceCommand* MgFeatureServiceCommand::CreateCommand(MgResourceIdentifier* resource, FdoCommandType commandType)
@@ -38,11 +37,6 @@
command = new MgSelectAggregateCommand(resource);
break;
}
- case FdoCommandType_ExtendedSelect:
- {
- command = new MgExtendedSelectCommand(resource);
- break;
- }
}
return command.Detach();
}
Modified: trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.cpp 2011-11-26 12:34:54 UTC (rev 6251)
@@ -199,7 +199,7 @@
Ptr<MgReader> ret;
FdoPtr<FdoIConnection> fdoConn = m_connection->GetConnection();
- FdoPtr<FdoIExtendedSelect> select = static_cast<FdoIExtendedSelect*>(fdoConn->CreateCommand(FdoCommandType_ExtendedSelect));
+ FdoPtr<FdoISelect> select = static_cast<FdoISelect*>(fdoConn->CreateCommand(FdoCommandType_Select));
FdoPtr<FdoIdentifier> clsName = m_command->GetFeatureClassName();
select->SetFeatureClassName(clsName);
@@ -271,7 +271,7 @@
FdoOrderingOption orderOpt = m_command->GetOrderingOption();
//n00bism: String goes in, garbage comes out. Anyway, we know the alias we want to set
- select->SetAlias(L"primary");
+ select->SetAlias(PRIMARY_ALIAS);
//select->SetAlias(m_command->GetAlias());
FdoPtr<FdoJoinCriteriaCollection> srcCriteria = GetJoinCriteria();
Modified: trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp 2011-11-26 12:34:54 UTC (rev 6251)
@@ -396,3 +396,37 @@
return filters.Detach();
}
+
+FdoJoinCriteriaCollection* MgSelectCommand::GetJoinCriteria()
+{
+ CHECKNULL((FdoISelect*)m_command, L"MgSelectCommand.GetJoinCriteria");
+ return m_command->GetJoinCriteria();
+}
+
+void MgSelectCommand::SetAlias(FdoString* alias)
+{
+ CHECKNULL((FdoISelect*)m_command, L"MgSelectCommand.SetDistinct");
+ m_command->SetAlias(alias);
+}
+
+MgReader* MgSelectCommand::ExecuteJoined(MgStringCollection* idPropNames, bool bForceOneToOne)
+{
+ Ptr<MgReader> ret;
+
+ MG_FEATURE_SERVICE_TRY()
+
+ FdoPtr<FdoIFeatureReader> fdoReader = m_command->Execute();
+ if (bForceOneToOne)
+ {
+ FdoPtr<FdoStringCollection> names = MgServerFeatureUtil::MgToFdoStringCollection(idPropNames, false);
+ FdoPtr<FdoIFeatureReader> forcedReader = new MgFdoForcedOneToOneFeatureReader(fdoReader, names);
+ ret = new MgServerFeatureReader(m_connection, forcedReader);
+ }
+ else
+ {
+ ret = new MgServerFeatureReader(m_connection, fdoReader);
+ }
+ MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgSelectCommand.ExecuteJoined")
+
+ return ret.Detach();
+}
\ No newline at end of file
Modified: trunk/MgDev/Server/src/Services/Feature/SelectCommand.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectCommand.h 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/SelectCommand.h 2011-11-26 12:34:54 UTC (rev 6251)
@@ -65,6 +65,10 @@
delete this;
}
+ MgReader* ExecuteJoined(MgStringCollection* idPropNames, bool bForceOneToOne);
+ virtual FdoJoinCriteriaCollection* GetJoinCriteria();
+ virtual void SetAlias(FdoString* alias);
+
private:
Ptr<MgServerFeatureConnection> m_connection;
STRING m_providerName;
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj 2011-11-26 12:34:54 UTC (rev 6251)
@@ -2209,46 +2209,6 @@
>
</File>
<File
- RelativePath=".\ExtendedSelectCommand.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\ExtendedSelectCommand.h"
- >
- </File>
- <File
RelativePath=".\FdoFeatureReader.cpp"
>
<FileConfiguration
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj 2011-11-26 12:34:54 UTC (rev 6251)
@@ -205,12 +205,6 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="ExtendedSelectCommand.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </ClCompile>
<ClCompile Include="FdoForcedOneToOneFeatureReader.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
@@ -788,7 +782,6 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="ExtendedSelectCommand.h" />
<ClInclude Include="FdoForcedOneToOneFeatureReader.h" />
<ClInclude Include="FeatureOperation.h" />
<ClInclude Include="FeatureOperationFactory.h" />
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj.filters
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj.filters 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.vcxproj.filters 2011-11-26 12:34:54 UTC (rev 6251)
@@ -187,7 +187,6 @@
<ClCompile Include="ServerUpdateCommand.cpp" />
<ClCompile Include="ServerUpdateFeatures.cpp" />
<ClCompile Include="TransformCache.cpp" />
- <ClCompile Include="ExtendedSelectCommand.cpp" />
<ClCompile Include="FdoForcedOneToOneFeatureReader.cpp" />
</ItemGroup>
<ItemGroup>
@@ -385,7 +384,6 @@
<ClInclude Include="StringDataReaderCreator.h" />
<ClInclude Include="TransformCache.h" />
<ClInclude Include="UniqueFunction.h" />
- <ClInclude Include="ExtendedSelectCommand.h" />
<ClInclude Include="FdoForcedOneToOneFeatureReader.h" />
</ItemGroup>
<ItemGroup>
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceBuild.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceBuild.cpp 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceBuild.cpp 2011-11-26 12:34:54 UTC (rev 6251)
@@ -70,7 +70,6 @@
#include "OpGetDataRows.cpp"
#include "SelectAggregateCommand.cpp"
#include "SelectCommand.cpp"
-#include "ExtendedSelectCommand.cpp"
#include "ServerDataReader.cpp"
#include "ServerSqlDataReaderPool.cpp"
#include "FeatureNumericFunctions.cpp"
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceDefs.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceDefs.h 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureServiceDefs.h 2011-11-26 12:34:54 UTC (rev 6251)
@@ -24,4 +24,7 @@
#include "Fdo.h"
#include "ServerFeatureServiceExceptionDef.h"
+#define PRIMARY_ALIAS L"a"
+#define SECONDARY_ALIAS L"b"
+
#endif
Modified: trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp 2011-11-25 15:27:04 UTC (rev 6250)
+++ trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp 2011-11-26 12:34:54 UTC (rev 6251)
@@ -24,7 +24,6 @@
#include "ServerFeatureUtil.h"
#include "FeatureServiceCommand.h"
#include "SelectCommand.h"
-#include "ExtendedSelectCommand.h"
#include "SelectAggregateCommand.h"
#include "FeatureDistribution.h"
#include "ServerGwsFeatureReader.h"
@@ -111,7 +110,7 @@
#ifdef DEBUG_FDO_JOIN
ACE_DEBUG((LM_INFO, ACE_TEXT("\n(%t) Feature Source (%W) supports FDO join optimization"), fsIdStr.c_str()));
#endif
- m_command = MgFeatureServiceCommand::CreateCommand(resource, FdoCommandType_ExtendedSelect);
+ m_command = MgFeatureServiceCommand::CreateCommand(resource, FdoCommandType_Select);
mgReader = SelectFdoJoin(resource, className, false);
}
else
@@ -141,7 +140,7 @@
#endif
// Perform the same select query as above, but route this through the FDO expression engine
// Slow maybe, but anything is faster than going via the GWS query engine.
- m_command = MgFeatureServiceCommand::CreateCommand(resource, FdoCommandType_ExtendedSelect);
+ m_command = MgFeatureServiceCommand::CreateCommand(resource, FdoCommandType_Select);
mgReader = SelectFdoJoin(resource, className, true);
}
else
@@ -1894,8 +1893,8 @@
const MdfModel::MdfString& prefix = relate->GetName();
- STRING primaryAlias = L"primary";
- STRING secondaryAlias = L"secondary";
+ STRING primaryAlias = PRIMARY_ALIAS;
+ STRING secondaryAlias = SECONDARY_ALIAS;
FdoPtr<FdoJoinCriteriaCollection> joinCriteria;
if (isAggregate)
@@ -1906,7 +1905,7 @@
}
else
{
- MgExtendedSelectCommand* cmd = static_cast<MgExtendedSelectCommand*>(m_command.p);
+ MgSelectCommand* cmd = static_cast<MgSelectCommand*>(m_command.p);
cmd->SetAlias(primaryAlias.c_str());
joinCriteria = cmd->GetJoinCriteria();
}
@@ -2020,7 +2019,7 @@
if (isAggregate)
ret = ((MgSelectAggregateCommand*)m_command.p)->ExecuteJoined(idPropNames, bForceOneToOne);
else
- ret = ((MgExtendedSelectCommand*)m_command.p)->ExecuteJoined(idPropNames, bForceOneToOne);
+ ret = ((MgSelectCommand*)m_command.p)->ExecuteJoined(idPropNames, bForceOneToOne);
MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgServerSelectFeatures.SelectFdoJoin")
@@ -2062,8 +2061,8 @@
const MdfModel::MdfString& prefix = relate->GetName();
- STRING primaryAlias = L"primary";
- STRING secondaryAlias = L"secondary";
+ STRING primaryAlias = PRIMARY_ALIAS;
+ STRING secondaryAlias = SECONDARY_ALIAS;
MgSelectAggregateCommand* extSelect = static_cast<MgSelectAggregateCommand*>(m_command.p);
extSelect->SetAlias(primaryAlias.c_str());
More information about the mapguide-commits
mailing list