Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-70591

Prevent data loss when managing Adaptive Media Images

    Details

      Description

      Motive

      The process of creating different variants of the images with different resolutions is something that it can take a lot of server time to process those images. Because of this, the action of deleting an already existing configuration can be dangerous if done by mistake because it can take a lot of time to get back to the original situation with the images generated.

      In order to avoid this misusage that could lead to important data loss that it can take a long time to recover, we have decided that we will create an intermediate step in the deletion process. Portal Admins will now have to first disable the configuration before they can actually delete it.

      This intermediate step allows portal administrators to easily restore the behaviour by enabling the configuration. Both disabling and enabling configurations are actions that don't have a performance penalty on the server and there's not data loss because the images are still there although they might not be used while they remain disabled.

      When a particular configuration is disabled, the adaptive images for that configuration cannot be used and won't be accessible, so they will behave as if they were deleted, but they are not.

      When a new image is uploaded it will only create variants based on the active configurations. This means that if a configuration is disabled, an adaptive media image for that configuration won't be created. Then, when enabling a previously disabled configuration, portal administrators might need to regenerate the adaptive images that were not created during the time the configuration was disabled.

      Portal Administrators can delete disabled configurations. This action will actually remove all the images generated for that specific configuration. This action cannot be easily recover. In order to recover for this action, the portal administrator will need to create a new configuration with the exact same information as the old configuration and he will need to regenerate all the images as explained in LPS-69533.

      Acceptance Criteria

      • Portal administrators *cannot* delete *enabled* adaptive media images configurations
      • Portal administrators can disable adaptive media images configuration. This action won't delete any of the images generated for this configuration.
      • Portal administrators can enable disabled adaptive media images configuration. This action won't regenerate any of the images for this configuration.
      • Portal administrators *can* delete *disabled* adaptive media images configuration. This action will delete all the images generated for that configuration.
      • When adding a new configuration it will be enabled automatically.
      • There is no way 2 configurations can have the same name, no matter if they are disabled or not.
      • Disabled configurations will behave as if they were not available in the Portal. This means that:
      • 1. Disabled adaptive media images configuration won't generate adaptive media images when a new image is uploaded.
      • 2. URLs pointing at an image whose image configuration is disabled will behave as if the image was not present.
      • 3. The APIs (REST and JAVA) will need to take into account the state (enable/disable) of the configurations in order to return the most appropriate results. It might interesting that by default, in case of search for the best image with a specific width, we only return the images whose configuration is enabled.

      Use cases

      Main Scenario: A portal admin wants to delete an Image Resolution

      1. The user interacts with Adaptive Media in Control Panel > Configuration
      2. Disables a resolution
      3. Tries to delete it

      Expected: Firstly the image resolution selected changes to disabled state and all the images generated are deleted when the user confirms that wants its deletion.

      Considerations

      • Adaptive Media App is installed previously.

      User Experience

      Summary

      1. Resolution item have new states (Enabled, Disabled)

      Interaction

      Behavior

      Resolution Item List

      • Default Filtered by "All"
      • Ordered by Descending "State" (Enabled First, Disabled Second)

      Resolution Item

      • Actions: "Edit", "Enable/Disable", "Optimize Remaining" and "Delete".
      • When a new Resolution is created its default state is Enabled.

      STATES
      Enabled State

      • "Edit", "Disable" and "Optimize Remaining" actions are enabled.
      • Optimize Remaining action is disabled if the optimization progress has reached 100%.

      Disabled State

      • "Edit", "Enable" and "Delete" actions are enabled.
      • If a user deletes an item, a browser warning popup appears following the existing pattern in the platform when an item is deleted. When the user confirm to delete the item, a success alert is shown to give feedback.

      Progress Bar

      • The progress bar changes to its disabled visual state when an Image Resolution has disabled.

      Interactive prototype

      URL: http://vbs8wh.axshare.com

      Design

      Image Resolutions

      Disabled Visual Status

      Documentation

      Here's a link to the documentation draft https://docs.google.com/a/liferay.com/document/d/18S4kEd0QoTlLjZ517HX4X12k5svr9zLKroyIvx4OPPA/edit?usp=drive_web

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              patricia.perez Patricia Perez
              Reporter:
              sergio.gonzalez Sergio Gonzalez (Inactive)
              Recent user:
              Kiyoshi Lee
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  7.0.0 M6