220 | | |
221 | | |
| 220 | ===== IProviderRegistry::!GetProviders (modified) ===== |
| 221 | |
| 222 | !GetProviders will be enhanced to allow a client to determine if a particular provider is compatible with the current FDO: |
| 223 | |
| 224 | {{{ |
| 225 | FdoProviderCollection* IProviderRegistry::GetProviders( bool compatibleOnly = false) |
| 226 | }}} |
| 227 | |
| 228 | compatibleOnly is a new parameter. When false, all registered providers are returned. When true, only providers compatible with the current FDO are returned. |
| 229 | |
| 230 | For Example, the following code checks to see if a particular provider is compatible with the currently running FDO: |
| 231 | |
| 232 | {{{ |
| 233 | FdoPtr<IProviderRegistry> registry = FeatureAccessManager::GetProviderRegistry(); |
| 234 | FdoString* providerName = L"OSGeo.SDF.3.1"; |
| 235 | FdoPtr<FdoProviderCollection> providers = registry->GetProviders(true); |
| 236 | bool isCompatible = (providers->IndexOf(providerName) >= 0); |
| 237 | }}} |
| 238 | |
| 239 | ===== FdoProvider::!GetIsCompatible (new) ===== |
| 240 | |
| 241 | IProviderRegistry::!GetProviders implementations can use this function to test whether a particular provider is compatible. The signature is: |
| 242 | |
| 243 | {{{ |
| 244 | bool FdoProvider::!GetIsCompatible() |
| 245 | }}} |
| 246 | |
| 247 | It returns true if this provider is compatible with the currently running FDO, and false otherwise. |
| 248 | |
| 249 | For Example, !GetIsCompatible is used to test the provider's compatibility: |
| 250 | |
| 251 | {{{ |
| 252 | FdoPtr<IProviderRegistry> registry = FeatureAccessManager::GetProviderRegistry(); |
| 253 | FdoString* providerName = L"OSGeo.SDF.3.1"; |
| 254 | FdoPtr<FdoProviderCollection> providers = registry->GetProviders(false); |
| 255 | FdoInt32 ix = providers->IndexOf(providerName); |
| 256 | FdoPtr<FdoProvider> provider = providers->GetItem( ix ); |
| 257 | bool isCompatible = provider->GetIsCompatible(); |
| 258 | }}} |
| 259 | |
| 260 | ===== FdoPhysicalSchemaMappingCollection::!ReadXml (modified) ===== |
| 261 | |
| 262 | When this function encounters a Schema Override Set, it searches the provider registry for the earliest provider whose version is equal or greater than the Schema Override Set's version. It then invokes that provider to read the Schema Override Set. |
| 263 | |
| 264 | With this proposal, the latest provider that is binary-compatible with the current FDO will be chosen. |
| 265 | |
| 266 | It is possible that the chosen provider will be too old to read the given Schema Override Set. When the provider reads the Schema Override set, it may encounter a construct that it doesn't understand. If this happens, the action taken depends on the current !ErrorLevel passed to ReadXml, via the flags parameter: |
| 267 | |
| 268 | High – an error is reported[[br]] |
| 269 | Other – the construct is ignored[[br]] |
| 270 | |