Add JSON-Template-Automated-AAS-Creation Feature to BaSyx Editor Plugin#491
Open
OkCool5 wants to merge 1 commit into
Open
Add JSON-Template-Automated-AAS-Creation Feature to BaSyx Editor Plugin#491OkCool5 wants to merge 1 commit into
OkCool5 wants to merge 1 commit into
Conversation
This pull request introduces the `TemplateAASPlugin` for the BaSyx-UI, enabling dynamic JSON template loading and template-based Asset Administration Shell (AAS) creation. Key features include: - **Dynamic Template Loading**: Uses Vite’s `import.meta.glob` to load JSON templates (`carbon-footprint-template.json`, `contact-information-template.json`, `technical-data-template.json`) from `templates/`, validated against `template-schemas.json`. - **Stepper-Based UI**: Implements `TemplateBasedAASCreator.vue` with Basic Information and Review steps for user-friendly AAS creation, supporting multi-language inputs. - **Services**: Adds `TemplateStorageService.ts`, `TemplateValidatorService.ts`, and `TemplateBasedAASCreator.ts` for template management, validation, and AAS creation via BaSyx backend API. - **Integration**: Updates `AASList` for the template-dialog initialization. All changes except the AASList implementation are located in ./UserPlugins/TemplateAASPlugin. Templates are located under ./UserPlugins/TemplateAASPlugin/Templates. Fixes validation issues in templates and improves modularity for future extensibility. Signed-off-by: Daniel Serban <inf23081@lehre.dhbw-stuttgart.de>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: JSON-Template-Automated-AAS-Creation
Description of Changes
This pull request introduces the
TemplateAASPluginto the BaSyx Editor Plugin, enabling dynamic JSON template loading and template-based Asset Administration Shell (AAS) creation within the BaSyx-UI. Key changes include:TemplateAASPlugininUserPlugins/TemplateAASPlugin/with:import.meta.globto load JSON templates (carbon-footprint-template.json,contact-information-template.json,technical-data-template.json) fromtemplates/.TemplateBasedAASCreator.vuewith a stepper-based dialog for AAS creation, supporting multi-language inputs (ID Short, Display Name, Description).TemplateStorageService.ts,TemplateValidatorService.ts, andTemplateBasedAASCreator.tsfor template management, schema validation, and AAS creation via BaSyx backend API.template-schemas.jsonand handles user input errors.AASListfor the template-dialog initialization.Related Issue
Resolves #TINF23F-123
BaSyx Configuration for Testing
To test the changes, configure the BaSyx backend as follows:
POST /aasandGET /aas/:id/endpointendpoints).npm installin the project root.npm run buildto generatebasyx_editor_plugin.js.templates/directory containscarbon-footprint-template.json,contact-information-template.json,technical-data-template.json, andtemplate-schemas.json.AAS Files Used for Testing
carbon-footprint-template.json: Tests AAS creation with environmental submodel data.contact-information-template.json: Tests AAS creation with contact-related submodel data.technical-data-template.json: Tests AAS creation with technical specifications.product-quality-testing-template.json: Tests AAS creation with quality testing specifications.UserPlugins/TemplateAASPlugin/templates/.Additional Information
Fixed template validation issues by adding missing fields (e.g.,
aasVersion,version) to JSON files.TemplateBasedAASCreator.ts.import.meta.globfor scalability and hot-reloading support.Testing Confirmation: The changes have been thoroughly tested to ensure templates load correctly, the UI dialog functions as expected, and AAS creation succeeds with valid inputs.