Skip to content
Permalink
Browse files
Contributing a native SQL Anywhere plugin+provider
git-svn-id: http://svn.osgeo.org/qgis/trunk@14918 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ddehaan committed Dec 15, 2010
1 parent 97bf2cc commit dbb5a1cc3b1fea652b114fd70920dfa06b579290
Showing with 10,396 additions and 1 deletion.
  1. +31 −0 resources/context_help/SaNewConnection-en_US
  2. +37 −0 resources/context_help/SaSourceSelect-en_US
  3. +1 −0 src/plugins/CMakeLists.txt
  4. +77 −0 src/plugins/sqlanywhere/CMakeLists.txt
  5. +674 −0 src/plugins/sqlanywhere/LICENSE
  6. +64 −0 src/plugins/sqlanywhere/sadbfilterproxymodel.cpp
  7. +48 −0 src/plugins/sqlanywhere/sadbfilterproxymodel.h
  8. +328 −0 src/plugins/sqlanywhere/sadbtablemodel.cpp
  9. +76 −0 src/plugins/sqlanywhere/sadbtablemodel.h
  10. +59 −0 src/plugins/sqlanywhere/salayer.h
  11. +164 −0 src/plugins/sqlanywhere/sanewconnection.cpp
  12. +48 −0 src/plugins/sqlanywhere/sanewconnection.h
  13. +344 −0 src/plugins/sqlanywhere/sanewconnectionbase.ui
  14. +332 −0 src/plugins/sqlanywhere/saquerybuilder.cpp
  15. +149 −0 src/plugins/sqlanywhere/saquerybuilder.h
  16. +732 −0 src/plugins/sqlanywhere/sasourceselect.cpp
  17. +227 −0 src/plugins/sqlanywhere/sasourceselect.h
  18. +313 −0 src/plugins/sqlanywhere/sasourceselectbase.ui
  19. +252 −0 src/plugins/sqlanywhere/sqlanywhere.cpp
  20. +75 −0 src/plugins/sqlanywhere/sqlanywhere.h
  21. BIN src/plugins/sqlanywhere/sqlanywhere.png
  22. +5 −0 src/plugins/sqlanywhere/sqlanywhere.qrc
  23. +1 −1 src/providers/CMakeLists.txt
  24. +48 −0 src/providers/sqlanywhere/CMakeLists.txt
  25. +674 −0 src/providers/sqlanywhere/LICENSE
  26. +159 −0 src/providers/sqlanywhere/load_alaska_shapes.sql
  27. +2,122 −0 src/providers/sqlanywhere/qgssqlanywhereprovider.cpp
  28. +423 −0 src/providers/sqlanywhere/qgssqlanywhereprovider.h
  29. +57 −0 src/providers/sqlanywhere/sqlanyconnection/CMakeLists.txt
  30. +909 −0 src/providers/sqlanywhere/sqlanyconnection/sacapi/sacapi.h
  31. +182 −0 src/providers/sqlanywhere/sqlanyconnection/sacapi/sacapidll.c
  32. +332 −0 src/providers/sqlanywhere/sqlanyconnection/sacapi/sacapidll.h
  33. +571 −0 src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.cpp
  34. +145 −0 src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.h
  35. +611 −0 src/providers/sqlanywhere/sqlanyconnection/sqlanystatement.cpp
  36. +126 −0 src/providers/sqlanywhere/sqlanyconnection/sqlanystatement.h
@@ -0,0 +1,31 @@
<h3>Create a New SQL Anywhere Connection</h3>
This dialog allows you to define the settings for a connection to a
SQL Anywhere database.
<p>
<ul>
<li> <label>Name</label> A name to identify the connection settings.

<li> <label>Host</label> Name or IP address of the computer hosting the database server (leave blank for local connections).

<li> <label>Port</label> IP port used by the database server (leave blank for local connections or to use default port 2638).

<li> <label>Server</label> Name of the database server (leave blank for default server on host).

<li> <label>Database</label> Name of the database (leave blank for default database on server).

<li> <label>Connection Parameters</label> Additional parameters to add to the connection string (semi-colon delimitted list). See the SQL Anywhere documentation for a list and description of available connection parameters.

<li> <label>Username</label> Database user name.
<li> <label>Password</label> Database password.

<li> <label>Save Username</label> Indicates whether to save the database user name in the connection configuration.

<li> <label>Save Password</label> Indicates whether to save the database password in the connection settings. <em>Passwords are saved in <strong>clear text</strong> in the system configuration!</em>

<li> <label>Simple Encryption</label> Secure the connection to the database using simple encryption.

<li> <label>Estimate table metadata</label> When initializing layers, various queries may be needed to establish the characteristics of the geometries stored in the database table. When this option is checked, these queries examine only a sample of the rows, rather than the entire table. This can significantly speed up layer initialization, but may result in incorrect characterization of layers containing heterogenous types.

<li> <label>Search other users' tables</label> Indicates that the layer list should be populated from all layers stored in the database. When unchecked (the default), only layers stored in tables owned by the connected user are displayed.

</ul>
@@ -0,0 +1,37 @@
<h3>Add SQL Anywhere Tables</h3>
This dialog allows you to add SQL Anywhere layers (tables with a geometry column) to the QGIS map canvas.
<p>
<a href="#connect">Connections</a><br/>
<a href="#add">Adding Layers</a><br/>
<a href="#filter">Filtering a Layer</a><br/>
<a href="#search">Search options</a><br/>

<a href="#connect">
<h4>Connections</h4>
</a>
<ul>
<li>Choose the connection to use from the drop-down box and click <label>Connect</label>.
<li>If there are no connections, use the <label>New</label> button to create a connection.
<li>To modify or delete the selected connection, click the <label>Edit</label> or <label>Delete</label> buttons, respectively.
</ul>
<a name="add">
<h4>Adding Layers</h4>
</a>
To add a layer:
<ol>
<li>Choose the desired connection from the drop-down box.
<li>Click <label>Connect</label>, which will populate the list of layers from the database. Options that affect how this list is populated are described in the help for the new connection dialogue box.

<li>Find the layer you want to add in the list and click on it to select it.
<li>You can select additional layers by holding down the Ctrl key and clicking.
<li>Click <label>Add</label> to add the layer(s) to the map.
</ol>
<a name="filter">
<h4>Filtering a Layer</h4>
</a>
To filter a layer before adding it to the map, either double click on its name or select it and click the <label>Build query</label> button. This will open the Query Builder, allowing you to build up a SQL statement to use in filtering the records.

<a name="search">
<h4>Search options</h4>
</a>
Ticking <label>Search options</label> enables additional options for searching in different column types and using 2 search modes: <label>Wildcard</label> or <label>RegExp</label>.
@@ -13,6 +13,7 @@ SUBDIRS (copyright_label
evis
point_displacement_renderer
spatialquery
sqlanywhere
)

IF (WITH_SPATIALITE)
@@ -0,0 +1,77 @@
########################################################
# Files

SET (sqlanywhere_SRCS
sqlanywhere.cpp
sasourceselect.cpp
sanewconnection.cpp
sadbtablemodel.cpp
sadbfilterproxymodel.cpp
saquerybuilder.cpp
)

SET (sqlanywhere_UIS
sanewconnectionbase.ui
sasourceselectbase.ui
)

SET (sqlanywhere_MOC_HDRS
sqlanywhere.h
sasourceselect.h
sanewconnection.h
salayer.h
sadbtablemodel.h
sadbfilterproxymodel.h
saquerybuilder.h
)

SET (sqlanywhere_RCCS sqlanywhere.qrc)

IF (WIN32)
IF (MSVC)
ADD_DEFINITIONS("-DSACONN_EXPORT=__declspec(dllexport)")
ELSE (MSVC)
ADD_DEFINITIONS("-USACONN_EXPORT \"-DSACONN_EXPORT=__declspec(dllexport)\"")
ENDIF (MSVC)
ELSE (WIN32)
ADD_DEFINITIONS(-DSACONN_EXPORT=)
ENDIF (WIN32)

########################################################
# Build

QT4_WRAP_UI (sqlanywhere_UIS_H ${sqlanywhere_UIS})

QT4_WRAP_CPP (sqlanywhere_MOC_SRCS ${sqlanywhere_MOC_HDRS})

QT4_ADD_RESOURCES(sqlanywhere_RCC_SRCS ${sqlanywhere_RCCS})

ADD_LIBRARY (sqlanywhereplugin MODULE ${sqlanywhere_SRCS} ${sqlanywhere_MOC_SRCS} ${sqlanywhere_RCC_SRCS} ${sqlanywhere_UIS_H})

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../../ui
../../core
../../core/raster
../../core/renderer
../../core/symbology
../../gui
../../app
..
../../providers/sqlanywhere/sqlanyconnection
)

TARGET_LINK_LIBRARIES(sqlanywhereplugin
qgis_core
qgis_gui
sqlanyconnection
)

########################################################
# Install

INSTALL(TARGETS sqlanywhereplugin
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})

0 comments on commit dbb5a1c

Please sign in to comment.