private void synchronizeCvObject( CvObject cvObject, boolean synchronizeAnnotatedAttributes ) { if (cvObject instanceof CvDagObject) { CvDagObject cvDagObject = (CvDagObject)cvObject; if (IntactCore.isInitializedAndDirty(cvDagObject.getChildren())){ Collection<CvDagObject> children = synchronizeCollection(cvDagObject.getChildren()); cvDagObject.getChildren().clear(); cvDagObject.getChildren().addAll(children); } if (IntactCore.isInitializedAndDirty(cvDagObject.getParents())){ Collection<CvDagObject> parents = synchronizeCollection(cvDagObject.getParents()); cvDagObject.getParents().clear(); cvDagObject.getParents().addAll(parents); } } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( cvObject ); } }
private void synchronizeCvObject( CvObject cvObject, boolean synchronizeAnnotatedAttributes ) { if (cvObject instanceof CvDagObject) { CvDagObject cvDagObject = (CvDagObject)cvObject; if (IntactCore.isInitializedAndDirty(cvDagObject.getChildren())){ Collection<CvDagObject> children = synchronizeCollection(cvDagObject.getChildren()); cvDagObject.getChildren().clear(); cvDagObject.getChildren().addAll(children); } if (IntactCore.isInitializedAndDirty(cvDagObject.getParents())){ Collection<CvDagObject> parents = synchronizeCollection(cvDagObject.getParents()); cvDagObject.getParents().clear(); cvDagObject.getParents().addAll(parents); } } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( cvObject ); } }
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
private void synchronizePublication( Publication publication, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(publication.getExperiments())){ Collection<Experiment> experiments = synchronizeCollection(publication.getExperiments()); publication.getExperiments().clear(); publication.getExperiments().addAll(experiments); } publication.setStatus( synchronize( publication.getStatus() ) ); publication.setCurrentOwner( synchronizeUser(publication.getCurrentOwner()) ); publication.setCurrentReviewer( synchronizeUser(publication.getCurrentReviewer()) ); final List<LifecycleEvent> events = publication.getLifecycleEvents(); if (IntactCore.isInitializedAndDirty( events )){ Collection<LifecycleEvent> synchedEvents = new ArrayList<LifecycleEvent>( events.size() ); for ( LifecycleEvent event : events ) { synchedEvents.add( synchronizeEvent(event) ); } events.clear(); events.addAll( synchedEvents ); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( publication ); } }
private void synchronizePublication( Publication publication, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(publication.getExperiments())){ Collection<Experiment> experiments = synchronizeCollection(publication.getExperiments()); publication.getExperiments().clear(); publication.getExperiments().addAll(experiments); } publication.setStatus( synchronize( publication.getStatus() ) ); publication.setCurrentOwner( synchronizeUser(publication.getCurrentOwner()) ); publication.setCurrentReviewer( synchronizeUser(publication.getCurrentReviewer()) ); final List<LifecycleEvent> events = publication.getLifecycleEvents(); if (IntactCore.isInitializedAndDirty( events )){ Collection<LifecycleEvent> synchedEvents = new ArrayList<LifecycleEvent>( events.size() ); for ( LifecycleEvent event : events ) { synchedEvents.add( synchronizeEvent(event) ); } events.clear(); events.addAll( synchedEvents ); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( publication ); } }
private void synchronizeComponent( Component component, boolean synchronizeAnnotatedAttributes ) { Collection<Feature> features = synchronizeCollection(component.getFeatures()); component.getFeatures().clear(); component.getFeatures().addAll(features); Collection<CvExperimentalRole> roles = synchronizeCollection( component.getExperimentalRoles() ); component.getExperimentalRoles().clear(); component.getExperimentalRoles().addAll(roles); Collection<CvIdentification> partDet = synchronizeCollection( component.getParticipantDetectionMethods()); component.getParticipantDetectionMethods().clear(); component.getParticipantDetectionMethods().addAll(partDet); Collection<CvExperimentalPreparation> expPrep = synchronizeCollection( component.getExperimentalPreparations() ); component.getExperimentalPreparations().clear(); component.getExperimentalPreparations().addAll(expPrep);
private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) { interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) ); interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) ); if (IntactCore.isInitializedAndDirty(interaction.getComponents())){ Collection<Component> components = synchronizeCollection(interaction.getComponents()); interaction.getComponents().clear(); interaction.getComponents().addAll(components); } interaction.setBioSource( synchronize( interaction.getBioSource() ) ); if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){ Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments()); interaction.getExperiments().clear(); interaction.getExperiments().addAll(experiment); } // cannot call setConfidences in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){ Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction); interaction.getConfidences().clear(); interaction.getConfidences().addAll(confidences); } // cannot call setParameters in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getParameters())){ Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction); interaction.getParameters().clear(); interaction.getParameters().addAll(interactionParameters); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( interaction ); } }
private void synchronizeComponent( Component component, boolean synchronizeAnnotatedAttributes ) { Collection<Feature> features = synchronizeCollection(component.getFeatures()); component.getFeatures().clear(); component.getFeatures().addAll(features); Collection<CvExperimentalRole> roles = synchronizeCollection( component.getExperimentalRoles() ); component.getExperimentalRoles().clear(); component.getExperimentalRoles().addAll(roles); Collection<CvIdentification> partDet = synchronizeCollection( component.getParticipantDetectionMethods()); component.getParticipantDetectionMethods().clear(); component.getParticipantDetectionMethods().addAll(partDet); Collection<CvExperimentalPreparation> expPrep = synchronizeCollection( component.getExperimentalPreparations() ); component.getExperimentalPreparations().clear(); component.getExperimentalPreparations().addAll(expPrep);
private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) { interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) ); interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) ); if (IntactCore.isInitializedAndDirty(interaction.getComponents())){ Collection<Component> components = synchronizeCollection(interaction.getComponents()); interaction.getComponents().clear(); interaction.getComponents().addAll(components); } interaction.setBioSource( synchronize( interaction.getBioSource() ) ); if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){ Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments()); interaction.getExperiments().clear(); interaction.getExperiments().addAll(experiment); } // cannot call setConfidences in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){ Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction); interaction.getConfidences().clear(); interaction.getConfidences().addAll(confidences); } // cannot call setParameters in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getParameters())){ Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction); interaction.getParameters().clear(); interaction.getParameters().addAll(interactionParameters); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( interaction ); } }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }