Fixed checked query parameters

This commit is contained in:
Luca Frosini 2023-05-15 16:47:30 +02:00
parent fe6e990605
commit b32f282044
1 changed files with 9 additions and 4 deletions

View File

@ -18,6 +18,7 @@ import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException;
import org.gcube.informationsystem.resourceregistry.api.rest.ContextPath;
import org.gcube.informationsystem.resourceregistry.api.rest.QueryTemplatePath;
import org.gcube.informationsystem.resourceregistry.queries.templates.QueryTemplateManagement;
import org.gcube.informationsystem.resourceregistry.requests.ServerRequestInfo;
@ -45,7 +46,8 @@ public class QueryTemplateManager extends BaseRest {
CalledMethodProvider.instance.set("listQueryTemplates");
ServerRequestInfo serverRequestInfo = initRequestInfo();
serverRequestInfo.checkIncludeAllMetaQueryParameters();
serverRequestInfo.setAllMeta(true);
serverRequestInfo.checkQueryParameter(ContextPath.INCLUDE_META_QUERY_PARAMETER);
QueryTemplateManagement queryTemplateManagement = new QueryTemplateManagement();
return queryTemplateManagement.all(false);
@ -91,7 +93,8 @@ public class QueryTemplateManager extends BaseRest {
CalledMethodProvider.instance.set("createQueryTemplate");
ServerRequestInfo serverRequestInfo = initRequestInfo();
serverRequestInfo.checkIncludeAllMetaQueryParameters();
serverRequestInfo.setAllMeta(true);
serverRequestInfo.checkQueryParameter(ContextPath.INCLUDE_META_QUERY_PARAMETER);
QueryTemplateManagement queryTemplateManagement = new QueryTemplateManagement();
queryTemplateManagement.setName(queryTemplateName);
@ -114,7 +117,8 @@ public class QueryTemplateManager extends BaseRest {
CalledMethodProvider.instance.set("readQueryTemplate");
ServerRequestInfo serverRequestInfo = initRequestInfo();
serverRequestInfo.checkIncludeAllMetaQueryParameters();
serverRequestInfo.setAllMeta(true);
serverRequestInfo.checkQueryParameter(ContextPath.INCLUDE_META_QUERY_PARAMETER);
QueryTemplateManagement queryTemplateManagement = new QueryTemplateManagement();
queryTemplateManagement.setName(queryTemplateName);
@ -138,7 +142,8 @@ public class QueryTemplateManager extends BaseRest {
CalledMethodProvider.instance.set("readQueryTemplate");
ServerRequestInfo serverRequestInfo = initRequestInfo();
serverRequestInfo.checkIncludeAllMetaQueryParameters();
serverRequestInfo.setAllMeta(true);
serverRequestInfo.checkQueryParameter(ContextPath.INCLUDE_META_QUERY_PARAMETER);
QueryTemplateManagement queryTemplateManagement = new QueryTemplateManagement();
queryTemplateManagement.setName(queryTemplateName);