private <X extends AnnotatedObject> Collection<X> synchronizeCollection( Collection<X> collection ) { if (!IntactCore.isInitializedAndDirty(collection)) { return collection; } Collection<X> synchedCollection = new ArrayList<X>( collection.size() ); for ( X ao : collection ) { synchedCollection.add( synchronize( ao ) ); } return synchedCollection; }
private void synchronizeBioSource( BioSource bioSource, boolean synchronizeAnnotatedAttributes ) { bioSource.setCvCellType( synchronize( bioSource.getCvCellType() ) ); bioSource.setCvTissue( synchronize( bioSource.getCvTissue() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( bioSource ); } }
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 LifecycleEvent synchronizeEvent(LifecycleEvent event) { event.setWho( synchronizeUser(event.getWho()) ); event.setEvent( synchronize( event.getEvent() ) ); return event; }
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 <X extends AnnotatedObject> Collection<X> synchronizeCollection( Collection<X> collection ) { if (!IntactCore.isInitializedAndDirty(collection)) { return collection; } Collection<X> synchedCollection = new ArrayList<X>( collection.size() ); for ( X ao : collection ) { synchedCollection.add( synchronize( ao ) ); } return synchedCollection; }
private void synchronizeBioSource( BioSource bioSource, boolean synchronizeAnnotatedAttributes ) { bioSource.setCvCellType( synchronize( bioSource.getCvCellType() ) ); bioSource.setCvTissue( synchronize( bioSource.getCvTissue() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( bioSource ); } }
private LifecycleEvent synchronizeEvent(LifecycleEvent event) { event.setWho( synchronizeUser(event.getWho()) ); event.setEvent( synchronize( event.getEvent() ) ); return event; }
private void synchronizeOwnedObjectCommons (OwnedObject bo) { if ( !( bo instanceof Institution ) ) { bo.setOwner( synchronize( bo.getOwner() ) ); } }
private void synchronizeOwnedObjectCommons (OwnedObject bo) { if ( !( bo instanceof Institution ) ) { bo.setOwner( synchronize( bo.getOwner() ) ); } }
private Collection<InteractionParameter> synchronizeInteractionParameters( Collection<InteractionParameter> interactionParametersToSynchronize, Interaction parentInteraction ) { List<InteractionParameter> interactionParameters = new ArrayList<InteractionParameter>(interactionParametersToSynchronize.size()); for ( InteractionParameter interactionParameter : interactionParametersToSynchronize ) { if (interactionParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionParameterDao().isTransient(interactionParameter)) { interactionParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionParameterDao().getByAc(interactionParameter.getAc()); } interactionParameter.setCvParameterType( synchronize (interactionParameter.getCvParameterType())); interactionParameter.setCvParameterUnit( synchronize (interactionParameter.getCvParameterUnit())); interactionParameter.setInteraction((InteractionImpl)parentInteraction); interactionParameters.add(interactionParameter); } return interactionParameters; }
private Collection<ComponentParameter> synchronizeComponentParameters( Collection<ComponentParameter> componentParametersToSynchronize, Component parentComponent ) { List<ComponentParameter> componentParameters = new ArrayList<ComponentParameter>(componentParametersToSynchronize.size()); for ( ComponentParameter componentParameter : componentParametersToSynchronize ) { if (componentParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().isTransient(componentParameter)) { componentParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().getByAc(componentParameter.getAc()); } componentParameter.setCvParameterType( synchronize (componentParameter.getCvParameterType())); componentParameter.setCvParameterUnit( synchronize (componentParameter.getCvParameterUnit())); componentParameter.setComponent(parentComponent); componentParameters.add(componentParameter); } return componentParameters; }
private Collection<InteractionParameter> synchronizeInteractionParameters( Collection<InteractionParameter> interactionParametersToSynchronize, Interaction parentInteraction ) { List<InteractionParameter> interactionParameters = new ArrayList<InteractionParameter>(interactionParametersToSynchronize.size()); for ( InteractionParameter interactionParameter : interactionParametersToSynchronize ) { if (interactionParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionParameterDao().isTransient(interactionParameter)) { interactionParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionParameterDao().getByAc(interactionParameter.getAc()); } interactionParameter.setCvParameterType( synchronize (interactionParameter.getCvParameterType())); interactionParameter.setCvParameterUnit( synchronize (interactionParameter.getCvParameterUnit())); interactionParameter.setInteraction((InteractionImpl)parentInteraction); interactionParameters.add(interactionParameter); } return interactionParameters; }
private Collection<ComponentConfidence> synchronizeComponentConfidences( Collection<ComponentConfidence> confidencesToSynchronize, Component parentComponent ) { List<ComponentConfidence> confidences = new ArrayList<ComponentConfidence>(confidencesToSynchronize.size()); for ( ComponentConfidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setComponent(parentComponent); confidences.add(confidence); } return confidences; }
private Collection<ComponentConfidence> synchronizeComponentConfidences( Collection<ComponentConfidence> confidencesToSynchronize, Component parentComponent ) { List<ComponentConfidence> confidences = new ArrayList<ComponentConfidence>(confidencesToSynchronize.size()); for ( ComponentConfidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setComponent(parentComponent); confidences.add(confidence); } return confidences; }
private Collection<Confidence> synchronizeConfidences( Collection<Confidence> confidencesToSynchronize, Interaction parentInteraction ) { List<Confidence> confidences = new ArrayList<Confidence>(confidencesToSynchronize.size()); for ( Confidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setInteraction((InteractionImpl)parentInteraction); confidences.add(confidence); } return confidences; }
private Collection<Confidence> synchronizeConfidences( Collection<Confidence> confidencesToSynchronize, Interaction parentInteraction ) { List<Confidence> confidences = new ArrayList<Confidence>(confidencesToSynchronize.size()); for ( Confidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setInteraction((InteractionImpl)parentInteraction); confidences.add(confidence); } return confidences; }
private Annotation synchronizeAnnotation( Annotation annotation, AnnotatedObject parent ) { if (annotation.getAc() != null) { return IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getAnnotationDao().getByAc(annotation.getAc()); } else { } annotation.setCvTopic( synchronize( annotation.getCvTopic() ) ); if (annotation.getAc() == null && parent.getAc() != null) { annotatedObjectsToPersist.put(keyBuilder.keyForAnnotation(annotation, parent), annotation); } return annotation; }
private Alias synchronizeAlias( Alias alias, AnnotatedObject parent ) { if (alias.getAc() != null) { return IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getAliasDao().getByAc(alias.getAc()); } alias.setCvAliasType( synchronize( alias.getCvAliasType() ) ); alias.setParent(parent); if (alias.getAc() == null && parent.getAc() != null) { annotatedObjectsToPersist.put(keyBuilder.keyForAlias(alias), alias); } return alias; }
private Alias synchronizeAlias( Alias alias, AnnotatedObject parent ) { if (alias.getAc() != null) { return IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getAliasDao().getByAc(alias.getAc()); } alias.setCvAliasType( synchronize( alias.getCvAliasType() ) ); alias.setParent(parent); if (alias.getAc() == null && parent.getAc() != null) { annotatedObjectsToPersist.put(keyBuilder.keyForAlias(alias), alias); } return alias; }