diff options
author | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-06-16 10:47:15 +0200 |
---|---|---|
committer | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-06-16 10:47:15 +0200 |
commit | 97b1c77c7a35596b2f877b9ba8683f606f89b578 (patch) | |
tree | 5d8825702c8971b7bb67c4a30d9cbe2c25108ac0 | |
parent | 50d6d53c9ceb84c781f8619ad0cafcede2869371 (diff) |
providing search packages functionalities
- provide search package by (UpdatedBy or Tags or ArtifactName or ArtifactVersion or ArtifactType) Containing IgnoreCase
Issue-ID: CCSDK-2434
Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com>
Change-Id: I92167e916643dbbf17601a0d9fb7654d8940a537
3 files changed, 4 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelSearchRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelSearchRepository.kt index 4451283cb..5986603ca 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelSearchRepository.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/repository/BlueprintModelSearchRepository.kt @@ -97,7 +97,7 @@ interface BlueprintModelSearchRepository : JpaRepository<BlueprintModelSearch, L * @param pageRequest * @return Page<BlueprintModelSearch> */ - fun findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType( + fun findByUpdatedByContainingIgnoreCaseOrTagsContainingIgnoreCaseOrArtifactNameContainingIgnoreCaseOrArtifactVersionContainingIgnoreCaseOrArtifactTypeContainingIgnoreCase( updatedBy: String, tags: String, artifactName: String, diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt index 1d34b7b6f..f846ab157 100755 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt @@ -149,7 +149,7 @@ class BlueprintProcessorCatalogServiceImpl( blueprintModel.artifactVersion = artifactVersion blueprintModel.updatedBy = metadata[BluePrintConstants.METADATA_TEMPLATE_AUTHOR]!! blueprintModel.tags = metadata[BluePrintConstants.METADATA_TEMPLATE_TAGS]!! - val description = if (null == metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION]) metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION] else "" + val description = if (null != metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION]) metadata[BluePrintConstants.METADATA_TEMPLATE_DESCRIPTION] else "" blueprintModel.artifactDescription = "Controller Blueprint for $artifactName:$artifactVersion $description" val blueprintModelContent = BlueprintModelContent() diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt index 48ca912da..b5d20f4c8 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt @@ -377,7 +377,7 @@ open class BluePrintModelHandler( * @return List<BlueprintModelSearch> list of the controller blueprint </BlueprintModelSearch> */ open fun searchBluePrintModelsByKeyWordPaged(keyWord: String, pageRequest: PageRequest): Page<BlueprintModelSearch> { - return blueprintModelSearchRepository.findByUpdatedByOrTagsOrOrArtifactNameOrOrArtifactVersionOrArtifactType( + return blueprintModelSearchRepository.findByUpdatedByContainingIgnoreCaseOrTagsContainingIgnoreCaseOrArtifactNameContainingIgnoreCaseOrArtifactVersionContainingIgnoreCaseOrArtifactTypeContainingIgnoreCase( keyWord, keyWord, keyWord, @@ -397,7 +397,7 @@ open class BluePrintModelHandler( @Throws(BluePrintException::class) open fun deleteBlueprintModel(id: String) { val dbBlueprintModel = blueprintModelRepository.findById(id) - if (dbBlueprintModel != null && dbBlueprintModel.isPresent) { + if (dbBlueprintModel.isPresent) { blueprintModelContentRepository.deleteByBlueprintModel(dbBlueprintModel.get()) blueprintModelRepository.delete(dbBlueprintModel.get()) } else { |