[MGNLCT-35] Reuse existing system to support rename workspace Created: 18/May/18  Updated: 21/Aug/18  Resolved: 07/Jun/18

Status: Closed
Project: Content Types
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Task Priority: Neutral
Reporter: Oanh Thai Hoang Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 6d 1h
Original Estimate: Not Specified

Issue Links:
causality
is causing MGNLCT-42 Data migration upon workspace definit... Open
relation
is related to MGNLCT-9 Reuse automatic workspace creation Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Content types foundation
Sprint: Saigon 146, Saigon 147
Story Points: 5

 Description   

Solution: We can rename logical workspace. All workspace names are viewed in GUI are logical name (not physical name). See one example is https://git.magnolia-cms.com/projects/PLATFORM/repos/ce/browse/magnolia-empty-webapp/src/main/webapp/WEB-INF/config/default/repositories.xml#74-78.

So we don't need to rename physical name, just rename logical and we already have all API to access, get, retrieve with logical name.



 Comments   
Comment by Oanh Thai Hoang [ 18/May/18 ]

POC for renaming workspace is pushed to branch main and content-type

Comment by Oanh Thai Hoang [ 18/May/18 ]

Follow up ticket is created

Comment by Oanh Thai Hoang [ 25/May/18 ]

Firstly, think about the usage of rename or delete workspace.

Pros:

  • Update (rename/delete) workspace seem to help user rename workspace when they are in development mode. For the production mode, it hardly see this case.
  • Convenient: User don't need to delete, rename workspace in their own hand because jackrabbit does not support to rename or delete API

Cons

  • Data migration: big changes-> We really don't know workspace is defined/used anywhere except resource and config. They can hardly use workspace name in java class (like magnolia create workspace constant and use it) and of course you can't change their java class
  • Let think of workspace has giga data byte, do you confident to support client to delete it if you don't really know exactly where to find it ( ftl file, observation util, java class....) 
Comment by Oanh Thai Hoang [ 25/May/18 ]

1. Solution of rename workspace by rename alias:

  • Can reuse on the info.magnolia.repository.definition.WorkspaceMappingDefinition to define logicalName and physicalName
  • Current workspace mappings does not save, it's initializing when start up and create new workspace so we need to store it somewhere

Where to define default mapping:

Where to initialize:

  • info.magnolia.repository.DefaultRepositoryManager#loadRepositories

Where to update mapping:

  • info.magnolia.repository.DefaultRepositoryManager#createWorkspace

2. Delete and create new workspace:

  • May use backup module to back up or export all data from that workspace (haven't check backup module) and user need to import again their data themselves and then delete workspace folder later

3. If we don't support update workspace so there are unnecessary workspaces in repo.

  • Provide Workspace Manager app to show workspace for user to delete. And user must responsible for their data if it used/config somewhere else.

 

Note: Jackrabbit does not have API for delete. We may create a script to delete workspace folder.

Generated at Mon Feb 12 00:36:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.