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

Redirect Manager : Add "Effective From" field #2977

Closed
3 tasks
thcharan opened this issue Oct 27, 2022 · 4 comments
Closed
3 tasks

Redirect Manager : Add "Effective From" field #2977

thcharan opened this issue Oct 27, 2022 · 4 comments
Assignees

Comments

@thcharan
Copy link

thcharan commented Oct 27, 2022

Required Information

@davidjgonzalez @YegorKozlov

This is not a bug, but a request for enhancement for Redirect Manager for (AEM-Cloud-Service).

  • AEM Version, including Service Packs, Cumulative Fix Packs, etc: AEM-as-a-Cloud Service
  • ACS AEM Commons Version: 5.0.4
  • Reproducible on Latest? yes

Expected Behavior

In the current state, we have the field "Redirect Until" which acts as an "Expiry Date" for the redirect.
In addition to above, it would be great to add an additional field "Effective From" which acts as "Redirect Go Live Date".
This really helps, where many campaign redirects are planned ahead of time, the redirect rules can be setup ahead of time and published with this effective date.
The servlet filter will only pick up this rule on once effective date is met. This will help automate the whole process of "setup ahead of time" and the redirect becomes automatically live on a future date.

Key Changes required -

  1. Add this new field in UI.
  2. Handle the conditional check in RedirectFilter -> handleRedirect()
@YegorKozlov
Copy link
Contributor

YegorKozlov commented Oct 27, 2022

@thcharan It is certainly doable.
The Edit Dialog is growing bigger and I wonder if we should split it into two tabs. The "Basic" tab will have "source", "target" and "status" fields. The "Advanced" tab will have the dates , etc.

Also, "Effective From" and "Redirect Until" are mutually exclusive. I'm thinking about a radio button to switch between two.
Or, may be, we should keep one date field and have a drop-down next to it with two options: Redirect Until (default) and Effective From.

@thcharan
Copy link
Author

thcharan commented Oct 27, 2022

@YegorKozlov -

Good idea, that't right. we should split that in to two tabs.

Effective Date and Redirect Until Date can always be used in combination, below are the use cases -

Case 1) An author can create a redirect rule where ( Effective Date = EMPTY and RedirectUntil Date = EMPTY ) and publishes the rule.
Expected behavior - The rule starts working from the moment it is published to the publish server and with no expiry.

Case 2) An author can create a redirect rule where ( Effective Date = FUTURE DATE and RedirectUntil Date = EMPTY ) and publishes the rule.
Expected behavior - The redirect rule will start working from the future date and with no expiry.

Case 3) An author can create a redirect rule where ( Effective Date = EMPTY and RedirectUntil Date = FUTURE DATE ) and publishes the rule.
Expected behavior - The rule starts working from the moment it is published to the publish server and stops working on the date of expiry.

Case 4) An author can create a redirect rule where ( Effective Date = FUTURE DATE and RedirectUntil Date = FUTURE DATE ) and publishes the rule.
Expected behavior - The rule starts working from the future date and stops working on the date of expiry.

Edge Cases -

Case 5) If an author creates a redirect rule where ( Effective Date = CURRENT DATE OR PAST DATE and RedirectUntil Date = EMPTY ) and publishes the rule.
Expected behavior - SAME as Case-1.

Case 6) If an author creates a redirect rule where ( Effective Date = EMPTY and RedirectUntil Date = PAST DATE OR CURRENT DATE ) and publishes the rule.
Expected behavior - The redirect will not work because it already met it's expiry, when the first request is handled by the RedirectFilter -> handleRedirect().

Pseudo logic -
handleRedirect () {
If (match != null) {
if (match expired OR match not yet active) {
return false;
} else {
// proceed with redirect logic
}
}

Hope that helps.

@YegorKozlov
Copy link
Contributor

@thcharan thanks for the use cases. I'll include them in junits.

@thcharan
Copy link
Author

@YegorKozlov Cool. :)

@YegorKozlov YegorKozlov changed the title Redirect Manager (AEM-Cloud-Service) Redirect Manager : Add "Effective From" field Nov 4, 2022
@YegorKozlov YegorKozlov self-assigned this Nov 4, 2022
YegorKozlov added a commit to YegorKozlov/acs-aem-commons that referenced this issue Nov 4, 2022
davidjgonzalez pushed a commit that referenced this issue Dec 21, 2022
* #2977 Redirect Manager : Add Effective From field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants