Environment Transfer Framework

Customers have multiple Product 360 installations for specific purposes. For example a test system and a productive system. Sometimes even a development system for customizing development. Changes are usually promoted from the development system to the test system and finally to the productive system. Those systems are not only necessary for customizing and new releases, but also for process changes, adjusting so called "environmental" data like user groups, permissions, export and import templates, workflows, data quality mapping, assortments and other "environmental aspects" of a fully fledged Product 360 application.

So far these objects can't be transferred from one system to the other besides copying the whole system including database. However, this is not a feasible approach since the productive system is actively being worked on and the database can not just be overwritten with data from the test system. That's why the environment transfer framework got introduced.

Overview

The environment transfer framework provides an extensible mechanism for extracting and integrating environmental data from one Product 360 installation to another by the desktop client.

The source and target system must have exactly the same Product 360 version in order to work correctly.

Execution

A user can access the according actions to extract or integrate objects in the "Management" menu of the Product 360 desktop client.

images/download/attachments/126588890/Environment_transfer.png

Permissions

Two new action rights have been introduced, "Integrate environmental data" and "Extract environmental data". Those permissions must be set for the respective user - otherwise the corresponding menu entries in the desktop client will not appear.

images/download/attachments/126588890/image2017-11-23_13_14_15.png

Extract environment

When choosing "Extract environment" of the menu entry, a user can select one or more elements, and press the "Extract" button.

images/download/attachments/126588890/image2017-11-23_14_15_4.png

In detail a server-side job will be triggered which calls all selected "transfer handlers" and executes them. All data will be accumulated into a project folder on the application server. The data from this project folder is being compressed into a zip archive and uploaded to the file storage "shared". The user can now download this archive either by pressing "Yes" on the dialog which opens as soon as the job is finished or by using the context menu in the process overview. The downloaded archive will be called "project" from now on.

images/download/attachments/126588890/image2017-11-23_14_22_40.png

images/download/attachments/126588890/image2017-11-23_14_24_29.png

Integrate environment

When choosing "Integrate environment" of the menu entry, the user can select one of the available projects on the server or upload a new project in the file storage of the server. From the chosen project the user can select the elements to integrate.

Only archives (projects) which have been created with the "Extract environment" step are valid.

images/download/attachments/126588890/image2017-11-23_14_26_32.png After pressing the "Integrate" button, a server job will be triggered which performs the integration by calling all selected "transfer handlers" and executing them.

Progress overview

Progress and errors of the environment integration and extraction can be seen in the process overview similar to other server-side jobs.

images/download/attachments/126588890/image2017-11-23_16_9_35.png

Customizing

In order to support additional environment elements to transfer, you need to create a customizing.

The extension point "com.heiler.environment.core.transferHandler" can be used to contribute so called transfer handlers. Those contributions will be shown and executed by the environment extraction and integration.

Contributions need to provide the class to the transfer handler implementation as well as the label and a description of the handler. Optionally transfer handlers can be dependent on others (like object permissions need to have user and user groups before they can be transferred). The framework makes sure the correct order of handlers is called based on the dependency. Some handlers can also be declared as mandatory, this means they will be executed in any case.

<extension
point="com.heiler.ppm.environment.server.transferHandler">
<transferHandler
class="com.heiler.ppm.customizing.server.internal.transfer.MyOwnTransferHandler"
identifier="customizing.transfer.myOwnTransferHandler"
label="%transferHandler.MyOwnTransferHandler.label"
description="%transferHandler.MyOwnTransferHandler.description"
mandatory="false"
order="1000">
<dependency
dependsOn="customizing.transfer.otherTransferHandler">
</dependency>
</transferHandler>
</extension>

The class of the transfer handler is a simple implementation of the "com.heiler.environment.core.TransferHandler" interface which provides an extract and integrate method. The given workingFolder is the folder from which the transfer handler should read the data.

@Override
public void extract( File workingFolder, TransferContext context, TransferHandlerConfig config )
throws CoreException, InterruptedException
{
IProgressMonitor progressMonitor = context.getProgressMonitor();
SubMonitor monitor = SubMonitor.convert( progressMonitor, 1 );
try
{
// do your integrate action
FileUtils.writeStringToFile( new File( workingFolder, this.fileName ), "This file should contain all myOwn things" ); //$NON-NLS-1$ //$NON-NLS-2$
...
}
finally
{
progressMonitor.done();
}
}
 
@Override
public void integrate( File workingFolder, TransferContext context, TransferHandlerConfig config )
throws CoreException, InterruptedException
{
IProgressMonitor progressMonitor = context.getProgressMonitor();
SubMonitor monitor = SubMonitor.convert( progressMonitor, 1 );
try
{
//do your integration action here
File myFile = new File( workingFolder, this.fileName );
if ( !myFile.exists() || !myFile.isFile() )
{
throw new IllegalArgumentException( "File does not exist or is not a file: " + myFile.getAbsolutePath() ); //$NON-NLS-1$
}
....
}
finally
{
progressMonitor.done();
}
}

Furthermore, the transfer service (EnvironmentComponent.getTransferService) gives access to the available transfer handlers and their meta data (label, etc.) and can also be used to execute the extract or integrate process programmatically.