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

Export/Import of widgets in Fragment-based Pages

    Details

      Description

      Intro/Context:

      We'd like to have import and export capability for widget.

      When exporting a widget, the following information must be exported with it, so that it can be exported back:

      1. Widget identifier
      2. Permissions: a list of roles and the actions allowed for users with that role. We need to consider 4 types of roles:
        1. Regular
        2. Site
        3. Organization
        4. Team: The name/key of the team should be exported.
          1. On import, a team with the same name/key must exist in the site where the page is imported.
      3. Widget Configuration:  Each widget can have its own code to store and retrieve configuration. However most of them leverage the standard portlet preferences mechanism. Even in this case, though it's also worth noting that the names and values of the specific preferences for a widget might not want to be exposed when exporting. Considering this, it's necessary to provide:
        1. An extension point which allows widget developers to provide their own PortletConfigurationExporterImporter which can retrieve the configuration from its storage and transform it as desired before the export or import.
        2. A default implementation which obtains the configuration from portlet preferences and does not transformation. This implementation will be used for any widget without an specific PortletConfigurationExporterImporter
        3. We will provide implementations of PortletConfigurationExporterImporter for any out of the box widgets which require a transformation, for example to avoid exporting primary keys (which would be the case for Web Content Display, Asset Publisher, etc).
          1. Note: create sub-task to identify out of the box portlets that need transformation

      Note: When importing widget permissions, if a specific role is not found, then the permissions for it will be ignored. Ideally a message will be shown to the user such as: "Widget X had permissions assigned for role Y which has not been found, so those permissions have not been imported". This is a deviation from the general policy when importing pages consisting in always importing and not checking for existence. The reason why we have to make this exception is that there is no way to save the permissions for a role in Liferay if the role does not exist.

      Implementation Notes

      • Related to PortletConfigurationExporterImporter:
        • We need to think through if we want to have a single PortletConfigurationExporterImporter interface or it's better to split it in two.
        • PortletConfigurationExporterImporter should use JSON as the outside facing format, which is produced by the exporter and received by the importer.

      Test Scenarios

      Test Scenarios Test Strategy Kind of test Is it covered by FrontEnd ? (JS-Unit) Is it covered by BackEnd ? (unit or integration) Could it be covered by POSHI?
      The widgetInstanceId will be exported and imported with content page template Smoke Manual No Yes Yes
      The configuration of widgets will be exported and imported with master page template Smoke Manual No Yes Yes
      The displayed content in widgets will be exported and imported with content page template Sanity Manual TBD No Yes
      The Regular and Site Role permission settings of widgets will be exported and imported with content page template Smoke Manual No Yes Yes
      The Organization permission settings of widgets will be exported and imported with master page template Sanity Manual No No Yes
      The Team Role permission settings of widgets will be exported and imported with content page template Sanity Manual No No Yes
      The specific message will be shown when import content page template where the widget has permission settings for a Role if it doesn't exist in site Sanity Manual No No Yes
      Can export and import content page templates with widget configuration settings in Staging site Sanity Manual TBD TBD Yes

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              manoel.cyreno Manoel Cyreno
              Reporter:
              tarik.demnati Tarik Demnati
              Engineering Assignee:
              SE Support
              Recent user:
              Manoel Cyreno
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  Master