Skip to content

Commit

Permalink
fix: add publish date (#25233) (#26353)
Browse files Browse the repository at this point in the history
* fix: add publish and unpublish date (#25233)

* #25233 fixed exception handling for upgrade task test

* fix(containers): Tabs and Rows Variables Height #26197

* Homolage containers tab to Content Type tabs

* Now use color variables. Removed unused and unnecesary scss code-classes

* Making look back window configurable (#26346)

* Fixing bug when decide if create a Anonymous Template

* Fixing error on DotPageRenderService

* Making lookBackWindow configurable

* Fixing test

* #26332 Move `DotCopyButtonComponent` to UI lib (#26336)

* 26332 move DotCopyButtonComponent to UI lib

* #26332 fix lint

* Issue 26348 dot content map is not working on containers (#26356)

* Fixing bug when decide if create a Anonymous Template

* Fixing error on DotPageRenderService

* Removing dotContentMap from auto generated code

* fix(ui) Add taglink css fix to source scss (#26365)

* fix(ui): Table Header Sort Icon Misplacement #26366

* fix(ui) #26056: Autocomplete Styles were Off 

* fix (autocomplete styles): height and fonts were off for autocomplete without chips

* feedback (autocomplete styles): add calculation to maintain the variables

* fix(ui) Template last edit date column align (#26372)

* fix(ui) Template last edit date column align

* Fix test

* fix(ui) Block Editor Input styles are not being applied #26370

* dev: generate  file

* dev: move dotCMS block editor script to parent  file

* #26373: Making CircuitBreakerUrl more informative about the errors when consuming an http endpoint (#26364)

* ci(dev-cycle): moving postman tests to maven CI/CD pipeline workflow (#26291)

Introducing postman tests and its dependencies to be started, ended and reported as the same way the other tests (unit and integration) do, that is by the maven CI-CD pipeline workflow.

Refs: #25890

* feat(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188 (#26350)

* fix(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188

* Implementing SonarQube feedback.

* Implementing SonarQube feedback.

* Fixing test class name.

* fix(core): Referencing Tika JARs from Artifactory (#26027)

* Temporary changes

* Leave internal version as it is until the new versioning approaach is implemented

* Leave internal version as it is until the new versioning approach is implemented

---------

Co-authored-by: Will Ezell <[email protected]>
Co-authored-by: Freddy Montes <[email protected]>

* Fixing experiment pp bug (#26379)

* Fixing bug when decide if create a Anonymous Template

* Fixing error on DotPageRenderService

* #25732 Fixing Bug when try to Push a Page Variant Version using the System Template

* Fixing bug with thw Scheduling on PP

* Fixing bug with thw Scheduling on PP

* Comment test

* Comment test

* feat(edit-content) Allow user to upload files from external sources (fix #26313)

* dev: add url mode

* dev: create DotBinaryFieldUrlMode component

* test: cover dotBinaryFieldUrlMode Component tests

* dev: add i18n - internalization

* dev: improve style & build binary field

* dev: avoid closing the dialog while uploading

* dev: add store for URL Mode

* test: DotBinaryFieldUrlMode Component

* dev: generate contenttype-fields-styles.css file

* clean up

* clean up v2

* feedback

* clean up

* feedback v1

* move fonts.scss to dotcms-scss/angular

* feedback v3

* clean up

* feeback: input & button styles

* feeback: binart fiel css file

* styles: fix error message height

* clean up

* feedback: button styles

* dev: build binary field web-component

* clean up

* fix: frontend tests

* clean up v2

* build web component

---------

Co-authored-by: Jalinson Diaz <[email protected]>

* fix(containers) Tabs and Rows Variables Height #26197

* #26387 fix overwritten css (#26394)

* [Internal-QA]: Fixes for social media seo (#26388)

* #26262 Adding readmore styling

* Merging with master

* #25288 Internal QA feedback

* #25288 Internal QA feedback

* #25288 Adding twitter fixes

* Adding the models

* Adding more testing

* feat(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188 (#26350)

* fix(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188

* Implementing SonarQube feedback.

* Implementing SonarQube feedback.

* Fixing test class name.

* fix(core): Referencing Tika JARs from Artifactory (#26027)

* Temporary changes

* Leave internal version as it is until the new versioning approaach is implemented

* Leave internal version as it is until the new versioning approach is implemented

---------

Co-authored-by: Will Ezell <[email protected]>
Co-authored-by: Freddy Montes <[email protected]>

* Fixing experiment pp bug (#26379)

* Fixing bug when decide if create a Anonymous Template

* Fixing error on DotPageRenderService

* #25732 Fixing Bug when try to Push a Page Variant Version using the System Template

* Fixing bug with thw Scheduling on PP

* Fixing bug with thw Scheduling on PP

* Comment test

* Comment test

* feat(edit-content) Allow user to upload files from external sources (fix #26313)

* dev: add url mode

* dev: create DotBinaryFieldUrlMode component

* test: cover dotBinaryFieldUrlMode Component tests

* dev: add i18n - internalization

* dev: improve style & build binary field

* dev: avoid closing the dialog while uploading

* dev: add store for URL Mode

* test: DotBinaryFieldUrlMode Component

* dev: generate contenttype-fields-styles.css file

* clean up

* clean up v2

* feedback

* clean up

* feedback v1

* move fonts.scss to dotcms-scss/angular

* feedback v3

* clean up

* feeback: input & button styles

* feeback: binart fiel css file

* styles: fix error message height

* clean up

* feedback: button styles

* dev: build binary field web-component

* clean up

* fix: frontend tests

* clean up v2

* build web component

---------

Co-authored-by: Jalinson Diaz <[email protected]>

* Adding more testing

* Adding refactor

* Adding refactor

* Adding refactor

* Adding refactor

* Adding more refactor

* Limit the preview

* Adding preview in 60 characters

* PR Feedback

* PR Feedback

* Adding PR feedback

---------

Co-authored-by: Jose Castro <[email protected]>
Co-authored-by: Will Ezell <[email protected]>
Co-authored-by: Freddy Montes <[email protected]>
Co-authored-by: Freddy Rodriguez <[email protected]>
Co-authored-by: Rafael Velazco <[email protected]>
Co-authored-by: Jalinson Diaz <[email protected]>

* chore(cli): Implement gha generate cli release (#26294)

* #25951 Setting versions-maven-plugin for release version management.

* #25951 Setting precheck job (checkout, java, git, set release version).

* #25951 Setting Java version and Java distribution.

* #25951 Getting input variables on release job.

* #25951 Printing GitHub context.

* #25951 Printing GitHub context REF.

* #25951 Testing release version setup.

* #25951 fixing release version setup.

* #25951 fixing release version setup.+1.

* #25951 fixing release version setup.+2.

* #25951 fixing release version setup.+3.

* 🏁 Releasing version 1.0.0

* #25951 Testing next version setup.

* #25951 Fixing next version setup.

* 🏁 Releasing version 1.1.0

* #25951 Fixing next version setup. +1.

* #25951 Fixing next version setup. +2.

* 🏁 Releasing version 1.2.0

* #25951 Fixing next version setup. +3.

* #25951 Fixing next version setup. +4.

* 🏁 Releasing version 1.3.0

* #25951 Fixing next version setup. +5.

* #25951 Fixing next version setup. Adding git config.

* 🏁 Releasing version 1.4.0

* #25951 Fixing next version setup. Check current branch out.+1.

* #25951 Fixing next version setup. Check current branch out.+2.

* 🏁 Releasing version 1.4.1

* #25951 Fixing next version setup. Check current branch out.+3.

* 🏁 Releasing version 1.4.2

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Testing build and releaser steps.

* 🏁 Releasing version 1.4.0

* #25951 Build and releaser steps. Adding module in main pom file for testing.

* #25951 Fixing build and releaser steps. +1.

* 🏁 Releasing version 1.4.1

* #25951 Fixing releaser steps. +1.

* #25951 Fixing releaser steps. +2.

* 🏁 Releasing version 1.4.2

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Testing deploy distribution on artifactory.

* 🏁 Releasing version 1.4.3

* #25951 Fixing test deploy distribution on artifactory. +1.

* 🏁 Releasing version 1.4.3

* #25951 Fixing test deploy distribution on artifactory. +2.

* 🏁 Releasing version 1.4.3

* #25951 Fixing test deploy distribution on artifactory. +3.

* 🏁 Releasing version 1.1.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Testing JReleaser artifactory integration.

* 🏁 Releasing version 1.2.3-SNAPSHOT

* #25951 Testing JReleaser artifactory integration. +1.

* 🏁 Releasing version 1.4.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Testing JReleaser artifactory integration. +2.

* #25951 Testing JReleaser artifactory integration. +3.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Testing build step.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Testing JReleaser artifactory integration, snapshot repository and release repository configuration.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* 🏁 Releasing version 1.0.0-SNAPSHOT

* dotcms-cli release generation.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* #25951 dotcms-cli Release generation. +1.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Update cli-release-process.yml

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 dotcms-cli Release generation. +2.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Some improvements in the release process.

* #25951 dotcms-cli pom files optimization. Pom parent (core) has been added.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Testing GHA cli release workflow

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +1.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +2.

* Fixing cli release workflow. +3.

* Fixing package distribution step. +3.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +4.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +5.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +6.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +7.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +8.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* Fixing package distribution step. +9.

* 🏁 Releasing version 1.0.0-SNAPSHOT

* ⬆️  Next version 1.0.0-SNAPSHOT

* #25951 Fixing parent pom (core) configuration.

* #25951 Maven cache configuration updated. POM  properties improvement.

---------

Co-authored-by: daniel.colina <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>

* chore(cli): Implement GHA to execute a super push (#26334)

* save point

* save point

* #26300 script improvements

* #26300 fixes to the script that runs the cli

* feat(containers): Add extra fields for code variables (fix #26293)

* dev (dot add variable): add extra fields for image

* dev (dot add variable): small clean up

* copywritting (dot add variables store): fix comment

* dev (dot add variables): enhance models and methods naming

* dev (dot add variable): small cleanup

* dev (dot add variable store): small clean up

* dev (dot add variable): add missing test

* feedback (dot add variable): small clean up

* dev (general): add dot fields service to handle custom code and extra fields

* fix (dot add variable module): add provider

* dev (dot add variable models): filter fieldTypes that does not appear on legacy portlet

* dev (dot fields service): add custom code for block editor and binary

* dev (dot add fields service): add checkbox, radio, select and multiselect extra fields

* fix (dot fields service): fix message

* dev (dot fields service): add extra fields for date fields

* dev (dot fields service): add test cases

* fix (dot add variable test): broken test

* dev (dot add variable component): styles clean up

* dev (dot add variables): fix merge conflicts

* dev (dot fields service): general code cleanup

* fix (dot fields service): typo in fields variables

* dev (dot fields service): fix custom code to match new variables

* fix (dot add variable): broken test

* dev (dot fields service): fix variables and custom code for dates

* dev (dot container code): now editor replaces where the cursor selected or add where the cursor is

* dev (dot container code component): enhance variable naming

* fix (language properties): re add deleted key

* dev (dot fields service): addressing changes requested in the PO

* Issue 26400 generate runningid when scheduling (#26404)

* #26400 generate runningid when scheduling Experiment

* #26400 IT

* #26400 rewrite IT

* #26403 Fixing language properties (#26406)

* fix(seo improvements): copy change for google serp preview (#26410)

* #26403 Fixing language properties

* #26402 Change google, fix facebook labels

* PR Feedback

* Adding testing for result components

* Adding few more tests

* #26402 Adding test for meta tags

* #26402 Adding test for meta tags

* #25732: fix on adding variant template dependecy when creating bundle (#26414)

* More time metrics (#26398)

* fix(core): Add a role extra layer constraint into the secrets view tool #25587

* Adding minor fixes reported via IQA feedback.

* Using constants for characters

* Implementing Code Review feedback.

* Implementing SonarQube feedback.

* #25901 Retrieve Contentlet created in Variant in the Palette Sidebar (#26338)

* #25901 testing lucent query

* Not include variant filter if the lucene query already is filtering by variant

* Sending Variant attribute

* #25901 handle the variant field

* #25901 remove the default duplicated contentlet in a variant

* #25901 fix comments

* #25901 fix comments

* #25901 fix comments

* fix test

---------

Co-authored-by: freddyucv <[email protected]>

* fix(container): Add max height and overflow behavior to menu component (#26442)

* fix(ui) #26435: Dojo Dropdown Options broken on search  (#26436)

* dev (dojo menu styles): encapsulate template selector styles

* dev (dojo menu styles): add font weight bold to highlight match

* feat(edit-content): Allow User To Create A By Write Code #26045

* dev: add monaco editor in dojo

* clean up

* feat(edit-content) Develop basic form with text field and save button #26330

* Working on EditContenlet MVP

* Maked changes based on PR suggestions

* Finalized new arch of edit-content lib.

* Working on PR Suggestions

* Working on tests. Have problem on edit-content.layout.spec

* Find issue in tests

* Finished tests

* Make a PR suggestion changes. Added new tests

* Maked PR suggestions. Added new tests. Added new behavior on content-edit.layout

* Changed way to test dot-edit-content.service, now use createHttpFactory

* Remove unused imports and variables

* Add sidebar and styles rows spacing

---------

Co-authored-by: Freddy Montes <[email protected]>
Co-authored-by: Jalinson Diaz <[email protected]>

* #26146 force width in inline input dropdown (#26429)

* fix(add-to-bundle): force width in inline input dropdown

* fix(add-to-bundle): force width in inline input dropdown globally

* feat(edit-content) Show block/wysiwyg/text fields editing full screen #26222

* feat(ui) show full screen when it is the only thing on the tab

ref: #26222

* feat(ui) full screen for fields

ref: #26222

* feat(ui) full screen fields it tests

ref: #26222

* feat(ui) adding feature flag
 or as an env var

ref: #26222

* dev (dotcms dojo styles): compile new styles for fullscreen mode

* dev (dotcms styles): compile styles

* dev (block editor general): add styles and functionality to fullscreen the block editor

* dev (edit field): add fullscreen for wysiwyg and plain text

* dev (edit field): add final functionality for wysiwyg

* dev (edit field): delete console.log

* Implementing SonarQube feedback.

* dev (dotcms dojo styles): add comments

---------

Co-authored-by: Will Ezell <[email protected]>
Co-authored-by: Jalinson Diaz <[email protected]>
Co-authored-by: Jose Castro <[email protected]>

* fix(containers): Tabs and Rows Variables Height #26197

* Fixed jumping on hover and wrapping text on tabs

* Move css to tabview

---------

Co-authored-by: Freddy Montes <[email protected]>

* Issue #26425: Support Multi lang when include MultiTree Contentlet inside a Bundle (#26438)

* feat(core): Add a role extra layer constraint into the secrets view tool #25587

* Issue #25184: adding the support for the system table config (#25936)

* #25184 adding the support for the system table config

* #25184 adding the support for the system table config

* #25184 avoid recursive issues on system table/config

* #25184 adding fixes and unit test

* #25184 adding fixes and unit test

* #25184 adding feedback

* #25184 adding more coverage test

* #25184 trying some fixes for the init fail

* #25184 reverting undesired changes

* #25184 reverting undesired changes

* #25184 reverting undesired changes

* #25184 decoupling the task from config

* #25184 trying to avoid issues when the db is no ready

* #25184 trying to avoid issues when the db is no ready

* #25184 adding a fix to avoid to run the system table on test

* #25184 adding an event when update the system table

* #25184 making lazy the system table on the config source

* #25184 lazyness of the config dependency

* Attempt to fix Integration Test run

* Attempt to fix Integration Test run

* Attempting to fix Unit Test run

* Attempting to fix Unit Test run

* Reverting unnecessary file changes.

* Implementing SonarQube feedback

* Merging changes from master.

---------

Co-authored-by: Jose Castro <[email protected]>

* feat(edit-contentlet): Allow User Write Code #26045

* dev: add monao editor

* dev: set monaco editor

* dev: make editor cover space available

* test: cover DottBinaryFieldEditorComponent test cases

* dev: add type/mimeType validation

* clean up

* dev: build binary field and add validation message for file name

* test: fix broken test

* dev: hide old edit file on new binary field

* Feedback: Freddy's suggestion

* [Issue-25959]: seo improvements validate when favicon or preview image are broken (#26443)

* Fixing facebook meta

* Copy change

* #25959 Fixing method to validate if the image does not exits

* Progres on #25959

* #25959 Adding Progress on image broken

* #25959 image not-found

* #25959 Adding new component

* #25959 adding preview component

* #25959 Adding image broken

* #25959 Adding image broken

* #25959 Adding image broken

* #25959 Css fixes'

* #25959 Css fixes'

* #25959 Fixing google validation

* #25959 Added testing to the preview components

* #25959 fix image not found

* #25959 fix image not found

* PR feedback

* PR Feedback

* Adding meta tags service

* PR feedback

* PR feedback

* Fixing limit

* save point (#26430)

* save point

* #26380

* #26380  this should fix the issue

* #26380

* #26380 fix in pipiline + fix in Test

* #26380 adjusting test to relflect fix

* #26380 playing wiht broken test

* debug info

* testing more scenarios

* #26380 trying fix for test

* #26380 IT

* #26380 undoing refactor saving it for anther PR

* #26380 fixing doc

* #26380 applying feedback provided

* #26380 replacing Abstract Class by the concrete impl

* feat(core): Add db layer to our config to allow on-the-fly (no restart) configuration #25184

* feat(system table) : Adding missing requirements from Code Review #25184

* Enable System Table by default.

* fixing bad dependencies in pom (#26472)

* feat(ai): Create an "AI Image" custom block #25670

* Created AI content node

* Created ai-content-service

* Created AI prompt content extension

* Update ai-content.service.ts

* Optimised and aligned extension code

* Resolved comments on PR

* Removed ai content node file

* Update ai-content.service.ts

* Remove import path for ai-content-node

* Updated the ai-prompt form

* align ai text prompt extension

* Resovled comments on pull

* Fix the aiTextPrompt form

* Updated extension related code

* Update ai-content-prompt.plugin.ts

* Remove some extra code

* Fixed outside click for aiContentPrompt extension

* Created ai content node

* Updated ai-content node

* Remove unused code, resolve comments on PR

* ai-content-prompt extension code optimisation

* Update ai-content-prompt.plugin.ts

* Integrated with AI api

* insert ai node on response

* textPrompt extension code optimsation

* Update ai-content.service.ts

* Resolve comments on pull req

* handle close extension on outside click and content flip fix

* Added focus field method and type for form

* Change name of ai node creation command

* Update the ai-content icon in the actions menu list

* Update ai-content-prompt.component.scss

* Resolved comments on pull

* Added pening status and update the name of destroy var

* Implement ai-content-actions extension

* ai-prompt extension code optimisation

* ai-text-prompt block optimisation

* Update main.ts

* feat: Created ai image prompt extension

* Resolve comments on pull

* Created loader node and handle loading image

* Resolve comments on PR

* Code optimisation for ai-content-actions extension

* Fix css for p-listbox

* Handle ai content actions to work in two diff context, code optimisation

* Code optimisation

* clean code from extra code

---------

Co-authored-by: Nikola Trajkovic <[email protected]>
Co-authored-by: Nikola <[email protected]>
Co-authored-by: Will Ezell <[email protected]>

* #25901 Unable to reuse content inside the variants (#26450)

* refresh the content palette when the languge change

* make a couple of less state updates

* clean up

* fix(core): Edit Contentlet: Allow User Write Code #26045

* fix: SonarQube regex warning

* warning: avoid use RegEx

* warning: avoid use RegEx

* fix(core): Edit Options not Showing on UrlContent Page #26314

* dev (edit page state controller): regenerate menuItems when navigating inside the iframe

* fix (edit page state controller): test was broken

* feat(edit-content): Render TextField and TextArea Field to the Form #26442

* dev (edit content lib): add text area, default value and inputmode/type support

* dev (dot edit content field): add comments to new code

* dev (dot edit content form): add comment

* dev (dot edit content field): change steps from any to 0.1 in decimals

* dev (dot edit content lib): create field wrappers for text area and text field

* dev (dot edit content): add and clean test cases

* dev (edit content mock): remove duplicated code

* dev (edit content): address feedback

* fix (edit-content-form): styles were off

* fix (edit content text area): min height was too high

* dev (edit content field): address feedback

* dev (mocks): separate fields

* dev (edit content field): enhance testing

* dev (edit content): general clean up

* dev (edit content form): delete todo

* Revert "feat(ai): Create an "AI Image" custom block #25670" (#26483)

This reverts commit 4b7b189.

* feat(block-editor): AI Node and AI Actions extension (#26055) (#26455)

* Created AI content node

* Created ai-content-service

* Created AI prompt content extension

* Update ai-content.service.ts

* Optimised and aligned extension code

* Resolved comments on PR

* Removed ai content node file

* Update ai-content.service.ts

* Remove import path for ai-content-node

* Updated the ai-prompt form

* align ai text prompt extension

* Resovled comments on pull

* Fix the aiTextPrompt form

* Updated extension related code

* Update ai-content-prompt.plugin.ts

* Remove some extra code

* Fixed outside click for aiContentPrompt extension

* Created ai content node

* Updated ai-content node

* Remove unused code, resolve comments on PR

* ai-content-prompt extension code optimisation

* Update ai-content-prompt.plugin.ts

* Integrated with AI api

* insert ai node on response

* textPrompt extension code optimsation

* Update ai-content.service.ts

* Resolve comments on pull req

* handle close extension on outside click and content flip fix

* Added focus field method and type for form

* Change name of ai node creation command

* Update the ai-content icon in the actions menu list

* Update ai-content-prompt.component.scss

* Resolved comments on pull

* Added pening status and update the name of destroy var

* Implement ai-content-actions extension

* ai-prompt extension code optimisation

* ai-text-prompt block optimisation

* Update main.ts

* Resolve comments on pull

* Resolve comments on PR

* Code optimisation for ai-content-actions extension

* Fix css for p-listbox

---------

Co-authored-by: Nikola Trajkovic <[email protected]>
Co-authored-by: Nikola <[email protected]>
Co-authored-by: Will Ezell <[email protected]>

* feat(block-editor): AI Image prompt Block (#26405) (#26485)

* Created AI content node

* Created ai-content-service

* Created AI prompt content extension

* Update ai-content.service.ts

* Optimised and aligned extension code

* Resolved comments on PR

* Removed ai content node file

* Update ai-content.service.ts

* Remove import path for ai-content-node

* Updated the ai-prompt form

* align ai text prompt extension

* Resovled comments on pull

* Fix the aiTextPrompt form

* Updated extension related code

* Update ai-content-prompt.plugin.ts

* Remove some extra code

* Fixed outside click for aiContentPrompt extension

* Created ai content node

* Updated ai-content node

* Remove unused code, resolve comments on PR

* ai-content-prompt extension code optimisation

* Update ai-content-prompt.plugin.ts

* Integrated with AI api

* insert ai node on response

* textPrompt extension code optimsation

* Update ai-content.service.ts

* Resolve comments on pull req

* handle close extension on outside click and content flip fix

* Added focus field method and type for form

* Change name of ai node creation command

* Update the ai-content icon in the actions menu list

* Update ai-content-prompt.component.scss

* Resolved comments on pull

* Added pening status and update the name of destroy var

* Implement ai-content-actions extension

* ai-prompt extension code optimisation

* ai-text-prompt block optimisation

* Update main.ts

* feat: Created ai image prompt extension

* Resolve comments on pull

* Created loader node and handle loading image

* Resolve comments on PR

* Code optimisation for ai-content-actions extension

* Fix css for p-listbox

* Handle ai content actions to work in two diff context, code optimisation

* Code optimisation

* clean code from extra code

---------

Co-authored-by: Nikola Trajkovic <[email protected]>
Co-authored-by: Nikola <[email protected]>
Co-authored-by: Will Ezell <[email protected]>

* [Issue-25962] SEO improvements use a hand cursor for edit and preview buttons (#26473)

* Merging with master

* Merging with master

* Merging with master

* #25959 Adding image broken

* Merging with master

* #25959 Css fixes'

* Merging with master

* Merging with master

* #25959 fix image not found

* #25959 fix image not found

* Adding meta tags service

* PR feedback

* Adding refactor

* Adding refactor

* Adding more tests for validate the test scenarios

* Adding favicon validation

* #25962 cursor pointer

* Refactor service

* Refactor service

* Adding refactor service

* Fixing tests

* feat(ui): Login Screen Changes #26303

* dev (login component): change button to be primeng button

* fix (login component): tests were broken

* dev (login component): remove extra type from input

* dev (dot login styles): change font size to small

* dev (dot login component): make forgot password button a link and use native routing

* fix(core): Unable to do push publish pages from the pages portlet #26451

* fix (pages store): we were not using the correct reference to get the item for PP action

* dev (pages store): add test case

* Issue 26476 unable to push experiments (#26478)

* #24967 postman tests for deleting an Experiment

* #26476 use proper method to solve content on variant

* #26476 integration test

* fix(experiment-reports): show the input name of the goal in the summary (#26482)

* truncate decimal based on new rules (#26488)

* fix(seo): UI disabled tab buttons in seo toolbar don't show properly (#26490)

* Adding twitter fixes

* #26193 Adding disabled for tab buttons

* Adding PR feedback

* Adding aria attr

* Update dotmarketing-config.properties (#26492)

* Fix #26349: Template Builder change auto save and publish to just auto save (#26494)

* dev (dot template builder): change auto save and publish, to auto save

* dev (dot template builder): remove comment

* #26409 Calendar Design System implementation (#26469)

* feat(p-calendar): implement DS of calendar

* feat(p-calendar): fix sq comment

* feat(p-calendar): fix comments

* feat(p-calendar): fix comments

* feat(p-calendar): fix comments

* feedback requested (#26493)

* feedback requested

* #26380 fixing bug

* #26380 remove commented attributes no longer used

* #26380 changing classes to immutables

* #26380 these attribute will be moved later

* #26380 renaming the new classes

* feat(edit-content): Edit Content: Render Radio and Select Field to the Form #26448

* Added Select and Radio fields. Added basic tests on both components. Changed formData structure and architecture

* Added validation to set, in case dont have value or defaultValue, the first option as value in select and radio field

* Added enum to DataType

* Added tests. Changed mocks.

* Working on PR Suggestions. Commit before merge

* Added merge with master. Added Typing to forms on Select and Radio button. Added more test cases

* Pair programming select tests

* Changed tests. Changed language of mocks. Moved folders to shared/

* Replaced shared folder with models content

* Changed and added test to RadioButton field

* Changed name on util => function

* Working on DotEditContentForm tests

* Solved test on DotEditContentForm

* Pair programming tests for dot-edit-content

* Added more tests. Reduced html on radio field. Casting values on init form

---------

Co-authored-by: Freddy Montes <[email protected]>

* #26193 Adding fix for tabs (#26499)

* fix(seo): Adding a mask to close when clicking outside of the modal (#26513)

* #26089 Adding a mask to close when clicking outside of the modal

* Adding test for the new html element

* fix(seo): preview button should always take user to default preview (#26517)

* #26419 default view

* Removing export

* feat(core): Multi Metadata Provider/Chainable Metadata Provider #24307

* feat(chainable metadata provider) : #24307 Introducing the composite chainable storage provider

* Fixing Integration Tests

* Implementing SonarQube feedback and fixing Integration Tests

* #24307 adding just a comment

* Fixing name as it said "4040" instead of "404"

* #24307 adding more test

* Fixing compile error in test.

* #24307 adding test for dotconnect

* Implementing SonarQube feedback.

---------

Co-authored-by: jdotcms <[email protected]>

* feat(edit-content): Edit Content add Calendar related fields #26512

* dev (dot edit content calendar field): create and adapt to the lib

* dev (edit content): integrate component with the lib and cleanups

* fix(edit-content): Add icons to calendar field

* Issue 25967 include user activity log experiments (#26496)

* #24967 postman tests for deleting an Experiment

* #25967 Log user activity on operations on Experiments

* #25967 proper action

* Create label-issues.yml

* chore(ui): Add storybook and styles for Autocomplete #26376

* fix (autocomplete styles): focus state

* fix (autocomplete styles): add styles for clear icon

* dev (autocomplete story): add controls for the autocomplete

* fix: remove redundant close ref#26374 (#26381)

* Making possible to edit content within the Edit Page, regardless of the portlets you have assigned. (#26447)

* #22698 adding fix

* #22698 adding test

* #22698 improving code readability

* #22698 gh feedback

* #22698 improving code

* #22698 refactoring code

---------

Co-authored-by: erickgonzalez <[email protected]>

* Making Workflow API capable to archive contentlet (#26479)

* #22698 remove error cause

* #22921 adding fix

* #22921 adding postman test

* #22921 mini rollback

---------

Co-authored-by: erickgonzalez <[email protected]>

* feat(edit-content) Add Checkbox and Multiselect Fields to the Form #26491

* Working on Checkbox

* Working on Checkbox and MultiSelect

* feat(edit-content): fix DotEditContentMultiSelectFieldComponent test

* feat(edit-content): fix DotEditContentMultiSelectFieldComponent test

* feat(edit-content): fix DotEditContentMultiSelectFieldComponent final test

* Revert "feat(edit-content): fix DotEditContentMultiSelectFieldComponent test"

This reverts commit 5ef6b3c.

* Fix multiselect test

* Clean up

---------

Co-authored-by: Freddy Montes <[email protected]>
Co-authored-by: Arcadio Quintero <[email protected]>

* feat(edit-content) Add Tags Field #26526

* dev (dot select item directive): create directive to add items to autocomplete on enter

* dev (add styles classed dialog): add the directive on template builder autocomplete

* fix (autocomplete styles): fix spacings of util icons

* dev (edit content tag component): create component for tag

* dev (edit content): add tag component to form

* fix (edit content form): save contentlet was not working for tags

* fix (edit content): fix after merge conflcits

* dev (autocomplete styles): fix positioning of icons and buttons

* dev (autocomplete styles): fix margin

* clean up (functon utils): reduce cyclomatic complexity

* clean up: (autocomplete styles)

* feat(core): #24307 Introducing the Redis Storage Provider (#26540)

* feat(core): #25184 Fixing code to make POST method both save and update a key/value pair (#26530)

* feat(system table) #25184 : Fixing code to make POST method both save and update a key/value pair.

* Updating the Postman test to include a new scenario.

* Implementing SonarQube feedback

* Reverting odd change in "_collection_link" attribute.

* fix(core): Autocomplete dropdown button missplaced

* chore(edit-content): Add missing tests for multiselect field

* feat(core): Add new containers portlet and make old legacy (#26574)

* fix(edit-content): Margin and Padding of Columns and Fields #26564

* Edit Contentlet: Allow File Preview (#26470)

* dev: create file preview component

* dev: filew preview v1

* dev: get data preview from binary field response

* dev: show preview from tempAPI

* dev: let user edit images

* test: fix current test suit v1

* dev: tests & clean up

* test

* test: fix DotDropZoneComponent tests

* dev: fix SonarQube Warnings

* dev: fix binary field build

* dev: fix storybook

* styles: responsive design for preview

* clean up

* docs: document components methods

* feedback v1

* feedback v2

* feedback: pupdate tests v3

* feedback: remove CoreWebService from DotLicenseService

* clean up

* feedback: fix typo

* clean up

* clean up styles

* clean up

* fix: add publish and unpublish date (#25233)

* #25233 changed to add  only new field publish_date

* feat(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188 (#26350)

* fix(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188

* Implementing SonarQube feedback.

* Implementing SonarQube feedback.

* Fixing test class name.

* Issue #26425: Support Multi lang when include MultiTree Contentlet inside a Bundle (#26438)

* feat(core): Multi Metadata Provider/Chainable Metadata Provider #24307

* feat(chainable metadata provider) : #24307 Introducing the composite chainable storage provider

* Fixing Integration Tests

* Implementing SonarQube feedback and fixing Integration Tests

* #24307 adding just a comment

* Fixing name as it said "4040" instead of "404"

* #24307 adding more test

* Fixing compile error in test.

* #24307 adding test for dotconnect

* Implementing SonarQube feedback.

---------

Co-authored-by: jdotcms <[email protected]>

* #26271 [UI] Text in experiment data results needs be aligned (#26578)

* reduce decimals in graphic labels

* test

* keep two decimlas

* chore(test): Edit Content: Create Tests for Utils Functions #26559

* dev (function utils): add test cases and clean up

* dev (function utils spec): enhance logging

* dev (function utils): enhance test cases

* dev (function utils): enhance test cases

* fix (function utils test): make date test bulletproof

* fix: add publish and unpublish date (#25233)

* feat(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188 (#26350)

* fix(content cleanup) : Automatically prune File Asset versions exceeding a configurable limit #26188

* Implementing SonarQube feedback.

* Implementing SonarQube feedback.

* Fixing test class name.

* feat(core): Multi Metadata Provider/Chainable Metadata Provider #24307

* feat(chainable metadata provider) : #24307 Introducing the composite chainable storage provider

* Fixing Integration Tests

* Implementing SonarQube feedback and fixing Integration Tests

* #24307 adding just a comment

* Fixing name as it said "4040" instead of "404"

* #24307 adding more test

* Fixing compile error in test.

* #24307 adding test for dotconnect

* Implementing SonarQube feedback.

---------

Co-authored-by: jdotcms <[email protected]>

* fix: add publish and unpublish date (#25233)

* #25233 : revert changes in mssql schema

* #25233: reindex content with new publish_date column values populated

* #25233 removed calls to api to reindex content

* #25233 Renamed upgrade task to use appropriate date

---------

Co-authored-by: KevinDavilaDotCMS <[email protected]>
Co-authored-by: Freddy Rodriguez <[email protected]>
Co-authored-by: Arcadio Quintero <[email protected]>
Co-authored-by: Freddy Montes <[email protected]>
Co-authored-by: Jalinson Diaz <[email protected]>
Co-authored-by: Rafael Velazco <[email protected]>
Co-authored-by: Victor Alfaro <[email protected]>
Co-authored-by: Jose Castro <[email protected]>
Co-authored-by: Will Ezell <[email protected]>
Co-authored-by: Manuel Rojas <[email protected]>
Co-authored-by: Daniel Enrique Colina Rodríguez <[email protected]>
Co-authored-by: daniel.colina <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Fabrizzio Araya <[email protected]>
Co-authored-by: Daniel Silva <[email protected]>
Co-authored-by: freddyDOTCMS <[email protected]>
Co-authored-by: Jonathan <[email protected]>
Co-authored-by: Nikola Trajkovic <[email protected]>
Co-authored-by: Nikola <[email protected]>
Co-authored-by: Humberto Morera <[email protected]>
Co-authored-by: erickgonzalez <[email protected]>
Co-authored-by: AndreyDotcms <[email protected]>
  • Loading branch information
1 parent afc9e24 commit 2eff4cc
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 38 deletions.
5 changes: 3 additions & 2 deletions dotCMS/src/integration-test/java/com/dotcms/MainSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
import com.dotmarketing.startup.runonce.Task230523CreateVariantFieldInContentletIntegrationTest;
import com.dotmarketing.startup.runonce.Task230701AddHashIndicesToWorkflowTablesTest;
import com.dotmarketing.startup.runonce.Task230713IncreaseDisabledWysiwygColumnSizeTest;
import com.dotmarketing.startup.runonce.Task231109AddPublishDateToContentletVersionInfoTest;
import com.dotmarketing.startup.runonce.Task231030DropReleaseTableTest;
import com.dotmarketing.util.HashBuilderTest;
import com.dotmarketing.util.ITConfigTest;
Expand Down Expand Up @@ -662,8 +663,8 @@
DropOldContentVersionsJobTest.class,
ITConfigTest.class,
DotConnectTest.class,
Task231030DropReleaseTableTest.class

Task231030DropReleaseTableTest.class,
Task231109AddPublishDateToContentletVersionInfoTest.class
})

public class MainSuite {
Expand Down
4 changes: 3 additions & 1 deletion dotCMS/src/integration-test/java/com/dotcms/MainSuite2b.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
import com.dotmarketing.startup.runonce.Task230328AddMarkedForDeletionColumnTest;
import com.dotmarketing.startup.runonce.Task230426AlterVarcharLengthOfLockedByColTest;
import com.dotmarketing.startup.runonce.Task230523CreateVariantFieldInContentletIntegrationTest;
import com.dotmarketing.startup.runonce.Task231109AddPublishDateToContentletVersionInfoTest;
import com.dotmarketing.startup.runonce.Task230701AddHashIndicesToWorkflowTablesTest;
import com.dotmarketing.startup.runonce.Task230707CreateSystemTableTest;
import com.dotmarketing.startup.runonce.Task230713IncreaseDisabledWysiwygColumnSizeTest;
Expand Down Expand Up @@ -321,7 +322,8 @@
SiteViewPaginatorIntegrationTest.class,
Task230523CreateVariantFieldInContentletIntegrationTest.class,
DropOldContentVersionsJobTest.class,
Task231030DropReleaseTableTest.class
Task231030DropReleaseTableTest.class,
Task231109AddPublishDateToContentletVersionInfoTest.class
})

public class MainSuite2b {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.context.Context;
import org.apache.velocity.context.InternalContextAdapterImpl;
Expand Down Expand Up @@ -3235,11 +3238,18 @@ public void publish() throws DotDataException, DotSecurityException {
contentletAPI.publish(contentlet, user, false);

//Verify if it was published
Boolean isLive = APILocator.getVersionableAPI().isLive(contentlet);
final boolean isLive = APILocator.getVersionableAPI().isLive(contentlet);

//Validations
assertNotNull(isLive);
assertTrue(isLive);

final Optional<ContentletVersionInfo> versionInfo = APILocator.getVersionableAPI()
.getContentletVersionInfo(contentlet.getIdentifier(),
contentlet.getLanguageId(), contentlet.getVariantId());
final Date publishDate = versionInfo.map(ContentletVersionInfo::getPublishDate).orElse(null);
assertNotNull(publishDate);

}

/**
Expand Down Expand Up @@ -3307,6 +3317,7 @@ public void unpublish() throws DotDataException, DotSecurityException {
//Validations
assertNotNull(isLive);
assertFalse(isLive);

}

/**
Expand Down Expand Up @@ -8327,4 +8338,43 @@ public void publichWithToDifferentVarianst() throws DotDataException {
}
}
}

/**
* Method to test: {@link ESContentletAPIImpl#publish(Contentlet, User, boolean)}
* When: You have live and not live contentlets
* Should: Update publish_date when contentlet is published
*/
@Test
public void getMostRecentPublishedContent() throws Exception {
final ContentType contentType = new ContentTypeDataGen().nextPersisted();
final String contentTypeVarName = contentType.variable();

// publish contentlet
final ContentletDataGen contentletDataGen = new ContentletDataGen(contentType);
final Contentlet publishedContentlet = contentletDataGen.nextPersisted();
ContentletDataGen.publish(publishedContentlet);
final String contentInode = publishedContentlet.getInode();
contentletDataGen.nextPersisted();
contentletDataGen.nextPersisted();

// query published contentlet in the last half hour
final Date currentDate = new Date();
final FastDateFormat datetimeFormat = FastDateFormat.getInstance(
"yyyy-MM-dd't'HH:mm:ssZ", APILocator.systemTimeZone());
final String currentDateForQuery = datetimeFormat.format(currentDate);

final Date currentDateLessHalfHour = DateUtils.addMinutes(currentDate, -30);
final String currentDateLessHalfHourForQuery = datetimeFormat.format(currentDateLessHalfHour);

final Contentlet mostRecentPublishedContent = contentletAPI.search(
String.format( "+contentType:%s +sysPublishDate:[%s TO %s]",
contentTypeVarName, currentDateLessHalfHourForQuery, currentDateForQuery),
-1, 0, "", user, false)
.stream()
.findFirst()
.orElse(null);

assertNotNull(mostRecentPublishedContent);
assertEquals(contentInode, mostRecentPublishedContent.getInode());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.dotmarketing.startup.runonce;

import com.dotcms.util.IntegrationTestInitService;
import com.dotmarketing.common.db.DotDatabaseMetaData;
import com.dotmarketing.db.DbConnectionFactory;
import com.dotmarketing.db.LocalTransaction;
import org.junit.BeforeClass;
import org.junit.Test;

import java.sql.Connection;
import java.sql.SQLException;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class Task231109AddPublishDateToContentletVersionInfoTest {

@BeforeClass
public static void publishDateColumnExists() throws Exception {
IntegrationTestInitService.getInstance().init();
LocalTransaction.wrap(Task231109AddPublishDateToContentletVersionInfoTest::dropPublishDateColumnIfExists);
}

private static void dropPublishDateColumnIfExists() {
try {
final Connection connection = DbConnectionFactory.getConnection();
final DotDatabaseMetaData databaseMetaData = new DotDatabaseMetaData();
final boolean publishColumnExists = databaseMetaData.hasColumn(
"contentlet_version_info", "publish_date");
if (publishColumnExists) {
databaseMetaData.dropColumn(connection,
"contentlet_version_info", "publish_date");
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
}

@Test
public void testExecuteUpgrade() throws Exception {

final Task231109AddPublishDateToContentletVersionInfo task231109AddPublishDateToContentletVersionInfo =
new Task231109AddPublishDateToContentletVersionInfo();
final DotDatabaseMetaData databaseMetaData = new DotDatabaseMetaData();

// check that the column doesn't exist before the upgrade
final boolean columnExists = databaseMetaData.hasColumn(
"contentlet_version_info", "publish_date");
assertFalse(columnExists);

// execute upgrade and check if the column exists after the upgrade
assertTrue(task231109AddPublishDateToContentletVersionInfo.forceRun());

LocalTransaction.wrap(task231109AddPublishDateToContentletVersionInfo::executeUpgrade);

final boolean columnExistsAfterUpgrade = databaseMetaData.hasColumn(
"contentlet_version_info", "publish_date");
assertTrue(columnExistsAfterUpgrade);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -407,30 +407,19 @@ public Map<String,Object> toMap(final Contentlet contentlet) throws DotMappingEx


final String publishDateVar = contentType.publishDateVar();
if(UtilMethods.isSet(publishDateVar) && UtilMethods.isSet(contentlet.getDateProperty(publishDateVar))) {
contentletMap.put(ESMappingConstants.PUBLISH_DATE,
publishExpireESDateTimeFormat.get().format(contentlet.getDateProperty(publishDateVar)));
contentletMap.put(ESMappingConstants.PUBLISH_DATE + TEXT,
datetimeFormat.format(contentlet.getDateProperty(publishDateVar)));
}else {
contentletMap.put(ESMappingConstants.PUBLISH_DATE,
publishExpireESDateTimeFormat.get().format(dateOufOfRange));
contentletMap.put(ESMappingConstants.PUBLISH_DATE + TEXT,
datetimeFormat.format(dateOufOfRange));
}
final Date publishDate = UtilMethods.isSet(publishDateVar) ?
contentlet.getDateProperty(publishDateVar) : null;
loadDateTimeFieldValue(contentletMap,
ESMappingConstants.PUBLISH_DATE, publishDate);

final String expireDateVar = contentType.expireDateVar();
if(UtilMethods.isSet(expireDateVar) && UtilMethods.isSet(contentlet.getDateProperty(expireDateVar))) {
contentletMap.put(ESMappingConstants.EXPIRE_DATE,
publishExpireESDateTimeFormat.get().format(contentlet.getDateProperty(expireDateVar)));
contentletMap.put(ESMappingConstants.EXPIRE_DATE + TEXT,
datetimeFormat.format(contentlet.getDateProperty(expireDateVar)));
}else {
contentletMap.put(ESMappingConstants.EXPIRE_DATE,
publishExpireESDateTimeFormat.get().format(dateOufOfRange));
contentletMap.put(ESMappingConstants.EXPIRE_DATE + TEXT,
datetimeFormat.format(dateOufOfRange));
}
final Date expireDate = UtilMethods.isSet(expireDateVar) ?
contentlet.getDateProperty(expireDateVar) : null;
loadDateTimeFieldValue(contentletMap,
ESMappingConstants.EXPIRE_DATE, expireDate);

loadDateTimeFieldValue(contentletMap,
ESMappingConstants.SYS_PUBLISH_DATE, versionInfo.get().getPublishDate());

contentletMap.put(ESMappingConstants.VERSION_TS, elasticSearchDateTimeFormat.format(versionInfo.get().getVersionTs()));
contentletMap.put(ESMappingConstants.VERSION_TS + TEXT, datetimeFormat.format(versionInfo.get().getVersionTs()));
Expand Down Expand Up @@ -999,6 +988,28 @@ private final Map<String,Object> keyValueMap(final Object valueObj){
return KeyValueFieldUtil.JSONValueToHashMap((String) valueObj);
}

/**
* This method loads a date/time field into the map to be included in the ES index.
* @param contentletMap Map to be populated with the date/time field
* @param fieldName Name of the field to be populated
* @param dateValue Value of the date/time field
* If the value is null, the field will be populated with a date out of range
*/
private void loadDateTimeFieldValue(final Map<String, Object> contentletMap,
final String fieldName, final Date dateValue) {
if (UtilMethods.isSet(dateValue)) {
contentletMap.put(fieldName,
publishExpireESDateTimeFormat.get().format(dateValue));
contentletMap.put(fieldName + TEXT,
datetimeFormat.format(dateValue));
} else {
contentletMap.put(fieldName,
publishExpireESDateTimeFormat.get().format(dateOufOfRange));
contentletMap.put(fieldName + TEXT,
datetimeFormat.format(dateOufOfRange));
}
}

public String toJsonString(Map<String, Object> map) throws IOException{
return mapper.writeValueAsString(map);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private ESMappingConstants(){}
public static final String PUBLISH_DATE = "pubdate";
public static final String EXPIRE_DATE = "expdate";
public static final String VERSION_TS = "versionTs";
public static final String SYS_PUBLISH_DATE = "sysPublishDate";
public static final String URL_MAP = "urlMap";
public static final String VANITY_URL = "vanityUrl";
public static final String CATEGORIES = "categories";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import com.dotcms.util.ConversionUtils;
import com.dotcms.util.transform.DBTransformer;
import com.dotcms.variant.VariantAPI;
import com.dotmarketing.portlets.contentlet.model.Contentlet;
import com.dotmarketing.portlets.contentlet.model.ContentletVersionInfo;
import com.dotmarketing.util.UtilMethods;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -47,6 +45,7 @@ private static ContentletVersionInfo transform(Map<String, Object> map) {
versionInfo.setLockedOn((Date) map.get("locked_on"));
versionInfo.setVersionTs((Date) map.get("version_ts"));
versionInfo.setVariant(map.get("variant_id").toString());
versionInfo.setPublishDate((Date) map.get("publish_date"));
return versionInfo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public void removeLive (final Contentlet contentlet ) throws DotDataException, D
}
final ContentletVersionInfo newInfo = Sneaky.sneak(()-> (ContentletVersionInfo) BeanUtils.cloneBean(contentletVersionInfo.get())) ;
newInfo.setLiveInode( null );
newInfo.setPublishDate(null);
versionableFactory.saveContentletVersionInfo( newInfo, true );
}

Expand Down Expand Up @@ -498,6 +499,7 @@ public void setLive ( final Versionable versionable ) throws DotDataException, D
}
final ContentletVersionInfo newInfo = Sneaky.sneak(()-> (ContentletVersionInfo) BeanUtils.cloneBean(info.get())) ;
newInfo.setLiveInode(versionable.getInode());
newInfo.setPublishDate(new Date());
versionableFactory.saveContentletVersionInfo( newInfo, true );
} else {

Expand Down Expand Up @@ -733,6 +735,13 @@ public void saveContentletVersionInfo(final ContentletVersionInfo contentletVers
contentletVersionInfo.getLang(), contentletVersionInfo.getVariant());

if(contentletVersionInfoInDB.isEmpty()) {
if (UtilMethods.isSet(contentletVersionInfo.getLiveInode())
&& !UtilMethods.isSet(contentletVersionInfo.getPublishDate())) {
contentletVersionInfo.setPublishDate(
UtilMethods.isSet(contentletVersionInfo.getVersionTs()) ?
contentletVersionInfo.getVersionTs() :
new Date());
}
versionableFactory.saveContentletVersionInfo(contentletVersionInfo, true);
} else {
final ContentletVersionInfo info = contentletVersionInfoInDB.get();
Expand All @@ -741,6 +750,7 @@ public void saveContentletVersionInfo(final ContentletVersionInfo contentletVers
info.setLockedBy(contentletVersionInfo.getLockedBy());
info.setLockedOn(contentletVersionInfo.getLockedOn());
info.setWorkingInode(contentletVersionInfo.getWorkingInode());
info.setPublishDate(contentletVersionInfo.getPublishDate());
versionableFactory.saveContentletVersionInfo(info, true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import com.dotcms.repackage.com.google.common.annotations.VisibleForTesting;
import com.dotcms.util.transform.TransformerLocator;
import com.dotcms.variant.VariantAPI;
import com.dotcms.variant.model.Variant;
import com.dotmarketing.beans.Identifier;
import com.dotmarketing.beans.Inode;
Expand Down Expand Up @@ -53,8 +52,8 @@ public class VersionableFactoryImpl extends VersionableFactory {
TemplateAPI templateApi = null;

private static final String CREATE_CONTENTLET_VERSION_INFO_SQL = "INSERT INTO contentlet_version_info (identifier, lang, working_inode, deleted, locked_by, locked_on, version_ts, variant_id) VALUES (?,?,?,?,?,?,?, ?)";
private static final String INSERT_CONTENTLET_VERSION_INFO_SQL = "INSERT INTO contentlet_version_info (identifier, lang, working_inode, live_inode, deleted, locked_by, locked_on, version_ts, variant_id) VALUES (?,?,?,?,?,?,?,?,?)";
private static final String UPDATE_CONTENTLET_VERSION_INFO_SQL = "UPDATE contentlet_version_info SET working_inode=?, live_inode=?, deleted=?, locked_by=?, locked_on=?, version_ts=? WHERE identifier=? AND lang=? AND variant_id = ?";
private static final String INSERT_CONTENTLET_VERSION_INFO_SQL = "INSERT INTO contentlet_version_info (identifier, lang, working_inode, live_inode, deleted, locked_by, locked_on, version_ts, variant_id, publish_date) VALUES (?,?,?,?,?,?,?,?,?,?)";
private static final String UPDATE_CONTENTLET_VERSION_INFO_SQL = "UPDATE contentlet_version_info SET working_inode=?, live_inode=?, deleted=?, locked_by=?, locked_on=?, version_ts=?, publish_date=? WHERE identifier=? AND lang=? AND variant_id = ?";

/**
* Default class constructor.
Expand Down Expand Up @@ -535,6 +534,7 @@ protected void saveContentletVersionInfo(ContentletVersionInfo cvInfo, boolean u
dotConnect.addParam(cvInfo.getLockedOn());
dotConnect.addParam(cvInfo.getVersionTs());
dotConnect.addParam(cvInfo.getVariant());
dotConnect.addParam(cvInfo.getPublishDate());
dotConnect.loadResult();
} else {
dotConnect.setSQL(UPDATE_CONTENTLET_VERSION_INFO_SQL);
Expand All @@ -544,6 +544,7 @@ protected void saveContentletVersionInfo(ContentletVersionInfo cvInfo, boolean u
dotConnect.addParam(cvInfo.getLockedBy());
dotConnect.addParam(cvInfo.getLockedOn());
dotConnect.addParam(cvInfo.getVersionTs());
dotConnect.addParam(cvInfo.getPublishDate());
dotConnect.addParam(cvInfo.getIdentifier());
dotConnect.addParam(cvInfo.getLang());
dotConnect.addParam(cvInfo.getVariant());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.dotmarketing.beans.VersionInfo;
import com.dotmarketing.util.UtilMethods;
import java.io.Serializable;
import java.util.Date;

public class ContentletVersionInfo extends VersionInfo implements Serializable {
private static final long serialVersionUID = 8952464908349482530L;
Expand All @@ -12,6 +13,8 @@ public class ContentletVersionInfo extends VersionInfo implements Serializable {

private String variant;

private Date publishDate;

public String getVariant() {
return UtilMethods.isSet(variant) ? variant : VariantAPI.DEFAULT_VARIANT.name();
}
Expand All @@ -20,14 +23,21 @@ public void setVariant(final String variant) {
this.variant = variant;
}


public long getLang() {
return lang;
}
public void setLang(long lang) {
this.lang = lang;
}

public Date getPublishDate() {
return publishDate;
}

public void setPublishDate(Date publishDate) {
this.publishDate = publishDate;
}

@Override
public boolean equals(Object obj) {
if(obj instanceof ContentletVersionInfo) {
Expand Down
Loading

0 comments on commit 2eff4cc

Please sign in to comment.