Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 dbb5a1c
Show file tree
Hide file tree
Showing 36 changed files with 10,396 additions and 1 deletion.
31 changes: 31 additions & 0 deletions resources/context_help/SaNewConnection-en_US
@@ -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>
37 changes: 37 additions & 0 deletions resources/context_help/SaSourceSelect-en_US
@@ -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>.
1 change: 1 addition & 0 deletions src/plugins/CMakeLists.txt
Expand Up @@ -13,6 +13,7 @@ SUBDIRS (copyright_label
evis
point_displacement_renderer
spatialquery
sqlanywhere
)

IF (WITH_SPATIALITE)
Expand Down
77 changes: 77 additions & 0 deletions src/plugins/sqlanywhere/CMakeLists.txt
@@ -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.