Skip to content
Permalink
Browse files

[FEATURE] Load and Save SLD & QML styles to DB

Work done for ARPA Piemonte - Dipartimento Tematico Geologia e Dissesto
  • Loading branch information
Emilio Loi
Emilio Loi committed Apr 26, 2013
1 parent 49f1b53 commit 280922a3837df2980be8e01e6db7362b18a02d56
Showing with 6 additions and 7 deletions.
  1. +2 −2 doc/INSTALL.html
  2. +2 −2 doc/news.html
  3. +2 −3 src/providers/postgres/qgspostgresprovider.cpp
@@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Quantum GIS (QGIS)</TITLE>

<!-- Included /home/el1073/Faunalia/Quantum-GIS-master/doc/style.css -->
<!-- Included /home/el1073/Faunalia/Quantum-GIS/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
@@ -3188,5 +3188,5 @@ <H1>9. Authors and Acknowledgments</H1>

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS-master/doc/INSTALL.html -t html /home/el1073/Faunalia/Quantum-GIS-master/doc/INSTALL.t2t -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS/doc/INSTALL.html -t html /home/el1073/Faunalia/Quantum-GIS/doc/INSTALL.t2t -->
</BODY></HTML>
@@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Quantum GIS (QGIS) News</TITLE>

<!-- Included /home/el1073/Faunalia/Quantum-GIS-master/doc/style.css -->
<!-- Included /home/el1073/Faunalia/Quantum-GIS/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
@@ -2613,5 +2613,5 @@ <H1>18. 0.5</H1>
</DIV>

<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS-master/doc/news.html -t html /home/el1073/Faunalia/Quantum-GIS-master/doc/news.t2t -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS/doc/news.html -t html /home/el1073/Faunalia/Quantum-GIS/doc/news.t2t -->
</BODY></HTML>
@@ -3307,15 +3307,14 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
result = conn->PQexec( checkQuery );
if( PQntuples( result ) > 0 )
{
sql = QObject::tr( "UPDATE %1 SET useAsDefault=%2, styleQML=XMLPARSE(DOCUMENT %3), styleSLD=XMLPARSE(DOCUMENT %4), description=%5, owner=%6, ui=XMLPARSE(DOCUMENT %7) WHERE f_table_catalog=%8 AND f_table_schema=%9 AND f_table_name=%10 AND f_geometry_column=%11 AND styleName=%12")
sql = QObject::tr( "UPDATE %1 SET useAsDefault=%2, styleQML=XMLPARSE(DOCUMENT %3), styleSLD=XMLPARSE(DOCUMENT %4), description=%5, owner=%6 WHERE f_table_catalog=%7 AND f_table_schema=%8 AND f_table_name=%9 AND f_geometry_column=%10 AND styleName=%11;")
.arg( styleTableName )
.arg( isdef )
.arg( QgsPostgresConn::quotedValue( qmlStyle
) )
.arg( QgsPostgresConn::quotedValue( sldStyle ) )
.arg( QgsPostgresConn::quotedValue( desc ) )
.arg( QgsPostgresConn::quotedValue( owner ) )
.arg( QgsPostgresConn::quotedValue( uiFileContent ) )
.arg( QgsPostgresConn::quotedValue( f_table_catalog ) )
.arg( QgsPostgresConn::quotedValue( f_table_schema ) )
.arg( QgsPostgresConn::quotedValue( f_table_name ) )
@@ -3401,7 +3400,7 @@ QGISEXTERN int listStyles( const QString& uri, QVector<QString> &ids, QVector<Q
f_geometry_column = dsUri.geometryColumn();

// ORDER BY (CASE WHEN useAsDefault THEN 1 ELSE 2 END), update_time DESC;")
QString selectRelatedQuery = QObject::tr( "SELECT id, styleName, description FROM %1 WHERE f_table_catalog=%2 AND f_table_schema=%3 AND f_table_name=%4 AND f_geometry_column=%5 AND useAsDefault=true;" )
QString selectRelatedQuery = QObject::tr( "SELECT id, styleName, description FROM %1 WHERE f_table_catalog=%2 AND f_table_schema=%3 AND f_table_name=%4 AND f_geometry_column=%5;" )
.arg( styleTableName )
.arg( QgsPostgresConn::quotedValue( f_table_catalog ) )
.arg( QgsPostgresConn::quotedValue( f_table_schema ) )

0 comments on commit 280922a

Please sign in to comment.
You can’t perform that action at this time.