Tabnine Logo
IntactContext.getConfig
Code IndexAdd Tabnine to your IDE (free)

How to use
getConfig
method
in
uk.ac.ebi.intact.core.context.IntactContext

Best Java code snippets using uk.ac.ebi.intact.core.context.IntactContext.getConfig (Showing top 16 results out of 315)

origin: uk.ac.ebi.intact.core/intact-core

public DefaultFinder(IntactContext intactContext) {
  config = intactContext.getConfig();
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public DefaultFinder(IntactContext intactContext) {
  config = intactContext.getConfig();
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public DefaultFinder() {
  config = IntactContext.getCurrentInstance().getConfig();
}
origin: uk.ac.ebi.intact.core/intact-core

public DefaultFinder() {
  config = IntactContext.getCurrentInstance().getConfig();
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Update the shortlabel based on the data available in the database.
 */
public void synchronizeShortLabel() {
  if( IntactContext.currentInstanceExists() ) {
    if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateInteractionLabel() ) {
      String shortLabel = getShortLabel();
      String newShortLabel = InteractionUtils.syncShortLabelWithDb(shortLabel);
      if (!shortLabel.equals(newShortLabel)) {
        if (log.isDebugEnabled()) log.debug("Interaction with label '"+shortLabel+"' renamed '"+newShortLabel+"'" );
        setShortLabel(newShortLabel);
      }
    }
  } else {
    log.warn( "There is no IntAct Context initialized, skipping interaction shortlabel synchronization." );
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Update the shortlabel based on the data available in the database.
 */
public void synchronizeShortLabel() {
  if( IntactContext.currentInstanceExists() ) {
    if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateInteractionLabel() ) {
      String shortLabel = getShortLabel();
      String newShortLabel = InteractionUtils.syncShortLabelWithDb(shortLabel);
      if (!shortLabel.equals(newShortLabel)) {
        if (log.isDebugEnabled()) log.debug("Interaction with label '"+shortLabel+"' renamed '"+newShortLabel+"'" );
        setShortLabel(newShortLabel);
      }
    }
  } else {
    log.warn( "There is no IntAct Context initialized, skipping interaction shortlabel synchronization." );
  }
}
origin: uk.ac.ebi.intact.core/intact-core

@PrePersist
public void synchronizeShortLabel() {
  if( IntactContext.currentInstanceExists() ) {
    if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateExperimentLabel() ) {
      String shortLabel = getShortLabel();
      String newShortLabel = shortLabel;
      try {
        newShortLabel = ExperimentUtils.syncShortLabelWithDb(shortLabel, ExperimentUtils.getPubmedId( this ));
      } catch (Exception e) {
        log.error("Exception synchronizing the label, probably due to an invalid format: "+newShortLabel, e);
      }
      if (!shortLabel.equals(newShortLabel)) {
        if (log.isDebugEnabled()) log.debug("Experiment with label '"+shortLabel+"' renamed '"+newShortLabel+"'" );
        setShortLabel(newShortLabel);
      }
    }
  } else {
    log.warn( "There is no IntAct Context initialized, skipping experiment shortlabel synchronization." );
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

@PrePersist
public void synchronizeShortLabel() {
  if( IntactContext.currentInstanceExists() ) {
    if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateExperimentLabel() ) {
      String shortLabel = getShortLabel();
      String newShortLabel = shortLabel;
      try {
        newShortLabel = ExperimentUtils.syncShortLabelWithDb(shortLabel, ExperimentUtils.getPubmedId( this ));
      } catch (Exception e) {
        log.error("Exception synchronizing the label, probably due to an invalid format: "+newShortLabel, e);
      }
      if (!shortLabel.equals(newShortLabel)) {
        if (log.isDebugEnabled()) log.debug("Experiment with label '"+shortLabel+"' renamed '"+newShortLabel+"'" );
        setShortLabel(newShortLabel);
      }
    }
  } else {
    log.warn( "There is no IntAct Context initialized, skipping experiment shortlabel synchronization." );
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

@Before
public void prepareBasicTest() throws Exception {
  mockBuilder = new IntactMockBuilder(getIntactContext().getConfig().getDefaultInstitution());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * The ID is the concatenation of the prefix and a sequence provided by the database, separated
 * by a dash.
 *
 * @param sessionImplementor a hibernate session implementor
 * @param object             the object being persisted
 *
 * @return the new generated ID
 *
 * @throws HibernateException if something goes wrong
 */
@Override
public Serializable generate( SessionImplementor sessionImplementor, Object object ) throws HibernateException {
  String prefix;
  if (IntactContext.currentInstanceExists()) {
    prefix = IntactContext.getCurrentInstance().getConfig().getAcPrefix();
  } else {
    prefix = "UNK";
  }
  String id = prefix + "-" + super.generate( sessionImplementor, object );
  log.trace( "Assigning Id: " + id );
  return id;
}
origin: uk.ac.ebi.intact.core/intact-core

@Before
public void prepareBasicTest() throws Exception {
  mockBuilder = new IntactMockBuilder(getIntactContext().getConfig().getDefaultInstitution());
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * The ID is the concatenation of the prefix and a sequence provided by the database, separated
 * by a dash.
 *
 * @param sessionImplementor a hibernate session implementor
 * @param object             the object being persisted
 *
 * @return the new generated ID
 *
 * @throws HibernateException if something goes wrong
 */
@Override
public Serializable generate( SessionImplementor sessionImplementor, Object object ) throws HibernateException {
  String prefix;
  if (IntactContext.currentInstanceExists()) {
    prefix = IntactContext.getCurrentInstance().getConfig().getAcPrefix();
  } else {
    prefix = "UNK";
  }
  String id = prefix + "-" + super.generate( sessionImplementor, object );
  log.trace( "Assigning Id: " + id );
  return id;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * The local identity is created using a sequence. If the sequence does not exist, a new one is created
 * with initial value calculated using the maximum integer for the existing local CV identifiers.
 * @return The next value available
 * @throws SequenceCreationException thrown if the sequence cannot be created.
 */
protected String nextLocalIdentifier() throws SequenceCreationException {
  final IntactContext context = IntactContext.getCurrentInstance();
  String prefix = context.getConfig().getLocalCvPrefix();
  Integer max = context.getDataContext().getDaoFactory()
      .getCvObjectDao().getLastCvIdentifierWithPrefix(prefix);
  if (max == null) max = 0;
  SequenceManager seqManager = (SequenceManager) context.getSpringContext().getBean("sequenceManager");
  seqManager.createSequenceIfNotExists(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ, max+1);
  String nextIntegerAsString = String.valueOf(seqManager.getNextValueForSequence(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ));
  return prefix+":" + StringUtils.leftPad(nextIntegerAsString, 4, "0");
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * The local identity is created using a sequence. If the sequence does not exist, a new one is created
 * with initial value calculated using the maximum integer for the existing local CV identifiers.
 * @return The next value available
 * @throws SequenceCreationException thrown if the sequence cannot be created.
 */
protected String nextLocalIdentifier() throws SequenceCreationException {
  final IntactContext context = IntactContext.getCurrentInstance();
  String prefix = context.getConfig().getLocalCvPrefix();
  Integer max = context.getDataContext().getDaoFactory()
      .getCvObjectDao().getLastCvIdentifierWithPrefix(prefix);
  if (max == null) max = 0;
  SequenceManager seqManager = (SequenceManager) context.getSpringContext().getBean("sequenceManager");
  seqManager.createSequenceIfNotExists(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ, max+1);
  String nextIntegerAsString = String.valueOf(seqManager.getNextValueForSequence(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ));
  return prefix+":" + StringUtils.leftPad(nextIntegerAsString, 4, "0");
}
origin: uk.ac.ebi.intact.core/intact-core

private static void addStartAndEndPercentIfNecessary( QueryTerm term ) {
  if ( term.hasModifier( QueryModifier.PHRASE_DELIM ) ) {
    return;
  }
  String acPrefix = IntactContext.getCurrentInstance().getConfig().getAcPrefix();
  if ( !term.startsWith( acPrefix ) && !term.hasModifier( QueryModifier.WILDCARD_START ) ) {
    term.addModifier( QueryModifier.WILDCARD_START );
  }
  if ( !term.startsWith( acPrefix ) && !term.hasModifier( QueryModifier.WILDCARD_END ) ) {
    term.addModifier( QueryModifier.WILDCARD_END );
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private static void addStartAndEndPercentIfNecessary( QueryTerm term ) {
  if ( term.hasModifier( QueryModifier.PHRASE_DELIM ) ) {
    return;
  }
  String acPrefix = IntactContext.getCurrentInstance().getConfig().getAcPrefix();
  if ( !term.startsWith( acPrefix ) && !term.hasModifier( QueryModifier.WILDCARD_START ) ) {
    term.addModifier( QueryModifier.WILDCARD_START );
  }
  if ( !term.startsWith( acPrefix ) && !term.hasModifier( QueryModifier.WILDCARD_END ) ) {
    term.addModifier( QueryModifier.WILDCARD_END );
  }
}
uk.ac.ebi.intact.core.contextIntactContextgetConfig

Popular methods of IntactContext

  • getCurrentInstance
    Gets the current (ThreadLocal) instance of IntactContext. If no such instance exist, IntAct Core wil
  • getDataContext
  • getInstitution
    Gets the institution from the RuntimeConfig object. In addition, tries to refresh the instance from
  • getDaoFactory
  • getCorePersister
  • currentInstanceExists
    Checks if an instance already exists.
  • getSpringContext
  • getLifecycleManager
    Gets the lifecycle manager for publications.
  • getPersisterHelper
  • initContext
    Initializes a standalone context.
  • bindToApplication
  • getApplication
  • bindToApplication,
  • getApplication,
  • getConfigurationHandler,
  • getCoreDeleter,
  • getUserContext,
  • initStandaloneContextInMemory,
  • setApplication

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • setContentView (Activity)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • BoxLayout (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now