Tabnine Logo
Context.formatForPrefix
Code IndexAdd Tabnine to your IDE (free)

How to use
formatForPrefix
method
in
com.lyncode.xoai.dataprovider.model.Context

Best Java code snippets using com.lyncode.xoai.dataprovider.model.Context.formatForPrefix (Showing top 7 results out of 315)

origin: com.lyncode/xoai-data-provider

private List<ScopedFilter> getScopedFilters(Context context, String metadataPrefix) throws CannotDisseminateFormatException {
  List<ScopedFilter> filters = new ArrayList<ScopedFilter>();
  if (context.hasCondition())
    filters.add(new ScopedFilter(context.getCondition(), Scope.Context));
  MetadataFormat metadataFormat = context.formatForPrefix(metadataPrefix);
  if (metadataFormat.hasCondition())
    filters.add(new ScopedFilter(metadataFormat.getCondition(), Scope.MetadataFormat));
  return filters;
}
origin: IQSS/dataverse

@Override
public GetRecord handle(OAICompiledRequest parameters) throws OAIException, HandlerException {        
  MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
  Item item = getRepository().getItemRepository().getItem(parameters.getIdentifier());
  if (getContext().hasCondition() &&
      !getContext().getCondition().getFilter(getRepository().getFilterResolver()).isItemShown(item))
    throw new IdDoesNotExistException("This context does not include this item");
  if (format.hasCondition() &&
      !format.getCondition().getFilter(getRepository().getFilterResolver()).isItemShown(item))
    throw new CannotDisseminateRecordException("Format not applicable to this item");
  
  Xrecord record = this.createRecord(parameters, item);
  GetRecord result = new XgetRecord(record);
  
  return result;
}

origin: IQSS/dataverse

private Xrecord createRecord(OAICompiledRequest parameters, Item item)
    throws BadArgumentException, CannotDisseminateRecordException,
    OAIException, NoMetadataFormatsException, CannotDisseminateFormatException {
  MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
  Header header = new Header();
  
  Dataset dataset = ((Xitem)item).getDataset();
  Xrecord xrecord = new Xrecord().withFormatName(parameters.getMetadataPrefix()).withDataset(dataset);
  header.withIdentifier(item.getIdentifier());
  ItemHelper itemHelperWrap = new ItemHelper(item);
  header.withDatestamp(item.getDatestamp());
  for (Set set : itemHelperWrap.getSets(getContext(), getRepository().getFilterResolver()))
    header.withSetSpec(set.getSpec());
  if (item.isDeleted())
    header.withStatus(Header.Status.DELETED);
  xrecord.withHeader(header);
  xrecord.withMetadata(item.getMetadata());
  
  return xrecord;
}
origin: IQSS/dataverse

private Record createRecord(OAICompiledRequest parameters, Item item)
    throws BadArgumentException, CannotDisseminateRecordException,
    OAIException, NoMetadataFormatsException, CannotDisseminateFormatException {
  MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
  Header header = new Header();
  
  Dataset dataset = ((Xitem)item).getDataset();
  Xrecord xrecord = new Xrecord().withFormatName(parameters.getMetadataPrefix()).withDataset(dataset);
  header.withIdentifier(item.getIdentifier());
  ItemHelper itemHelperWrap = new ItemHelper(item);
  header.withDatestamp(item.getDatestamp());
  for (Set set : itemHelperWrap.getSets(getContext(), getRepository().getFilterResolver()))
    header.withSetSpec(set.getSpec());
  if (item.isDeleted())
    header.withStatus(Header.Status.DELETED);
  xrecord.withHeader(header);
  xrecord.withMetadata(item.getMetadata());
  
  return xrecord;
}
origin: com.lyncode/xoai-data-provider

private Header createHeader(OAICompiledRequest parameters,
                ItemIdentifier itemIdentifier) throws BadArgumentException,
    OAIException,
    NoMetadataFormatsException {
  MetadataFormat format = getContext().formatForPrefix(parameters
      .getMetadataPrefix());
  if (!itemIdentifier.isDeleted() && !canDisseminate(itemIdentifier, format))
    throw new InternalOAIException("The item repository is currently providing items which cannot be disseminated with format "+format.getPrefix());
  Header header = new Header();
  header.withDatestamp(itemIdentifier.getDatestamp());
  header.withIdentifier(itemIdentifier.getIdentifier());
  if (itemIdentifier.isDeleted())
    header.withStatus(Header.Status.DELETED);
  for (Set set : getContext().getSets())
    if (set.getCondition().getFilter(getRepository().getFilterResolver()).isItemShown(itemIdentifier))
      header.withSetSpec(set.getSpec());
  for (Set set : itemIdentifier.getSets())
    header.withSetSpec(set.getSpec());
  return header;
}
origin: com.lyncode/xoai-data-provider

private Record createRecord(OAICompiledRequest parameters, Item item)
    throws BadArgumentException, CannotDisseminateRecordException,
    OAIException, NoMetadataFormatsException, CannotDisseminateFormatException {
  MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
  Header header = new Header();
  Record record = new Record().withHeader(header);
origin: com.lyncode/xoai-data-provider

GetRecord result = new GetRecord(record);
MetadataFormat format = getContext().formatForPrefix(parameters.getMetadataPrefix());
Item item = getRepository().getItemRepository().getItem(parameters.getIdentifier());
com.lyncode.xoai.dataprovider.modelContextformatForPrefix

Popular methods of Context

  • <init>
  • getCondition
  • hasCondition
  • withMetadataFormat
  • formatFor
  • getMetadataFormats
  • getSet
  • getSets
  • getTransformer
  • hasSet
  • hasTransformer
  • isStaticSet
  • hasTransformer,
  • isStaticSet

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for Android Studio
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