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

Export & Import Templates #180

Open
srenault-meeds opened this issue Feb 4, 2025 · 7 comments
Open

Export & Import Templates #180

srenault-meeds opened this issue Feb 4, 2025 · 7 comments

Comments

@srenault-meeds
Copy link
Member

srenault-meeds commented Feb 4, 2025

Rationale

The Meeds product offers to create templates of different types: apps, sections, pages, sites, spaces.
It is convenient when working inside a same platform to ease the process of creating pages, sites, spaces.

However, currently, when a consultant or an admin want to reuse something previously worked on PlatformA on another PlatformB, the only solution is creating from zero.

This MIP will try to solve this by providing new options to export templates to be imported in the same platform or in another platform.

1. Functional Requirements

Top User Stories

Generic Business Logic

1. Content type available for export / import

  • Instances
  • Section templates
  • Page templates
  • Site templates
  • Space templates

2. Permission to export/import
For any content type, only platform admins can access these options of exporting / importing templates.

3. Data to export
For any content type, when exporting it:

  • characteristics (name, description, icon, preview), portlet preferences and data will be duplicated
  • the user is aware about what of what will be exported

Precisions: Configuration, permissions, category will not be exported
By default, permissions will be set to admins (for space templates, for page permissions).

Example of the space template for example:

Image

  • a .zip is created and uploaded in the file explorer as requested to the user

4. Ability to export multiple items

A multiselection option will be added to each template so the admin can multiselect items to export.
In addition, this multiselection will provide a quick way to delete multiple items (after confirming this deletion of course).

Image

4. Access to import option
To import it, when requesting to add a template, the user is invited to choose between creating a new one or importing an existing one.

A check will be done to ensure this is a page template I am importing to page templates list, and not a space template.

Image

5. UX to import
When requesting to import a template

  • user has to choose the .zip file in the file explorer of his device
  • once selected, it is possible to change it
  • once selected, it is possible to request to replace existing item (in case of same name) or to duplicate if already existing
Image

Precision
When importing instances, a suggestion to select a destination will be provided so the admin can import these instances into a category. This selection is mandatory.

Image

6. Import process
When importing, then the process is displayed to the user to understand what is going on

  • a check is done to make sure this is a template to import (to avoid importing something not a template)
  • for each, same steps: characteristics, default conf, permissions, layout & navigation
  • If the user close the drawer or the window, then the import is cancelled
Image

Once done, the item is added to the list from where it has been added.

Type of content to import/export

Following items can be imported and for each, identified data is exported/imported:

  1. Instance (App):
    • Name, description, instance
    • Permission will be set to admins by default
    • Preview
    • Data: image, icon, text
    • Preferences: settings & display (margins, background, text style, radius, border)
  2. Page template
    • Name, description
    • Preview
    • Layout Data: image, text, icon
    • Layout Preferences: settings & display (margins, background, text style, radius, border, mobile view)
  3. Section template
    • Name, description
    • Preview
    • Layout Data: image, text, icon
    • Layout Preferences: settings & display (margins, background, text style, radius, border, mobile view)
  4. Space template
    • Name, description, icon
    • Permission will be set to admins by default
    • Layout Data: image, text, icon
    • Layout Preferences: settings & display (margins, background, text style, radius, border, mobile view)
  5. Site template
    • Name, description, icon
    • Preview
    • Permission of site navigation will be set to admins by default
    • Layout Data: image, text, icon
    • Layout Preferences: settings & display (margins, background, text style, radius, border, mobile view)

Impacts

Gamification

NA

Notifications

NA

Analytics

NA

Unified Search

NA

2. Technical Requirements

Expected Volume & Performance

N/A

Security

The export and import operations has to be restricted to administrators only.

Extensibility

Each addon should be able to define which data to export when exporting an Object identified by its type and id.

Configurability

N/A

Upgradability

N/A

Existing Features

No change on existing features, expect adding the buttons to export and import data.

Feature Flags

N/A

Other Non Functional Requirements

Use of Spring Beans and Rest endpoints rather than Kernel and WS based components.

3. Software Architecture

Security

Knowing that export/import buttons will be embedded inside admin portlets, thus no UI check on permissions is needed. But, on REST endpoints, only administrators can trigger an export/import operation.

Access

A new endpoint should be added in order to manage exporting space templates and layout objects. Thus, the Export API Rest Endpoint should be mapped in Social with path: /social/rest/databind.

Services & processing

A new API has to be implemented in order to export and import data of any type.
The Service API will be similar to the following methods:

public File serialize(String objectType, String objectId) throws ObjectNotFoundException;

public Report deserialize(String uploadId, boolean replaceExisting);

Multiple data bind (serialization + deserialization) plugins can handle one single Object (type/id). In fact, for space templates, by example, the social will export Space Template properties and the layout addon will export the associated pages and navigations. Thus, each plugin will append the content to export inside a single Zip file rather than providing the files content to include.

For the Layout data bind, a PortletInstancePreferencePlugin will be added for IDE widgets in order to generate portlet preferences holding the Widget Data, similar to ImagePortletInstancePreferencePlugin, LinkPortletInstancePreferencePlugin... This Portlet Preference will be processed and stored as a widget once displayed in UI (in View or Layout Editor Mode).

The exported ZIP file will be structured based on content type. For example, an export for a site template will include a subfolder for pages containing the site's exported pages.

@github-project-automation github-project-automation bot moved this to Open in MIP Board Feb 4, 2025
@srenault-meeds srenault-meeds moved this from Open to Submitted in MIP Board Feb 4, 2025
@srenault-meeds
Copy link
Member Author

@margondicco if you can take a look at it please. Thanks

@margondicco
Copy link

Hello Go Fonc with one precision : group or category could not be exported

@srenault-meeds
Copy link
Member Author

Hello, after few discussions, I will review a little the MIP. I will let you know

@srenault-meeds
Copy link
Member Author

Hello, MIP Functional specifications have been reviewed. Can you check again please @margondicco

@margondicco
Copy link

Hello Go Fonc

@AzmiTouil
Copy link

Ready for tech spec review by DAO members (eXo: @rdenarie )

@rdenarie
Copy link
Member

Go tech

@boubaker boubaker moved this from Submitted to Accepted in MIP Board Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Accepted
Development

No branches or pull requests

5 participants