Back Transport
What does the Back Transport functionality do?
Multisite Management (MSM) enables the distribution of content from a source project to one or more target projects. The MSM Back Transport functionality, on the other hand, allows you to transfer content from a target project back to the source project.
MSM Back Transport functionality therefore covers use cases in which editors edit content in the target project that was initially transported from the source project to the target project. These changes are then transferred back to the source project. To do this, a change request must be created in the target project.
In the target project, the change request is made using a custom ContentCreator script or a custom workflow. A user interface is available in the source project to manage incoming change requests from target projects.
Requirements in the target project
You can create change requests using a custom ContentCreator script or a custom workflow. You need to adjust both the script for the ContentCreator and the workflow for each project.
In both cases, the script has to check whether one or more elements have been changed.
You can use the following script as a guideline when creating your custom change request script:
import java.util.*;
import de.espirit.firstspirit.agency.*;
import de.espirit.firstspirit.ui.operations.*;
import de.espirit.firstspirit.access.store.pagestore.*;
import de.espirit.firstspirit.modules.multisite.agency.MultisiteAgents;
import de.espirit.firstspirit.modules.multisite.agency.operation.*;
// Helper method that checks if an element has been modified and creates a new TransportRequest for it in that case.
createRequestIfModified(sourceProject, targetProject, language, element) {
modified = itemAgent.isModified(element, targetProject, language);
if (!modified) {
return;
}
// call operation
transportOperation = itemAgent.getTransportOperation(element);
transportOperation.source(language, element.getRevision()).target(targetProject);
transportOperation.perform();
}
// initialize variables
operationAgent = context.requireSpecialist(OperationAgent.TYPE);
requestOperation = operationAgent.getOperation(RequestOperation.TYPE);
element = context.getElement();
sourceProject = element.getProject();
// get target project
targetProjectName = "Mithras 1";
targetProject = context.getConnection().getProjectByName(targetProjectName);
if (targetProject == null) {
throw new RuntimeException("Project '" + targetProjectName + "' not found. Request cancelled.");
}
// get language to transport
languageAbbreviation = "EN";
language = sourceProject.getLanguage(languageAbbreviation);
if (language == null) {
throw new RuntimeException("Language '" + languageAbbreviation + "' not found. Request cancelled.");
}
// get ItemAgent
itemAgent = MultisiteAgents.create(context).getItemAgent();
// create request for the current element
createRequestIfModified(sourceProject, targetProject, language, element);
// special handling for pages: iterate over sections and create a request for each modified section
if (element instanceof Page) {
page = element;
for (section: page.getChildren(Section.class, true).toList()) {
createRequestIfModified(sourceProject, targetProject, language, section);
}
}
// log info
context.logInfo("Script executed without any errors.");
Managing change requests in the source project
In the source project, you can view, if necessary, edit, accept, or reject change requests via the user interface.
Viewing open change requests
You can manage incoming change requests from target projects in the source project via the MSM user interface:
- Open the source project in the ContentCreator.
- Navigate to the MSM user interface.
- Open the Pull tab.
→ The Change requests tab is opened by default. Here you can manage all incoming and not yet accepted change requests.
The following information is available for each change request in the overview list:
- Element: Type and name of the element concerned
- Source Project: Name of the project in which the change request was created
- Languages: Language affected by the change request
- Date/Time: Date and time at which the change request was created
- Conflicts: Indicates whether the element contains language-independent form elements that could be overwritten if the change request is accepted without review
Filtering open change requests
To make it easier to handle change requests, you can sort through the list of change requests.
The following filter options are available:
- Projects: Filter the list by target projects to display only change requests from the desired target projects.
- Languages: Filter the list by language to display only change requests for one or more desired languages.
- Conflicts: Filter the list according to conflicts to display either only change requests without conflicts or only change requests with conflicts.
Viewing conflicts
If a change request was created for an element that contains language-independent form elements, this could lead to potential conflicts.
You can view all conflicts for a given change request in the user interface:
- Navigate to the Pull tab in the MSM user interface.
- Click in the list entry of the desired change request.
→ A list of all potential conflicts is displayed.
Example:
You create a change request for an element that contains a language-dependent text and a language-independent image. The language-independent image from the target project is not identical to the image in the source project. If you accept the change request without editing it, both the language-dependent text and the language-independent image are transferred to the source project.
Viewing an open change request
A log is available for each change request. In the log, you can find further details on the selected change request, such as whether it has been edited.
- Navigate to the Pull tab in the MSM user interface.
- Move the mouse over the change request you want to view.
→ A toolbar is displayed. - Click on the symbol Show Log.
→ The history for the open change request is displayed.
Editing a change request
You should review all change requests in detail before accepting them. In edit mode, you have the option to only accept individual text elements which allows you to edit the change request. This also ensures that no language-independent elements are carried back in a change request with a conflict.
- Navigate to the Pull tab in the MSM user interface.
- Hover over the Change Request you want to view.
→ A toolbar will appear. - Click on the Merge icon.
→ In the editor, you can see the version from the target project that can be transported back on the left and the current status in the source project on the right. - To accept a text element that is not yet included in the source project, click on the plus icon . To accept a text element that already exists in the source project but has been changed in the target project, click on the pencil icon .
Alternatively: Click in the toolbar to accept a text element. - Optional: To reset a text element to the current status in the source project, click in the toolbar.
- Click on Save.
→ The changes made to the change request will be saved.
Accepting change requests
You can either accept a single change request or several change requests at once.
Accepting an individual change requests
- Navigate to the Pull tab in the MSM user interface.
- Move the mouse over the change request you want to accept.
→ A toolbar is displayed. - Click on the symbol Apply.
→ You have accepted the change request.
Accepting multiple change requests
- Navigate to the Pull tab in the MSM user interface.
- Select one or more change requests using the checkbox in the overview list.
- Click Apply selected changes.
→ You have accepted the selected change requests.
Rejecting change requests
You can either reject a single change request or several change requests at once.
Reject an individual change request
- Navigate to the Pull tab in the MSM user interface.
- Move the mouse over the change request that you want to reject.
→ A toolbar is displayed. - Click on the symbol Discard.
→ You have rejected the change request.
Reject multiple change requests
- Navigate to the Pull tab in the MSM user interface.
- Select one or more change requests from the overview list using the checkbox.
- Click Discard selected changes.
→ You have rejected the selected change requests.
Viewing accepted change requests
You can view change requests even after they have been accepted.
- Navigate to the Pull tab in the MSM user interface.
- Open the History tab.
→ Here you can view all accepted change requests. - Optional: Filter the list.
- Move the mouse over the change request you want to track.
- Click on the Show Log icon .
→ The history for the accepted change request will be displayed.