congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IBrowserFacade.relation
Code IndexAdd Tabnine to your IDE (free)

How to use
relation
method
in
pl.edu.icm.yadda.service2.browse.facade.IBrowserFacade

Best Java code snippets using pl.edu.icm.yadda.service2.browse.facade.IBrowserFacade.relation (Showing top 20 results out of 315)

origin: pl.edu.icm.yadda/yadda-client-common

/** Performs count of the specific query results. */
protected int countQuery(Condition query, String relation) throws BrowseException {
  return browser.relation(relation).count(query);
}
origin: pl.edu.icm.yadda/yadda-aas2

protected Relation getDirectoryRelation() throws ServiceException {
  
  try {
    return browserFacade.relation(RELATION_NAME);
  } catch (NoSuchRelationException e) {
    try {
      return browserFacade.create(relationInfo);
    } catch (BrowseException e2) {
      throw new ServiceException(e2);
    }
  }
  
}    
origin: pl.edu.icm.yadda/yadda-analysis-impl

private synchronized Relation getDirtyRelation() {
  try {
    return browserFacade.relation(DIRTY_RELATION_NAME);
  } catch (NoSuchRelationException ex) {
    Field sourceField = new Field(DIRTY_RELATION_SOURCE_FIELD, Field.Type.STRING, false, true);
    try {
      return browserFacade.create(new RelationInfo(DIRTY_RELATION_NAME, sourceField));
    } catch (InvalidNameException ex1) {
      throw new IllegalArgumentException(ex1);
    }
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void initProcess(final ProcessContext context) {
  try {
    if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
      browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).setAggregatingEnabled(false, false);
    }
  } catch (final Exception e) {
    if (context != null) {
      context.getListener().notifyEvent("contributorViewGenerator.start", new String[]{}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
    }
    log.error("Exception starting processing", e);
  }
}
origin: pl.edu.icm.yadda/bwmeta-import

browserFacade.relation(ElementView.ELEMENT_VIEW_NAME)
       .withPageSize(pageSize)
       .select(Query.fields(ElementView.FIELDS_IDX_EXT_ID)
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void initProcess(final ProcessContext context) {
  try {
    if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
      browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).setAggregatingEnabled(false, false);
    }
  } catch (final Exception e) {
    if (context != null) {
      context.getListener().notifyEvent("contributorViewGenerator.start", new String[]{}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
    }
    log.error("Exception starting processing", e);
  }
}
origin: pl.edu.icm.yadda/yadda-analysis-impl

private synchronized Relation getRefsRelation() {
  try {
    return browserFacade.relation(REFS_RELATION_NAME);
  } catch (NoSuchRelationException ex) {
    Field sourceField = new Field(REFS_RELATION_SOURCE_FIELD, Field.Type.STRING, false, true);
    Field positionField = new Field(REFS_RELATION_POSITION_FIELD, Field.Type.INTEGER, false, false);
    Field targetField = new Field(REFS_RELATION_TARGET_FIELD, Field.Type.STRING, false, true);
    try {
      return browserFacade.create(
          new RelationInfo(REFS_RELATION_NAME, sourceField, positionField, targetField));
    } catch (InvalidNameException ex1) {
      throw new IllegalArgumentException(ex1);
    }
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void initProcess(final ProcessContext context) {
  try {
    if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
      browserFacade.relation(ElementView.ELEMENT_VIEW_NAME).setAggregatingEnabled(false, false);
    }
  } catch (final Exception e) {
    if (context.getListener() != null) {
      context.getListener().notifyEvent("elementViewGenerator.start", new String[]{}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
    }
    log.error("Exception starting processing", e);
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected T doProcess(T data, Map<String, Serializable> context, IProcessListener listener, ProcessingStats stats)
    throws Exception {
  
  //initializer.drop();
  
  if (context.containsKey(Constants.PARAM_FORCE_RECREATE)) {
    initializer.forceInit();
  } else {
    initializer.prepare();    
  }        
  
  if (context.containsKey(Constants.PARAM_MARK_VIEWS_AS_READY)) {
    for (ICommand<RelationInfo> command : initializer.getCommands()) {
      String relationName = command.getCommand().getBaseName();
      Relation relation = browserFacade.relation(relationName);
      ViewConstants.markAsReady(relation);
    }
  }
      
  return data;
}

origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void finishProcess(final ProcessContext context) {
  try {
    if (context.containsKey(Constants.PARAM_MARK_VIEWS_AS_READY)) {
      ViewConstants.markAsReady(browserFacade.relation(TypeView.TYPE_VIEW_NAME));
    }
  } catch (final Exception e) {
    if (context.getListener() != null) {
      context.getListener().notifyEvent("typeViewGenerator.finish", new String[0], EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
    }
    log.error("Exception finishing processing", e);
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void initProcess(final ProcessContext context) {
  try {
    if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
      browserFacade.relation(SubscriberView.VIEW_NAME).setAggregatingEnabled(false, false);
    }
  } catch (final Exception e) {
    if (context.getListener() != null) {
      context.getListener().notifyEvent("subscriberViewGenerator.start", new String[0], EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
    }
    log.error("Exception starting processing", e);
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void finishProcess(final ProcessContext context) {
  try {
    if (context.containsKey(Constants.PARAM_MARK_VIEWS_AS_READY)) {
      ViewConstants.markAsReady(browserFacade.relation(
          CategoryView.CATEGORY_VIEW_NAME));
    }
  } catch (final Exception e) {
    if (context.getListener() != null) {
      context.getListener().notifyEvent("institutionView.finish",
          new String[0], EventResultCode.ERROR, StackTraceUtil.getStackTrace(
          e));
    }
    log.error("Exception finishing processing", e);
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

protected void notifyChildrenOfDeleted(String id,
    Set<String> parentsToInvalidate) throws YaddaException,
    BrowseException {
  Selection selection = Query.fields(ElementView.FIELD_PARENT_EXTID)
                .where(Condition.eq(ElementView.FIELD_EXTID, id));
  
  FetcherIterator fi = new FetcherIterator(
      browserFacade.relation(ElementView.ELEMENT_VIEW_NAME)
             .withPageSize(BROWSE_PAGE_SIZE)
             .select(selection), 
      BROWSE_PAGE_SIZE);
  
  while (fi.hasNext()) {
    Serializable[] row = fi.next();
    parentsToInvalidate.add(row[0].toString());
  }
  
}
origin: pl.edu.icm.yadda/yadda-client-common

protected PagingResponse<T> processSelection(Selection sel, String relation,
    int pageSize, Object[] extraData)
    throws BrowseException, ServiceException {
  
  int ps = pageSize > 0 ? pageSize : BUFFER_PAGE_SIZE;
  
  Fetcher fetcher = browser.relation(relation, new String[] {ViewConstants.TAG_READY})
               .withPageSize(ps)
               .select(sel);
  
  List<T> li = decodeResultPage(fetcher, ps, extraData);
  Token t = new Token(fetcher.getCookie(), encodeExtraData(extraData), 0, ps);
  t.setHasNextPage(li.size() >= ps);
  PagingResponse<T> res = new PagingResponse<T>(li, t);
  return res;
}
origin: pl.edu.icm.yadda/bwmeta-process

protected Map<String, Set<ElementTreeNode>> getChildrenFromRelation(
    ElementTreeNode parent) throws BrowseException {
  Map<String, Set<ElementTreeNode>> result = new HashMap<String, Set<ElementTreeNode>>();
  Relation relation = browserFacade.relation(ElementView.ELEMENT_VIEW_NAME)
                   .withPageSize(BROWSE_PAGE_SIZE);
  Selection selection = Query.fields(ElementView.FIELD_PARENT_EXTID, ElementView.FIELD_EXTID,
                    ElementView.FIELD_LEVEL_EXTID, ElementView.FIELD_TEXT,
                    ElementView.FIELD_HIERARCHY)
                .where(Condition.eq(ElementView.FIELD_PARENT_EXTID, parent.getElementExtId()));
  
  FetcherIterator fi = new FetcherIterator(relation.select(selection), BROWSE_PAGE_SIZE);
  while (fi.hasNext()) {
    Serializable[] row = fi.next();
    String hierarchyId = (String) row[4];
    if (result.get(hierarchyId) == null) {
      result.put(hierarchyId, new HashSet<ElementTreeNode>());
    }
    ElementTreeNode child = new ElementTreeNode(row[1].toString());
    child.setParentExtId(parent.getElementExtId());
    child.setParentLevelExtId(parent.getElementLevelExtId());
    child.setParentText(parent.getElementText());
    child.setElementLevelExtId(row[2].toString());
    child.setElementText(row[3].toString());
    result.get(hierarchyId).add(child);
  }
  return result;
}
origin: pl.edu.icm.yadda/yaddaweb-lite-core

@Override
public Fetcher browseSubscribedItems(String libraryId,
    Map<String, String> filters) {
  try {
    Relation rel = browserFacade.relation(SubscriberView.VIEW_NAME,	requiredTags)
                  .withPageSize(1024);
    Selection query = Query.fields(SubscriberView.FIELD_TOP_ELEMENT_ID,
        SubscriberView.FIELD_TOP_ELEMENT_NAME,
        SubscriberView.FIELD_ELEMENT_ID,
        SubscriberView.FIELD_ELEMENT_NAME);
    Fetcher f = rel.select(query
        .where(Condition.eq(SubscriberView.FIELD_CONTRIBUTOR_ID,
            libraryId))
        .upBy(SubscriberView.FIELD_TOP_ELEMENT_NAME_SORTKEY)
        .upBy(SubscriberView.FIELD_TOP_ELEMENT_ID)
        .upBy(SubscriberView.FIELD_ELEMENT_NAME_SORTKEY));
    return f;
  } catch (NoSuchRelationException e) {
    log.error("Error getting subscriptions!", e);
    throw new SystemException(Modules.BROWSER,
        "Error getting subscriptions!", e);
  } catch (NoSuchFieldInRelationException e) {
    log.error("Error getting subscriptions!", e);
    throw new SystemException(Modules.BROWSER,
        "Error getting subscriptions!", e);
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(Chunk data, Map<String, Serializable> context, IProcessListener processListener, ProcessingStats stats) throws Exception {
  final Batch batch = browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).batch();
  for (final CatalogElement catalogElement : data.getItems()) {
    try {
      batch.delete(Condition.eq(ElementPublisherView.FIELD_PUBLISHED_ELEMENT_EXTID, catalogElement.getExtId()));
      if (!catalogElement.isDeleted() && catalogElement.getElement() != null && hasRelatedPublisher(catalogElement)) {
        final List<Serializable[]> tuples = ElementPublisherView.asTuples(catalogElement, contributorInfoBuilder, bwmetaSource);
        for (final Serializable[] tuple : tuples) {
          batch.add(tuple);
        }
      }
    } catch (final Exception e) {
      if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
        browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).setAggregatingEnabled(false, false);
      }
      if (processListener != null) {
        processListener.notifyEvent("elementPublisherViewGenerator.process", new String[]{catalogElement.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      log.error("Exception processing element " + catalogElement.getExtId());
      throw e;
    }
  }
  batch.run();
  return data;
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(final Chunk data,
    final Map<String, Serializable> context,
    final IProcessListener processListener, final ProcessingStats stats)
    throws Exception {
  final Batch batch = browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).batch();
  for (final CatalogElement ce : data.getItems()) {
    try {
      batch.delete(Condition.eq(ContributorView.FIELD_ELEMENT_ID, ce.getExtId()));
      if (!ce.isDeleted() && ce.getElement() != null) {
        final Serializable[][] tuples=ContributorView.asTuples(ce.getElement(), contributorInfoBuilder);
        for (final Serializable[] tuple : tuples) {
          batch.add(tuple);
        }
      }
    } catch (final Exception e) {
      if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
        browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).setAggregatingEnabled(false, false);
      }
      if (processListener != null) {
        processListener.notifyEvent("contributorViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      log.error("Exception processing element " + ce.getExtId());
      throw e;
    }
  }
  batch.run();
  return data;
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(final Chunk data,
    final Map<String, Serializable> context,
    final IProcessListener processListener, final ProcessingStats stats)
    throws Exception {
  final Batch batch = browserFacade.relation(SubscriberView.VIEW_NAME).batch();
  for (final CatalogElement ce : data.getItems()) {
    try {
      batch.delete(Condition.eq(SubscriberView.FIELD_ELEMENT_ID, ce.getExtId()));
      if (!ce.isDeleted() && ce.getElement() != null) {
        final Serializable[][] tuples=SubscriberView.asTuples(ce);
        for (final Serializable[] tuple : tuples) {
          batch.add(tuple);
        }
      }
    } catch (final Exception e) {
      if (processListener != null) {
        processListener.notifyEvent("subscriberViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      log.error("Exception processing element " + ce.getExtId());
      throw e;
    }
  }
  batch.run();
  return data;
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(final Chunk data,
    final Map<String, Serializable> context,
    final IProcessListener processListener,
    final ProcessingStats stats)
    throws Exception {
  final Batch batch = browserFacade.relation(TypeView.TYPE_VIEW_NAME).batch();
  for (final CatalogElement ce : data.getItems()) {
    try {
      if (ce.isDeleted()) {
          batch.delete(Condition.eq(TypeView.FIELD_EXTID, ce.getId().getId()));
      } else if (ce.getElement() == null && ce.getNonElement() != null) {
        String extId = null;
        extId = ce.getNonElement().getExtId();
        final Serializable[] tuple = TypeView.asTuple(ce.getNonElement());
        batch.addOrUpdate(Condition.eq(TypeView.FIELD_EXTID, extId), tuple);
      } else if (ce.isDeleted()) {
        batch.delete(Condition.eq(TypeView.FIELD_EXTID, ce.getExtId()));
      }
    } catch (final Exception e) {
      log.error("Exception processing element " + ce.getExtId());
      if (processListener != null) {
        processListener.notifyEvent("typeViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      throw e;
    }
  }
  batch.run();
  return data;
}
pl.edu.icm.yadda.service2.browse.facadeIBrowserFacaderelation

Javadoc

Returns a relation facade used to access a single named relation.

Popular methods of IBrowserFacade

  • create
    Requests creation of a new relation.
  • forCollection
    Browser interface for given collection name.
  • restoreFetcher
    Restores the fetcher basing on the specified cookie

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • Kernel (java.awt.image)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JLabel (javax.swing)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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