info.magnolia.dam.setup.migration
Class MoveDataWorkspaceToDamMigrationTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.AbstractRepositoryTask
          extended by info.magnolia.dam.setup.migration.MoveDataWorkspaceToDamMigrationTask
All Implemented Interfaces:
info.magnolia.module.delta.Task

public class MoveDataWorkspaceToDamMigrationTask
extends info.magnolia.module.delta.AbstractRepositoryTask

Migrate Data from a Specified Data repository to DAM.
Let say that you have the following Data Structure:

 dms / site1 / image / video / mp4 / mp3 / audio / site2 / image / audio / video
 
By defining the following input arguments:
 originalPathsList = ["site1/image","site1/video/mp4","site2"]
 targetSubPath = "data". If null, no subPath will be added.
 dataRepository = "dms"
The Migration task will create the following structure into the dam repository:
 dam / data / site1 / image / video / mp4 / site2 / image / audio / video
 
If a dam folder with the same name already exist, folders will be merged.


Field Summary
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING
 
Constructor Summary
MoveDataWorkspaceToDamMigrationTask(String taskName, String taskDescription, List<String> originalPathsList, String targetSubPath, String dataRepository)
          Default constructor.
 
Method Summary
protected  void copyNodesFromDataRepositoryToDam(String dataPath, String targetSubPath)
          Copy all nodes from DATA to DAM workspace.
 void doExecute(info.magnolia.module.InstallContext ctx)
           
 
Methods inherited from class info.magnolia.module.delta.AbstractRepositoryTask
execute
 
Methods inherited from class info.magnolia.module.delta.AbstractTask
getDescription, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoveDataWorkspaceToDamMigrationTask

public MoveDataWorkspaceToDamMigrationTask(String taskName,
                                           String taskDescription,
                                           List<String> originalPathsList,
                                           String targetSubPath,
                                           String dataRepository)
Default constructor.

Method Detail

doExecute

public void doExecute(info.magnolia.module.InstallContext ctx)
               throws info.magnolia.module.delta.TaskExecutionException
Specified by:
doExecute in class info.magnolia.module.delta.AbstractRepositoryTask
Throws:
info.magnolia.module.delta.TaskExecutionException

copyNodesFromDataRepositoryToDam

protected void copyNodesFromDataRepositoryToDam(String dataPath,
                                                String targetSubPath)
                                         throws info.magnolia.module.delta.TaskExecutionException
Copy all nodes from DATA to DAM workspace. Step: Copy from the DATA to DAM workspace in a tmp folder. Merge the TMP folder into the final location.

Throws:
info.magnolia.module.delta.TaskExecutionException


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.