Codota Logo
IntactContext.getConfig
Code IndexAdd Codota 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)

  • Common ways to obtain IntactContext
private void myMethod () {
IntactContext i =
  • Codota IconIntactContext.getCurrentInstance()
  • Smart code suggestions by Codota
}
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

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now