com-pas / compas-scl-data-service

Service to store and retrieve the SCL XML to a database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add SCL name uniqueness check (PostgreSQL)

Sander3003 opened this issue · comments

As an Engineer
I want to be informed if my project name in CoMPAS already exists in the SCL file type
So I prevent confusion (projects with the same name)

When the users enter a name in this window:
image

and clicks on the "save" button, CoMPAS should check if the name already exists for the selected SCL type.
If the name matches an existing one an error should show.

Background:
When a new SCL File is added/updated to the PostgreSQL database we need to check if the name registered in the Private Element "SclName" (under SCL, type "compas_scl") isn't already used.

  • Extended the existing Repositories (PostgreSQL/BaseX) with a method to check if a name isn't already used.
  • In the Service layer first check if the value from the private has changed (update only).
    If not changed no check is needed.
    If changed use the new method to check if the (new) name isn't already used. If already used throw a Exception and stop processing the SCL File.
  • For the BaseX version implementation of the method for now just always return that the name is unique, other issue #203 will implement this version.
  • For the PostgreSQL version execute a query to retrieve the names of all the latest versions and check if the (new) name isn't already used by a other SCL File.