Skip to content

Commit

Permalink
gh-272 Remove unused clean datatypes/dataclasses endpoints
Browse files Browse the repository at this point in the history
- Delete dataTypes/clean and dataClasses/clean endpoints and controllers from datamodel plugin (resolves gh-272 error due to permissions)
- Delete dataTypes/clean endpoint and controller from referencedata plugin (endpoint gave error due to mapping issue)
  • Loading branch information
joe-crawford committed Mar 16, 2022
1 parent 49c82ee commit 7230fd4
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 78 deletions.
2 changes: 0 additions & 2 deletions mdm-plugin-datamodel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ Controller: dataModel
| GET | /api/dataModels/types | Action: types
| POST | /api/dataModels/import/${importerNamespace}/${importerName}/${importerVersion} | Action: importModels
| POST | /api/dataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | Action: exportModels
| DELETE | /api/dataModels/${dataModelId}/dataClasses/clean | Action: deleteAllUnusedDataClasses
| DELETE | /api/dataModels/${dataModelId}/dataTypes/clean | Action: deleteAllUnusedDataTypes
| GET | /api/folders/${folderId}/dataModels | Action: index
| DELETE | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
| PUT | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,36 +84,6 @@ class DataModelController extends ModelController<DataModel> {
dataModelService
}

@Transactional
def deleteAllUnusedDataClasses() {
if (handleReadOnly()) {
return
}

DataModel dataModel = queryForResource params.dataModelId

if (!dataModel) return notFound(params.dataModelId)

dataModelService.deleteAllUnusedDataClasses(dataModel)

render status: NO_CONTENT // NO CONTENT STATUS CODE
}

@Transactional
def deleteAllUnusedDataTypes() {
if (handleReadOnly()) {
return
}

DataModel dataModel = queryForResource params.dataModelId

if (!dataModel) return notFound(params.dataModelId)

dataModelService.deleteAllUnusedDataTypes(dataModel)

render status: NO_CONTENT // NO CONTENT STATUS CODE
}

def search(SearchParams searchParams) {

if (searchParams.hasErrors()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class UrlMappings {
put "/subset/$otherDataModelId"(controller: 'dataModel', action: 'subset')
get "/intersects/$otherDataModelId"(controller: 'dataModel', action: 'intersects')

delete '/dataTypes/clean'(controller: 'dataModel', action: 'deleteAllUnusedDataTypes')
delete '/dataClasses/clean'(controller: 'dataModel', action: 'deleteAllUnusedDataClasses')

get '/hierarchy'(controller: 'dataModel', action: 'hierarchy')

post '/search'(controller: 'dataModel', action: 'search')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
| GET | /api/dataModels/types | types |
| POST | /api/dataModels/import/${importerNamespace}/${importerName}/${importerVersion} | importModels |
| POST | /api/dataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | exportModels |
| DELETE | /api/dataModels/${dataModelId}/dataClasses/clean | deleteAllUnusedDataClasses |
| DELETE | /api/dataModels/${dataModelId}/dataTypes/clean | deleteAllUnusedDataTypes |
| GET | /api/folders/${folderId}/dataModels | index |
| DELETE | /api/dataModels/${dataModelId}/readByAuthenticated | readByAuthenticated |
| PUT | /api/dataModels/${dataModelId}/readByAuthenticated | readByAuthenticated |
Expand Down
2 changes: 0 additions & 2 deletions mdm-plugin-referencedata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ Controller: dataModel
| GET | /api/dataModels/types | Action: types
| POST | /api/dataModels/import/${importerNamespace}/${importerName}/${importerVersion} | Action: importModels
| POST | /api/dataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | Action: exportModels
| DELETE | /api/dataModels/${dataModelId}/dataClasses/clean | Action: deleteAllUnusedDataClasses
| DELETE | /api/dataModels/${dataModelId}/dataTypes/clean | Action: deleteAllUnusedDataTypes
| GET | /api/folders/${folderId}/dataModels | Action: index
| DELETE | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
| PUT | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,6 @@ class ReferenceDataModelController extends ModelController<ReferenceDataModel> {
resource ? respond(resource, [model: [userSecurityPolicyManager: currentUserSecurityPolicyManager], view: 'hierarchy']) : notFound(params.id)
}

@Transactional
def deleteAllUnusedDataClasses() {
if (handleReadOnly()) {
return
}

ReferenceDataModel referenceDataModel = queryForResource params.referenceDataModelId

if (!referenceDataModel) return notFound(params.referenceDataModelId)

referenceDataModelService.deleteAllUnusedDataClasses(referenceDataModel)

render status: NO_CONTENT // NO CONTENT STATUS CODE
}

@Transactional
def deleteAllUnusedDataTypes() {
if (handleReadOnly()) {
return
}

ReferenceDataModel referenceDataModel = queryForResource params.referenceDataModelId

if (!referenceDataModel) return notFound(params.referenceDataModelId)

referenceDataModelService.deleteAllUnusedDataTypes(referenceDataModel)

render status: NO_CONTENT // NO CONTENT STATUS CODE
}

def search(SearchParams searchParams) {

if (searchParams.hasErrors()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class UrlMappings {
put "/folder/$folderId"(controller: 'referenceDataModel', action: 'changeFolder')
get "/export/$exporterNamespace/$exporterName/$exporterVersion"(controller: 'referenceDataModel', action: 'exportModel')

delete '/referenceDataTypes/clean'(controller: 'referenceDataModel', action: 'deleteAllUnusedReferenceDataTypes')

get '/hierarchy'(controller: 'referenceDataModel', action: 'hierarchy')

post '/search'(controller: 'referenceDataModel', action: 'search')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
| PUT | /api/admin/referenceDataModels/${id}/undoSoftDelete | undoSoftDelete |
| POST | /api/referenceDataModels/import/${importerNamespace}/${importerName}/${importerVersion} | importModels |
| POST | /api/referenceDataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | exportModels |
| DELETE | /api/referenceDataModels/${referenceDataModelId}/referenceDataTypes/clean | deleteAllUnusedReferenceDataTypes |
| GET | /api/folders/${folderId}/referenceDataModels | index |
| DELETE | /api/referenceDataModels/${referenceDataModelId}/readByAuthenticated | readByAuthenticated |
| PUT | /api/referenceDataModels/${referenceDataModelId}/readByAuthenticated | readByAuthenticated |
Expand Down
3 changes: 0 additions & 3 deletions mdm-testing-functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ Controller: dataModel
| GET | /api/dataModels/types | Action: types
| POST | /api/dataModels/import/${importerNamespace}/${importerName}/${importerVersion} | Action: importModels
| POST | /api/dataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | Action: exportModels
| DELETE | /api/dataModels/${dataModelId}/dataClasses/clean | Action: deleteAllUnusedDataClasses
| DELETE | /api/dataModels/${dataModelId}/dataTypes/clean | Action: deleteAllUnusedDataTypes
| GET | /api/folders/${folderId}/dataModels | Action: index
| DELETE | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
| PUT | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
Expand Down Expand Up @@ -418,7 +416,6 @@ Controller: referenceDataModel
| PUT | /api/admin/referenceDataModels/${id}/undoSoftDelete | Action: undoSoftDelete
| POST | /api/referenceDataModels/import/${importerNamespace}/${importerName}/${importerVersion} | Action: importModels
| POST | /api/referenceDataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | Action: exportModels
| DELETE | /api/referenceDataModels/${referenceDataModelId}/referenceDataTypes/clean | Action: deleteAllUnusedReferenceDataTypes
| GET | /api/folders/${folderId}/referenceDataModels | Action: index
| DELETE | /api/referenceDataModels/${referenceDataModelId}/readByAuthenticated | Action: readByAuthenticated
| PUT | /api/referenceDataModels/${referenceDataModelId}/readByAuthenticated | Action: readByAuthenticated
Expand Down
3 changes: 0 additions & 3 deletions mdm-testing-functional/untested_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ Controller: dataModel
| GET | /api/dataModels/types | Action: types
| POST | /api/dataModels/import/${importerNamespace}/${importerName}/${importerVersion} | Action: importModels
| POST | /api/dataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | Action: exportModels
| DELETE | /api/dataModels/${dataModelId}/dataClasses/clean | Action: deleteAllUnusedDataClasses
| DELETE | /api/dataModels/${dataModelId}/dataTypes/clean | Action: deleteAllUnusedDataTypes
| GET | /api/folders/${folderId}/dataModels | Action: index
| DELETE | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
| PUT | /api/dataModels/${dataModelId}/readByAuthenticated | Action: readByAuthenticated
Expand Down Expand Up @@ -410,7 +408,6 @@ Controller: referenceDataModel
| PUT | /api/admin/referenceDataModels/${id}/undoSoftDelete | Action: undoSoftDelete
| POST | /api/referenceDataModels/import/${importerNamespace}/${importerName}/${importerVersion} | Action: importModels
| POST | /api/referenceDataModels/export/${exporterNamespace}/${exporterName}/${exporterVersion} | Action: exportModels
| DELETE | /api/referenceDataModels/${referenceDataModelId}/referenceDataTypes/clean | Action: deleteAllUnusedReferenceDataTypes
| GET | /api/folders/${folderId}/referenceDataModels | Action: index
| DELETE | /api/referenceDataModels/${referenceDataModelId}/readByAuthenticated | Action: readByAuthenticated
| PUT | /api/referenceDataModels/${referenceDataModelId}/readByAuthenticated | Action: readByAuthenticated
Expand Down

0 comments on commit 7230fd4

Please sign in to comment.