Used the IndexConstants class

This commit is contained in:
Francesco Mangiacrapa 2023-03-29 16:21:57 +02:00
parent 7a7c79ef17
commit b37bd06440
1 changed files with 11 additions and 11 deletions

View File

@ -12,6 +12,7 @@ import org.gcube.application.cms.plugins.faults.IndexingException;
import org.gcube.application.cms.plugins.faults.InitializationException;
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
import org.gcube.application.cms.plugins.implementations.IndexConstants;
import org.gcube.application.cms.plugins.reports.IndexDocumentReport;
import org.gcube.application.cms.plugins.reports.InitializationReport;
import org.gcube.application.cms.plugins.reports.Report;
@ -79,11 +80,8 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
}
/**
* Expected parameters :
* - indexName (unique)
* - workspace
* - flagInternalIndex as Boolean;
* boolean - centroidRecord (OPT).
* Expected parameters : - indexName (unique) - workspace - flagInternalIndex as
* Boolean; boolean - centroidRecord (OPT).
*
* @param request the request
* @return the index document report
@ -122,15 +120,16 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
centroidDoc.put(DBConstants.Defaults.PROJECT_ID, project.getId());
centroidDoc.put(DBConstants.Defaults.DISPLAYED, true);
//Added by Francesco. Creating Gis Viewer Link as public or private
// Added by Francesco. Creating Gis Viewer Link as public or private
Boolean isInternalIndex = null;
try {
isInternalIndex = requestArguments.getBoolean("flagInternalIndex");
log.debug("flagInternalIndex read as {} ", isInternalIndex);
isInternalIndex = requestArguments
.getBoolean(IndexConstants.INDEX_PARAMETER_FLAGINTERNALINDEX);
log.debug(IndexConstants.INDEX_PARAMETER_FLAGINTERNALINDEX + " read as {} ", isInternalIndex);
} catch (Exception e) {
// TODO: handle exception
}
log.info("flagInternalIndex is {} ", isInternalIndex);
log.info(IndexConstants.INDEX_PARAMETER_FLAGINTERNALINDEX + " is {} ", isInternalIndex);
if (isInternalIndex != null) {
try {
@ -332,8 +331,9 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
List<MappingObject> mappingObjects = getMappings(ucd);
List<PostgisTable.Field> fields = PostgisTable.Field.fromMappings(mappingObjects);
indexer.initIndex(params.getString("indexName"), fields, params.getString("workspace"),
params.getString("indexName"));
indexer.initIndex(params.getString(IndexConstants.INDEX_PARAMETER_INDEXNAME), fields,
params.getString(IndexConstants.INDEX_PARAMETER_WORKSPACE),
params.getString(IndexConstants.INDEX_PARAMETER_INDEXNAME));
return indexer;
}