private void searchIntegrationWay(String lastRepresentationType,
XMLReference reference) throws IntegrationException {
XMLIntegrator integrator = reference.getIntegrator();
IntegrationSearcher searcher = new IntegrationSearcher();
if (integrator == null) {
Tuple<List<XMLArtefactOperation>, XMLIntegrator> additionalChain = searcher
.search(lastRepresentationType);
if (additionalChain == null) {
// TODO externalize
String message = "no cain containing a list of operations and one integrator could be found"; //$NON-NLS-1$
showError(message);
throw new IntegrationException();
}
reference.getOperations().addAll(additionalChain.getLeft());
reference.setIntegrator(additionalChain.getRight());
} else {
String id = integrator.getId();
List<XMLArtefactOperation> additionalOperations = searcher.search(
lastRepresentationType, PluginManager.getInstance()
.getIntegrator(id).getSupportedType());
if (additionalOperations == null) {
// TODO externalize
String message = "no list of operations could not be found to match the integrator"; //$NON-NLS-1$