Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SCL name uniqueness check (PostgreSQL) #197

Closed
Sander3003 opened this issue Apr 12, 2022 · 0 comments · Fixed by #222
Closed

Add SCL name uniqueness check (PostgreSQL) #197

Sander3003 opened this issue Apr 12, 2022 · 0 comments · Fixed by #222
Labels
Refinement done Issue is ready for development

Comments

@Sander3003
Copy link
Member

Sander3003 commented Apr 12, 2022

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 Add SCL name uniqueness check (BaseX) #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.
@Sander3003 Sander3003 transferred this issue from com-pas/compas-open-scd Apr 13, 2022
@dlabordus dlabordus changed the title Add SCL "file"name uniqueness check Add SCL name uniqueness check Apr 21, 2022
@dlabordus dlabordus changed the title Add SCL name uniqueness check Add SCL name uniqueness check (PostgreSQL) Apr 21, 2022
@Sander3003 Sander3003 added the Refinement done Issue is ready for development label Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refinement done Issue is ready for development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant