-
Notifications
You must be signed in to change notification settings - Fork 12
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 Aspect Model change/refactoring operations #643
Merged
Merged
Conversation
This file contains 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
Fixes eclipse-esmf#450. Properly supporting samm:Namespace in the element instantiation and the DefaultNamespace implementation is a prerequisite for enabling the PrettyPrinter to write Aspect Model files that don't contain an Aspect model element definition.
Creating an AspectModel from a list of AspectModelFiles should be located next to the other methods that create an AspectModel from various input sources
Yauhenikapl
reviewed
Aug 13, 2024
@@ -44,10 +44,10 @@ public void accept( final AspectModel aspectModel, final OutputStream outputStre | |||
|
|||
private static void addFileToArchive( final AspectModelFile file, final ZipOutputStream zos, final String rootPath ) | |||
throws IOException { | |||
final String aspectString = AspectSerializer.INSTANCE.apply( file.aspect() ); | |||
final String aspectString = AspectSerializer.INSTANCE.aspectToString( file.aspect() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so good!
Yauhenikapl
approved these changes
Aug 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
7 tasks
Release v2.9.5 addresses this. |
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.
Description
This PR adds the Java API (the
AspectChangeManager
and theChange
interface)for editing/refactoring AspectModels. Changes are done in-memory and a report
can be generated for performed changes; writing changes back to the file system
is a separate step. The AspectChangeManager allows to undo/redo changes. Several
basic refactoring operations are implemented, such as renaming files, renaming
model elements and moving model elements to other or new files in the same or
another namespace.
A
samm aspect edit move
command is added to samm-cli that allows using themove element functionality.
In order to allow refactoring changes to be written back, the PR also fixes
functionality of the model pretty printer:
are not randomly reordered any more)
aspect prettyprint
command now also works for Aspect Model files that donot contain a
samm:Aspect
declaration.This PR incidentally also fixes displaying samm-cli help for subcommands of subcommands, which was broken; now e.g.
samm help aspect to openapi
will correctly display the help for the openapi subcommandFixes #625. Fixes #450.
Type of change
Checklist: