Skip to content
Snippets Groups Projects
Commit 5f997e99 authored by felmer's avatar felmer
Browse files

SSDM-7857: remove connection elements in project (the harvester doesn't need them)

parent 98614ae3
No related branches found
No related tags found
No related merge requests found
...@@ -70,11 +70,6 @@ public class ProjectDeliverer extends AbstractEntityDeliverer<Project> ...@@ -70,11 +70,6 @@ public class ProjectDeliverer extends AbstractEntityDeliverer<Project>
addRegistrationDate(writer, project); addRegistrationDate(writer, project);
addRegistrator(writer, project); addRegistrator(writer, project);
addSpace(writer, project.getSpace()); addSpace(writer, project.getSpace());
ConnectionsBuilder connectionsBuilder = new ConnectionsBuilder();
connectionsBuilder.addConnections(project.getExperiments());
connectionsBuilder.addConnections(project.getSamples().stream()
.filter(s -> s.getExperiment() == null).collect(Collectors.toList()));
connectionsBuilder.writeTo(writer);
addAttachments(writer, project.getAttachments()); addAttachments(writer, project.getAttachments());
writer.writeEndElement(); writer.writeEndElement();
writer.writeEndElement(); writer.writeEndElement();
...@@ -91,8 +86,6 @@ public class ProjectDeliverer extends AbstractEntityDeliverer<Project> ...@@ -91,8 +86,6 @@ public class ProjectDeliverer extends AbstractEntityDeliverer<Project>
fetchOptions.withRegistrator(); fetchOptions.withRegistrator();
fetchOptions.withModifier(); fetchOptions.withModifier();
fetchOptions.withSpace(); fetchOptions.withSpace();
fetchOptions.withExperiments();
fetchOptions.withSamples().withExperiment();
return fetchOptions; return fetchOptions;
} }
......
...@@ -1436,38 +1436,6 @@ public class EntitySynchronizer ...@@ -1436,38 +1436,6 @@ public class EntitySynchronizer
} }
} }
private void handleProjectConnections(ResourceListParserData data, IncomingProject prj)
{
Map<String, IncomingExperiment> experimentsToProcess = data.getExperimentsToProcess();
for (Connection conn : prj.getConnections())
{
String connectedExpPermId = conn.getToPermId();
// TODO we need to do the same check for samples to support project samples
if (experimentsToProcess.containsKey(connectedExpPermId))
{
// the project is connected to an experiment
IncomingExperiment exp = experimentsToProcess.get(connectedExpPermId);
NewExperiment newExp = exp.getExperiment();
Experiment experiment = service.tryGetExperimentByPermId(connectedExpPermId);
// check if our local graph has the same connection
if (service.tryGetExperiment(ExperimentIdentifierFactory.parse(newExp.getIdentifier())) == null)
{
// add new edge
String oldIdentifier = newExp.getIdentifier();
int index = oldIdentifier.lastIndexOf('/');
String expCode = oldIdentifier.substring(index + 1);
newExp.setIdentifier(prj.getProject().getIdentifier() + "/" + expCode);
// add new experiment node
}
} else
{
// This means the XML contains the connection but not the connected entity.
// This is an unlikely scenario.
operationLog.info("Connected experiment with permid : " + connectedExpPermId + " is missing");
}
}
}
private ProjectUpdatesDTO createProjectUpdateDTO(NewProject incomingProject, Project project) private ProjectUpdatesDTO createProjectUpdateDTO(NewProject incomingProject, Project project)
{ {
ProjectUpdatesDTO prjUpdate = new ProjectUpdatesDTO(); ProjectUpdatesDTO prjUpdate = new ProjectUpdatesDTO();
......
...@@ -38,11 +38,6 @@ public class IncomingEntity<T extends Identifier<T>> extends AbstractTimestampsA ...@@ -38,11 +38,6 @@ public class IncomingEntity<T extends Identifier<T>> extends AbstractTimestampsA
return connections; return connections;
} }
void addConnection(Connection conn)
{
this.connections.add(conn);
}
public SyncEntityKind getEntityKind() public SyncEntityKind getEntityKind()
{ {
return entityKind; return entityKind;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment