Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify
  • Loading branch information
pathmapper committed Apr 25, 2023
1 parent 29b5c6e commit 9935a3f
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 76 deletions.
4 changes: 0 additions & 4 deletions resources/server/api/ogc/templates/wfs3/getFeatures.html
Expand Up @@ -29,7 +29,6 @@
 
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">
{% endif %}
{% for link in links_filter( links, "rel", "prev" ) %}
<li class="page-item"><a class="page-link" href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}
Expand All @@ -41,7 +40,6 @@
{% for link in links_filter( links, "rel", "next" ) %}
<li class="page-item"><a class="page-link" href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}
{% if metadata.pagination != [] %}
</ul>
</nav>
{% endif %}
Expand Down Expand Up @@ -86,7 +84,6 @@ <h2><a href="{{ path_append( feature.id ) }}">{{ metadata.layerTitle }} {{ featu
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">
{% endif %}
{% for link in links_filter( links, "rel", "prev" ) %}
<li class="page-item"><a class="page-link" href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}
Expand All @@ -98,7 +95,6 @@ <h2><a href="{{ path_append( feature.id ) }}">{{ metadata.layerTitle }} {{ featu
{% for link in links_filter( links, "rel", "next" ) %}
<li class="page-item"><a class="page-link" href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}
{% if metadata.pagination != [] %}
</ul>
</nav>
{% endif %}
Expand Down
53 changes: 25 additions & 28 deletions src/server/services/wfs3/qgswfs3handlers.cpp
Expand Up @@ -1395,34 +1395,31 @@ void QgsWfs3CollectionsItemsHandler::handleRequest( const QgsServerApiContext &c
{
const std::string pageSizeOneLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=1" ).toStdString() };
pagesize.push_back( {{ "title", "1" }, { "href", pageSizeOneLink }} ) ;
}
if ( matchedFeaturesCount > 10 && maxLimit > 10 )
{
const std::string pageSizeTenLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=10" ).toStdString() };
pagesize.push_back( {{ "title", "10" }, { "href", pageSizeTenLink }} ) ;
}
if ( matchedFeaturesCount > 20 && maxLimit > 20 )
{
const std::string pageSizeTwentyLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=20" ).toStdString() };
pagesize.push_back( {{ "title", "20" }, { "href", pageSizeTwentyLink }} ) ;
}
if ( matchedFeaturesCount > 50 && maxLimit > 50 )
{
const std::string pageSizeFiftyLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=50" ).toStdString() };
pagesize.push_back( {{ "title", "50" }, { "href", pageSizeFiftyLink }} ) ;
}
if ( matchedFeaturesCount > 100 && maxLimit > 100 )
{
const std::string pageSizeHundredLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=100" ).toStdString() };
pagesize.push_back( {{ "title", "100" }, { "href", pageSizeHundredLink }} ) ;
}
if ( matchedFeaturesCount > 1000 && maxLimit > 1000 )
{
const std::string pageSizeThousandLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=1000" ).toStdString() };
pagesize.push_back( {{ "title", "1000" }, { "href", pageSizeThousandLink }} ) ;
}
if ( matchedFeaturesCount > 1 && maxLimit > 1 )
{
if ( matchedFeaturesCount > 10 && maxLimit > 10 )
{
const std::string pageSizeTenLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=10" ).toStdString() };
pagesize.push_back( {{ "title", "10" }, { "href", pageSizeTenLink }} ) ;
}
if ( matchedFeaturesCount > 20 && maxLimit > 20 )
{
const std::string pageSizeTwentyLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=20" ).toStdString() };
pagesize.push_back( {{ "title", "20" }, { "href", pageSizeTwentyLink }} ) ;
}
if ( matchedFeaturesCount > 50 && maxLimit > 50 )
{
const std::string pageSizeFiftyLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=50" ).toStdString() };
pagesize.push_back( {{ "title", "50" }, { "href", pageSizeFiftyLink }} ) ;
}
if ( matchedFeaturesCount > 100 && maxLimit > 100 )
{
const std::string pageSizeHundredLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=100" ).toStdString() };
pagesize.push_back( {{ "title", "100" }, { "href", pageSizeHundredLink }} ) ;
}
if ( matchedFeaturesCount > 1000 && maxLimit > 1000 )
{
const std::string pageSizeThousandLink { cleanedUrlAsString.toStdString() + QStringLiteral( "offset=0&limit=1000" ).toStdString() };
pagesize.push_back( {{ "title", "1000" }, { "href", pageSizeThousandLink }} ) ;
}
std::string maxTitle = "All";
if ( maxLimit < matchedFeaturesCount )
{
Expand Down
Expand Up @@ -101,7 +101,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">



<li class="page-item active"><a class="page-link"
Expand All @@ -122,7 +121,6 @@

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=6&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down Expand Up @@ -621,7 +619,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/6
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">



<li class="page-item active"><a class="page-link"
Expand All @@ -642,7 +639,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/6

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=6&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down
Expand Up @@ -103,7 +103,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=0&limit=6">Previous page</a></li>

Expand All @@ -130,7 +129,6 @@

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=12&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down Expand Up @@ -629,7 +627,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/1
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=0&limit=6">Previous page</a></li>

Expand All @@ -656,7 +653,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/1

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=12&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down
Expand Up @@ -103,7 +103,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=6&limit=6">Previous page</a></li>

Expand Down Expand Up @@ -134,7 +133,6 @@

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=18&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down Expand Up @@ -633,7 +631,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/1
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=6&limit=6">Previous page</a></li>

Expand Down Expand Up @@ -664,7 +661,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/1

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=18&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down
Expand Up @@ -103,7 +103,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=12&limit=6">Previous page</a></li>

Expand Down Expand Up @@ -137,7 +136,6 @@

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=24&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down Expand Up @@ -636,7 +634,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/2
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=12&limit=6">Previous page</a></li>

Expand Down Expand Up @@ -670,7 +667,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/2

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=24&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down
Expand Up @@ -103,7 +103,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=18&limit=6">Previous page</a></li>

Expand Down Expand Up @@ -134,7 +133,6 @@

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=30&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down Expand Up @@ -633,7 +631,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/3
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=18&limit=6">Previous page</a></li>

Expand Down Expand Up @@ -664,7 +661,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/3

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=30&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down
Expand Up @@ -103,7 +103,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=24&limit=6">Previous page</a></li>

Expand All @@ -130,7 +129,6 @@

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=36&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down Expand Up @@ -629,7 +627,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/3
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=24&limit=6">Previous page</a></li>

Expand All @@ -656,7 +653,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/3

<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=36&limit=6">Next page</a></li>


</ul>
</nav>

Expand Down
Expand Up @@ -101,7 +101,6 @@
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=30&limit=6">Previous page</a></li>

Expand All @@ -122,7 +121,6 @@
</li>



</ul>
</nav>

Expand Down Expand Up @@ -337,7 +335,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/3
&nbsp;
<nav aria-label="Page navigation">
<ul class="pagination" style="margin:0px">


<li class="page-item"><a class="page-link" href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items.html?offset=30&limit=6">Previous page</a></li>

Expand All @@ -358,7 +355,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/as-areas-short-name/items/3
</li>



</ul>
</nav>

Expand Down
Expand Up @@ -86,10 +86,6 @@
</div>






</div>
<br>
<div class="row">
Expand Down Expand Up @@ -192,10 +188,6 @@ <h2><a href="http://server.qgis.org/wfs3/collections/testlayer èé/items/2.html
</div>






</div>
<br>

Expand Down
Expand Up @@ -86,10 +86,6 @@
</div>






</div>
<br>
<div class="row">
Expand Down Expand Up @@ -150,10 +146,6 @@ <h1>Features in layer A test vector layer èé</h1>
</div>






</div>
<br>

Expand Down

0 comments on commit 9935a3f

Please sign in to comment.