public Collection<GeneralMessage> check(Interaction interaction) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if(interaction.getCvInteractionType() == null){ messages.add(new GeneralMessage( MessageDefinition.INTERACTION_WITHOUT_TYPE, interaction )); } return messages; } }
/****************************/ // enrich fields in the SolrDocument passed as parameter public void enrich ( Interaction interaction, SolrInputDocument solrDocument ) throws Exception { // check parameters and information if ( interaction == null ) { return ; } // Enrich interaction type enrichInteractionType(interaction.getCvInteractionType(), solrDocument) ; // Enrich Complex Organism fields enrichOrganism(interaction, solrDocument) ; // Enrich Complex Xref fields enrichInteractionXref(interaction.getXrefs(), solrDocument) ; }
@Override protected void saveOrUpdateAttributes(Interaction intactObject) throws PersisterException { super.saveOrUpdateAttributes(intactObject); CvObjectPersister.getInstance().saveOrUpdate(intactObject.getCvInteractionType()); saveOrUpdateComponents(intactObject); saveOrUpdateExperiments(intactObject); }
if ( !cvInteractionType.equals( interaction.getCvInteractionType() ) ) { return false; if ( interaction.getCvInteractionType() != null ) { return false;
@Override protected Interaction syncAttributes(Interaction intactObject) { CvInteractionType cvIntType = (CvInteractionType) CvObjectPersister.getInstance().syncIfTransient(intactObject.getCvInteractionType()); intactObject.setCvInteractionType(cvIntType); syncComponents(intactObject); syncExperiments(intactObject); return super.syncAttributes(intactObject); }
if ( interaction.getCvInteractionType() != null ) { CvObject2xmlFactory.getInstance( session ).create( session, element, interaction.getCvInteractionType() );
for ( Component c : interactor.getActiveInstances() ) { Interaction interaction = c.getInteraction(); cvs.add( interaction.getCvInteractionType() ); for ( Experiment e : interaction.getExperiments() ) { cvs.add( e.getCvIdentification() );
writeCvTerm( out, interaction.getCvInteractionType(), iii );
cvs.add( interaction.getCvInteractionType() );
if (interaction.getCvInteractionType() != null){ CrossReference type = cvObjectConverter.toCrossReference(interaction.getCvInteractionType());
if ( !cvInteractionType.equals( interaction.getCvInteractionType() ) ) { return false; if ( interaction.getCvInteractionType() != null ) { return false;
if ( !cvInteractionType.equals( interaction.getCvInteractionType() ) ) { return false; if ( interaction.getCvInteractionType() != null ) { return false;
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 ); } }
sb.append(createUniquenessString(interaction.getCvInteractionType()));
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 ); } }
sb.append(createUniquenessString(interaction.getCvInteractionType()));
protected void traverseInteraction(Interaction interaction, IntactVisitor ... visitors) { if (interaction == null) return; for (IntactVisitor visitor : visitors) { visitor.visitInteraction(interaction); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(interaction)) { return; } traverse(interaction.getCvInteractionType(), visitors); traverse(interaction.getExperiments(), visitors); traverse(interaction.getComponents(), visitors); traverse(interaction.getConfidences(), visitors); traverse(interaction.getParameters(), visitors); }
protected void traverseInteraction(Interaction interaction, IntactVisitor ... visitors) { if (interaction == null) return; for (IntactVisitor visitor : visitors) { visitor.visitInteraction(interaction); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(interaction)) { return; } traverse(interaction.getCvInteractionType(), visitors); traverse(interaction.getExperiments(), visitors); traverse(interaction.getComponents(), visitors); traverse(interaction.getConfidences(), visitors); traverse(interaction.getParameters(), visitors); }
clone.setCvInteractionType(clone(interaction.getCvInteractionType())); clone.setCvInteractorType(clone(interaction.getCvInteractorType()));
clone.setCvInteractionType(clone(interaction.getCvInteractionType())); clone.setCvInteractorType(clone(interaction.getCvInteractorType()));