32 | | This is a more detailed description of the actual changes desired. The contents of this section will vary based on the target of the RFC, be it a technical change, website change, or process change. For example, for a technical change, items such as files, XML schema changes, and API chances would be identified. For a process change, the new process would be laid out in detail. For a website change, the files affected would be listed. |
| 33 | In order not to impact the standard FDO command interface, we plan just adding those commands interface for WMS only. Thus, we also declare a new enum type: WmsCommandType for WMS provider. |
| 34 | The following shows the new enumeration. |
| 35 | // This number is defined so our custom command would not clash with other |
| 36 | // custom provider commands. |
| 37 | #define WMS_FIRST_PROVIDER_COMMAND 1800 |
| 38 | |
| 39 | /// \brief |
| 40 | /// The WmsCommandType enumeration defines the list of WMS+ commands. |
| 41 | enum WmsCommandType{ |
| 42 | |
| 43 | /// Represents the GetImageFormats command. |
| 44 | WmsCommandType_GetImageFormats = FdoCommandType_FirstProviderCommand + WMS_FIRST_PROVIDER_COMMAND, |
| 45 | WmsCommandType_GetLayerStyles, |
| 46 | WmsCommandType_GetLayerCRSNames |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | 3 new commands will be added to the FDO WMS Providers, individually for getting image formats, style and CS. The usage and the new classes and interfaces are listed as follows. |
| 51 | |
| 52 | The following is an example of how WMS GetImageFormats command would be used to get the entire supported image formats list form WMS server after connection. |
| 53 | FdoPtr<FdoIGetImageFormats > cmd = static_cast<FdoIGetImageFormats *> (conn->CreateCommand (WmsCommandType_GetImageFormats)); |
| 54 | FdoPtr<FdoStringCollection> result = cmd->Execute (); |
| 55 | |
| 56 | class FdoIGetImageFormats: public FdoICommand |
| 57 | { |
| 58 | friend class FdoIConnection; |
| 59 | |
| 60 | public: |
| 61 | /// \brief |
| 62 | /// Executes the GetImageFormats command and returns a |
| 63 | /// FdoStringCollection, which contains all image formats supported by WMS server. |
| 64 | /// |
| 65 | /// \return |
| 66 | /// Returns the image format collection supported by WMS server |
| 67 | /// |
| 68 | FDO_API virtual FdoStringCollection * Execute() = 0; |
| 69 | }; |
| 70 | |
| 71 | class FdoWmsGetImageFormatsCommand : public FdoWmsCommand<FdoIGetImageFormats> |
| 72 | { |
| 73 | friend class FdoWmsConnection; |
| 74 | |
| 75 | protected: |
| 76 | // |
| 77 | // Prevent the use of the copy constructor by definning it and not implemeting it. |
| 78 | // DO NOT IMPLEMENT |
| 79 | FdoWmsGetImageFormatsCommand (const FdoWmsGetImageFormatsCommand &right); |
| 80 | |
| 81 | /// <summary>Constructs an instance of a command for the given connection. </summary> |
| 82 | /// <returns>Returns nothing</returns> |
| 83 | FdoWmsGetImageFormatsCommand (FdoIConnection* connection); |
| 84 | |
| 85 | /// <summary>Virtual Destructor.</summary> |
| 86 | /// <returns>Returns nothing</returns> |
| 87 | virtual ~ FdoWmsGetImageFormatsCommand (void); |
| 88 | |
| 89 | /// <summary>Dispose this object.</summary> |
| 90 | /// <returns>Returns nothing</returns> |
| 91 | virtual void Dispose (); |
| 92 | |
| 93 | public: |
| 94 | // |
| 95 | // Prevent the use of the Assignment Operation by definning it and not implemeting it. |
| 96 | // DO NOT IMPLEMENT |
| 97 | FdoWmsGetImageFormatsCommand & operator= (const FdoWmsGetImageFormatsCommand &right); |
| 98 | |
| 99 | /// <summary> |
| 100 | /// Executes the GetFormats command and returns a |
| 101 | /// FdoStringCollection, which contains all image formats supported by WMS server. |
| 102 | /// <returns> |
| 103 | /// Returns the image format collection supported by WMS server. |
| 104 | /// </returns> |
| 105 | virtual FdoStringCollection* Execute (); |
| 106 | |
| 107 | }; |
| 108 | |
| 109 | |
| 110 | The following is an example of how WMS GetLayerStyles command would be used to get the entire supported image formats list form WMS server after connection. |
| 111 | FdoPtr< FDOIGetLayerStyles > cmd = static_cast< FDOIGetLayerStyles *> (conn->CreateCommand (WmsCommandType_GetLayerStyles)); |
| 112 | cmd->SetLayerName(L”ABC”); |
| 113 | FdoPtr<FdoStringCollection> result = cmd->Execute (); |
| 114 | |
| 115 | class FdoIGetLayerStyles : public FdoICommand |
| 116 | { |
| 117 | friend class FdoIConnection; |
| 118 | |
| 119 | public: |
| 120 | /// \brief |
| 121 | /// Gets the name of the layer to get all supported styles. |
| 122 | /// |
| 123 | /// \return |
| 124 | /// Returns the layer name |
| 125 | /// |
| 126 | FDO_API virtual FdoString* GetLayerName() = 0; |
| 127 | |
| 128 | /// \brief |
| 129 | /// Sets the name of the layer to get all supported styles. |
| 130 | /// This function is mandatory; if not specified, |
| 131 | /// execution of the command will throw exception. |
| 132 | /// |
| 133 | /// \param value |
| 134 | /// Input the layer name |
| 135 | /// |
| 136 | /// \return |
| 137 | /// Returns nothing |
| 138 | /// |
| 139 | FDO_API virtual void SetLayerName(FdoString* value) = 0; |
| 140 | |
| 141 | /// \brief |
| 142 | /// Executes the GetLayerStyles command and returns a |
| 143 | /// FdoStringCollection, which contains all styles supported by specific layer. |
| 144 | /// |
| 145 | /// \return |
| 146 | /// Returns the styles collection supported by server |
| 147 | /// |
| 148 | FDO_API virtual FdoStringCollection * Execute() = 0; |
| 149 | }; |
| 150 | |
| 151 | class FdoWmsGetLayerStylesCommand : public FdoWmsCommand< FDOIGetLayerStyles > |
| 152 | { |
| 153 | friend class FdoWmsConnection; |
| 154 | |
| 155 | protected: |
| 156 | // |
| 157 | // Prevent the use of the copy constructor by definning it and not implemeting it. |
| 158 | // DO NOT IMPLEMENT |
| 159 | FdoWmsGetLayerStylesCommand (const FdoWmsGetLayerStylesCommand &right); |
| 160 | |
| 161 | // <summary>Constructs an instance of a command for the given connection. </summary> |
| 162 | // <returns>Returns nothing</returns> |
| 163 | FdoWmsGetLayerStylesCommand (FdoIConnection* connection); |
| 164 | |
| 165 | // <summary>Virtual Destructor.</summary> |
| 166 | // <returns>Returns nothing</returns> |
| 167 | virtual ~ FdoWmsGetLayerStylesCommand (void); |
| 168 | |
| 169 | // <summary>Dispose this object.</summary> |
| 170 | // <returns>Returns nothing</returns> |
| 171 | virtual void Dispose (); |
| 172 | |
| 173 | public: |
| 174 | // |
| 175 | // Prevent the use of the Assignment Operation by definning it and not implemeting it. |
| 176 | // DO NOT IMPLEMENT |
| 177 | FdoWmsGetLayerStylesCommand & operator= (const FdoWmsGetLayerStylesCommand &right); |
| 178 | |
| 179 | /// <summary> Gets the name of the layer to get all supported styles. </summary> |
| 180 | /// <returns>Returns the layer name</returns> |
| 181 | virtual FdoString* GetLayerName (); |
| 182 | |
| 183 | /// <summary> Sets the name of the layer to get all supported styles |
| 184 | /// This function is mandatory; if not specified, |
| 185 | /// execution of the command will throw exception. |
| 186 | /// </summary> |
| 187 | /// <param name="value">Input the layer name</param> |
| 188 | /// <returns>Returns nothing</returns> |
| 189 | virtual void SetLayerName (FdoString* value); |
| 190 | |
| 191 | /// <summary> |
| 192 | /// Executes the GetLayerStyles command and returns a |
| 193 | /// FdoStringCollection, which contains entire styles supported by layer. |
| 194 | /// <returns> Returns the style collection supported by layer. |
| 195 | ///</returns> |
| 196 | virtual FdoStringCollection* Execute (); |
| 197 | |
| 198 | private: |
| 199 | FdoStringP mLayerName; |
| 200 | }; |
| 201 | |
| 202 | |
| 203 | The following is an example of how WMS GetLayerCRSNames command would be used to get the entire supported image formats list form WMS server after connection. |
| 204 | FdoPtr<FdoIGetLayerCRSNames> cmd = static_cast<FdoIGetLayerCRSNames*> (conn->CreateCommand (FdoCommandType_GetLayerSupportedCRSNames)); |
| 205 | cmd->SetLayerName(L“ABC”); |
| 206 | FdoPtr<FdoStringCollection> result = cmd->Execute (); |
| 207 | |
| 208 | class FdoIGetLayerCRSNames: public FdoICommand |
| 209 | { |
| 210 | friend class FdoIConnection; |
| 211 | |
| 212 | public: |
| 213 | /// \brief |
| 214 | /// Gets the name of the layer to get all supported styles. |
| 215 | /// |
| 216 | /// \return |
| 217 | /// Returns the layer name |
| 218 | /// |
| 219 | FDO_API virtual FdoString* GetLayerName() = 0; |
| 220 | |
| 221 | /// \brief |
| 222 | /// Sets the name of the layer to get all supported styles. |
| 223 | /// This function is mandatory; if not specified, |
| 224 | /// execution of the command will throw exception. |
| 225 | /// |
| 226 | /// \param value |
| 227 | /// Input the layer name |
| 228 | /// |
| 229 | /// \return |
| 230 | /// Returns nothing |
| 231 | /// |
| 232 | FDO_API virtual void SetLayerName(FdoString* value) = 0; |
| 233 | |
| 234 | /// \brief |
| 235 | /// Executes the GetCRSNames command and returns a |
| 236 | /// FdoStringCollection, which contains entire CRS names supported by server. |
| 237 | /// |
| 238 | /// \return |
| 239 | /// Returns the CRS name collection supported by server |
| 240 | /// |
| 241 | FDO_API virtual FdoStringCollection * Execute() = 0; |
| 242 | }; |
| 243 | |
| 244 | class FdoWmsGetLayerCRSNamesCommand: public FdoWmsCommand< FdoIGetLayerCRSNames > |
| 245 | { |
| 246 | friend class FdoWmsConnection; |
| 247 | |
| 248 | protected: |
| 249 | // |
| 250 | // Prevent the use of the copy constructor by definning it and not implemeting it. |
| 251 | // DO NOT IMPLEMENT |
| 252 | FdoWmsGetLayerCRSNamesCommand (const FdoWmsGetLayerCRSNamesCommand &right); |
| 253 | |
| 254 | // <summary>Constructs an instance of a command for the given connection. </summary> |
| 255 | // <returns>Returns nothing</returns> |
| 256 | FdoWmsGetLayerCRSNamesCommand (FdoIConnection* connection); |
| 257 | |
| 258 | // <summary>Virtual Destructor.</summary> |
| 259 | // <returns>Returns nothing</returns> |
| 260 | virtual ~ FdoWmsGetLayerCRSNamesCommand (void); |
| 261 | |
| 262 | // <summary>Dispose this object.</summary> |
| 263 | // <returns>Returns nothing</returns> |
| 264 | virtual void Dispose (); |
| 265 | |
| 266 | public: |
| 267 | // |
| 268 | // Prevent the use of the Assignment Operation by defining it and not implementing it. |
| 269 | // DO NOT IMPLEMENT |
| 270 | FdoWmsGetLayerCRSNamesCommand & operator= (const FdoWmsGetLayerCRSNamesCommand &right); |
| 271 | |
| 272 | /// <summary> Gets the name of the layer to get all supported CRS names. </summary> |
| 273 | /// <returns>Returns the layer name</returns> |
| 274 | virtual FdoString* GetLayerName (); |
| 275 | |
| 276 | /// <summary> Sets the name of the layer to get all supported CRS names. |
| 277 | /// This function is mandatory; if not specified, |
| 278 | /// execution of the command will throw exception. |
| 279 | /// </summary> |
| 280 | /// <param name="value">Input the layer name</param> |
| 281 | /// <returns>Returns nothing</returns> |
| 282 | virtual void SetLayerName (FdoString* value); |
| 283 | |
| 284 | /// <summary> |
| 285 | /// Executes the GetLayerCRSNames command and returns a |
| 286 | /// FdoStringCollection, which contains entire CRS names supported by layer. |
| 287 | /// <returns> Returns the CRS names collection supported by layer. |
| 288 | ///</returns> |
| 289 | virtual FdoStringCollection* Execute (); |
| 290 | |
| 291 | private: |
| 292 | FdoStringP mLayerName; |
| 293 | }; |