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

Issue 25661 add an attribute to each and every piece of json that conforms the cli bundle #25731

Conversation

jgambarios
Copy link
Contributor

@jgambarios jgambarios commented Aug 8, 2023

#25661 This PR adds a dotCMSObjectType field to language, content type and site models to be able to easily identify them individually on their JSON/YAML representation.

🤖 Generated by Copilot at 0e10160

Added dotCMSObjectType fields to content type, language, and site classes and interfaces to enable the dotCMS CLI tool to handle them as distinct objects. Added and modified test classes and methods to verify the functionality of the dotCMS CLI commands for pulling content types, languages, and sites.

🤖 Generated by Copilot at 0e10160

  • Add dotCMSObjectType field to ContentType, AbstractLanguage, and AbstractSiteView classes to identify the type of the object in JSON and YAML formats (link, link, link)
  • Annotate ContentType class and its subclasses with @JsonIgnoreProperties, @JsonProperty, @JsonSubTypes, and @JsonTypeInfo to customize JSON serialization and deserialization (link)
  • Create and delete temporary folders for test cases using Files, SimpleFileVisitor, BasicFileAttributes, and UUID classes in ContentTypeCommandTest, LanguageCommandTest, and SiteCommandTest (link, link, link, link)
  • Test content-type pull, language pull, and site pull commands of dotCMS CLI tool by checking the dotCMSObjectType field in JSON and YAML files in ContentTypeCommandTest, LanguageCommandTest, and SiteCommandTest (link, link, link)
  • Remove unused imports and add missing imports for test annotations in ContentTypeCommandTest, LanguageCommandTest, and SiteCommandTest (link, link, link, link)

…models

Added a "dotCMSObjectType" field to the language, content type, and site models in the project to get better clarity. Additionally, new tests have been added to LanguageCommandTest, ContentTypeCommandTest, and SiteCommandTest. These tests ensure that the "dotCMSObjectType" field is present in the JSON and YAML files generated when the pull command is executed for languages, content types, and sites respectively.

This addition helps in identifying the object type when reviewing the JSON or YAML files, improving maintainability and understandability of the codes and files.
This commit introduces JsonViews in AbstractLanguage, ContentType, and AbstractSiteView classes. This helps manage different JSON views and control serialization for different use cases. A JsonProperty "dotCMSObjectType" has been added to the ContentType class. Test cases for Content Type, Site and Language have been updated to include a command to push the changes back to the server, ensuring the structure is still correct. New functionalities for creating and updating language and content type have been provided with the ExternalView of Json, adding more security to the API calls. The CommonViews class has been added to handle different views for JSON serialization. This change enhances the control over data visibility in different scenarios.
…attribute-to-each-and-every-piece-of-json-that-conforms-the-CLI-Bundle

# Conflicts:
#	tools/dotcms-cli/cli/src/test/java/com/dotcms/cli/command/contenttype/ContentTypeCommandTest.java
#	tools/dotcms-cli/cli/src/test/java/com/dotcms/cli/command/site/SiteCommandTest.java
@jgambarios jgambarios marked this pull request as ready for review August 10, 2023 15:38
…very-piece-of-json-that-conforms-the-CLI-Bundle
@nollymar nollymar merged commit e02de09 into master Aug 14, 2023
15 of 18 checks passed
@nollymar nollymar deleted the issue-25661-add-an-attribute-to-each-and-every-piece-of-json-that-conforms-the-CLI-Bundle branch August 14, 2023 19:15
fmontes pushed a commit that referenced this pull request Aug 14, 2023
* Issue 25661 add an attribute to each and every piece of json that conforms the cli bundle (#25731)

* #25661 Add dotCMSObjectType field to language, content type and site models

Added a "dotCMSObjectType" field to the language, content type, and site models in the project to get better clarity. Additionally, new tests have been added to LanguageCommandTest, ContentTypeCommandTest, and SiteCommandTest. These tests ensure that the "dotCMSObjectType" field is present in the JSON and YAML files generated when the pull command is executed for languages, content types, and sites respectively.

This addition helps in identifying the object type when reviewing the JSON or YAML files, improving maintainability and understandability of the codes and files.

* #25661 Refactor ContentType class: "TYPE" made final

* #25661 Added a JsonProperty to ContentType class

* #25661 Added JsonViews and JsonProperty to handle JSON serialization.

This commit introduces JsonViews in AbstractLanguage, ContentType, and AbstractSiteView classes. This helps manage different JSON views and control serialization for different use cases. A JsonProperty "dotCMSObjectType" has been added to the ContentType class. Test cases for Content Type, Site and Language have been updated to include a command to push the changes back to the server, ensuring the structure is still correct. New functionalities for creating and updating language and content type have been provided with the ExternalView of Json, adding more security to the API calls. The CommonViews class has been added to handle different views for JSON serialization. This change enhances the control over data visibility in different scenarios.

* #25661 Cleanup

---------

Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>

* Update dot-block-editor.component.ts

* Update dot-content-compare-block-editor.component.spec.ts

* Update TestDataUtils.java

* Update StoryBlockAPITest.java

* Update FolderAPITest.java

* Update ContentletIndexAPIImplTest.java

---------

Co-authored-by: Jonathan Gamba <jonathan.gamba@dotcms.com>
Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
fmontes pushed a commit that referenced this pull request Sep 11, 2023
…26025)

* Jdcmsd char count fixes (#25780)

* Issue 25661 add an attribute to each and every piece of json that conforms the cli bundle (#25731)

* #25661 Add dotCMSObjectType field to language, content type and site models

Added a "dotCMSObjectType" field to the language, content type, and site models in the project to get better clarity. Additionally, new tests have been added to LanguageCommandTest, ContentTypeCommandTest, and SiteCommandTest. These tests ensure that the "dotCMSObjectType" field is present in the JSON and YAML files generated when the pull command is executed for languages, content types, and sites respectively.

This addition helps in identifying the object type when reviewing the JSON or YAML files, improving maintainability and understandability of the codes and files.

* #25661 Refactor ContentType class: "TYPE" made final

* #25661 Added a JsonProperty to ContentType class

* #25661 Added JsonViews and JsonProperty to handle JSON serialization.

This commit introduces JsonViews in AbstractLanguage, ContentType, and AbstractSiteView classes. This helps manage different JSON views and control serialization for different use cases. A JsonProperty "dotCMSObjectType" has been added to the ContentType class. Test cases for Content Type, Site and Language have been updated to include a command to push the changes back to the server, ensuring the structure is still correct. New functionalities for creating and updating language and content type have been provided with the ExternalView of Json, adding more security to the API calls. The CommonViews class has been added to handle different views for JSON serialization. This change enhances the control over data visibility in different scenarios.

* #25661 Cleanup

---------

Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>

* Update dot-block-editor.component.ts

* Update dot-content-compare-block-editor.component.spec.ts

* Update TestDataUtils.java

* Update StoryBlockAPITest.java

* Update FolderAPITest.java

* Update ContentletIndexAPIImplTest.java

---------

Co-authored-by: Jonathan Gamba <jonathan.gamba@dotcms.com>
Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>

* dev (block editor): build

---------

Co-authored-by: Jamie Mauro <102264829+jdcmsd@users.noreply.github.com>
Co-authored-by: Jonathan Gamba <jonathan.gamba@dotcms.com>
Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
Co-authored-by: Jose Castro <jose.castro@dotcms.com>
manuelrojas pushed a commit that referenced this pull request Sep 12, 2023
…26025)

* Jdcmsd char count fixes (#25780)

* Issue 25661 add an attribute to each and every piece of json that conforms the cli bundle (#25731)

* #25661 Add dotCMSObjectType field to language, content type and site models

Added a "dotCMSObjectType" field to the language, content type, and site models in the project to get better clarity. Additionally, new tests have been added to LanguageCommandTest, ContentTypeCommandTest, and SiteCommandTest. These tests ensure that the "dotCMSObjectType" field is present in the JSON and YAML files generated when the pull command is executed for languages, content types, and sites respectively.

This addition helps in identifying the object type when reviewing the JSON or YAML files, improving maintainability and understandability of the codes and files.

* #25661 Refactor ContentType class: "TYPE" made final

* #25661 Added a JsonProperty to ContentType class

* #25661 Added JsonViews and JsonProperty to handle JSON serialization.

This commit introduces JsonViews in AbstractLanguage, ContentType, and AbstractSiteView classes. This helps manage different JSON views and control serialization for different use cases. A JsonProperty "dotCMSObjectType" has been added to the ContentType class. Test cases for Content Type, Site and Language have been updated to include a command to push the changes back to the server, ensuring the structure is still correct. New functionalities for creating and updating language and content type have been provided with the ExternalView of Json, adding more security to the API calls. The CommonViews class has been added to handle different views for JSON serialization. This change enhances the control over data visibility in different scenarios.

* #25661 Cleanup

---------

Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>

* Update dot-block-editor.component.ts

* Update dot-content-compare-block-editor.component.spec.ts

* Update TestDataUtils.java

* Update StoryBlockAPITest.java

* Update FolderAPITest.java

* Update ContentletIndexAPIImplTest.java

---------

Co-authored-by: Jonathan Gamba <jonathan.gamba@dotcms.com>
Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>

* dev (block editor): build

---------

Co-authored-by: Jamie Mauro <102264829+jdcmsd@users.noreply.github.com>
Co-authored-by: Jonathan Gamba <jonathan.gamba@dotcms.com>
Co-authored-by: Nollymar Longa <nollymar.longa@dotcms.com>
Co-authored-by: Jose Castro <jose.castro@dotcms.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add an attribute to each and every piece of json that conforms the CLI Bundle
3 participants