DetailProgressMonitor monitor) throws ParseException {
ReferenceManager refManager = ReferenceManager.getInstance();
XMLArtefact artefact = refManager.parseArtefact(position);
artefact.setContext(position.getTutorialDocument());
XMLReference reference = refManager.getReference(artefact);
try {
// TODO externalize
logger.info("prepare integration"); //$NON-NLS-1$
boolean hasChanged = prepareIntegration(reference);
if (hasChanged)
refManager.saveReference(reference, artefact);
} catch (MissingProviderException e) {
return;
} catch (IntegrationException e) {
return;
}
int nrOfStepsToDo = reference.getOperations().size() + 2;
monitor.setLocalSteps(nrOfStepsToDo);
// TODO externalize
logger.info("get artefact from provider '" //$NON-NLS-1$
+ reference.getProvider().getId() + "'"); //$NON-NLS-1$
IArtefactRepresentation representation = getArtefactFromProvider(reference
.getProvider());
monitor.doLocalStep();
representation = applyOperations(representation, reference
.getOperations(), monitor);
// TODO externalize
logger.info("integrate with '" //$NON-NLS-1$
+ reference.getIntegrator().getId() + "'"); //$NON-NLS-1$
String integrationID = integrate(position, representation, reference
.getIntegrator());
monitor.doLocalStep();
if (integrationID == null)
return;