gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YContentEntry类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 17:14:40 28 4
gpt4 key购买 nike

本文整理了Java中pl.edu.icm.model.bwmeta.y.YContentEntry类的一些代码示例,展示了YContentEntry类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YContentEntry类的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YContentEntry
类名称:YContentEntry

YContentEntry介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

protected void fillFormats(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //        format element
  for (YContentEntry<?> yContentEntry : yElement.getContents()) {
    if (yContentEntry.isFile()) {
      if (!ret.containsKey(E_FORMAT)) {
        ret.put(E_FORMAT, new ArrayList<StringWithAttributes>());
      }
      ret.get(E_FORMAT).add(new StringWithAttributes(((YContentFile) yContentEntry).getFormat()));
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

private List<YContentFile> processPlainTextEntry(final YContentEntry<?> yEntry) {
  final List<YContentFile> result = new ArrayList<YContentFile>();
  if (yEntry.isDirectory()) {
    final YContentDirectory yDirectory = (YContentDirectory) yEntry;
    for (final YContentEntry<?> yChild : yDirectory.getEntries()) {
      result.addAll(processPlainTextEntry(yChild));
    }
  } else if (yEntry.isFile() && YConstants.FT_PLAIN_TEXT.equals(((YContentFile) yEntry).getType())) {
    result.add((YContentFile) yEntry);
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

@SuppressWarnings({ "rawtypes", "unchecked" })
private static YElement correctContentByPhantomRemoval(YElement yelement) {
  LinkedList<YContentEntry> ycel = new LinkedList<YContentEntry>();
  for(YContentEntry yce : yelement.getContents()){
    LinkedList<YName> ynl = new LinkedList<YName>();
    for(YName yn : (List<YName>)(yce.getNames())){
      List<Part> lp = putNameNodesIntoLeafs(yn.getRichText().toParts());
      if(lp.size()>0){
        yn.setText(new YRichText(lp));
        ynl.add(yn);
      }
    }
    if(ynl.size()>0){
      yce.setNames(ynl);
      ycel.add(yce);
    }
  }
  yelement.setContents(ycel);
  return yelement;
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

@SuppressWarnings("rawtypes")
private List<ContentInfo> getContentInfo(YContentEntry entry){
  if(entry.isDirectory()){
    return getContentInfo((YContentDirectory) entry);
  } else {
    return getContentInfo((YContentFile) entry);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private YContentDirectory findChapter(String id, YElement elements, List<String> chapters) {
    Queue<YContentEntry> fifo = new LinkedList<YContentEntry>();
    YContentDirectory foundChapter = null;
    fifo.addAll(elements.getContents());
    while (!fifo.isEmpty()) {
      YContentEntry e = fifo.poll();
      if (e.isDirectory()) {
        YContentDirectory dir = (YContentDirectory) e;
        if (dir.getType().equals(YConstants.CONTENT_PAGED)) {
          chapters.add(dir.getId());
          if (id == null) {
            if (foundChapter == null) {
              foundChapter = dir;
            }
          } else if (id.equals(dir.getId())) {
            foundChapter = dir;
          }
        } else {
          fifo.addAll(dir.getEntries());
        }
      }
    }
    return foundChapter;
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private List<Page> resolveChapter(YContentDirectory dir) {
  List<Page> result = new LinkedList<Page>();
  for (YContentEntry e : dir.getEntries()) {
    if (e.isFile()) {
      result.add(resolveFile((YContentFile) e));
    } else {
      result.add(resolveMultiFile((YContentDirectory) e));
    }
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

@SuppressWarnings({ "rawtypes", "unchecked" })
  private static YElement correctContentByPhantomRemoval(YElement yelement) {
    LinkedList<YContentEntry> ycel = new LinkedList<YContentEntry>();
    int i =0;
    for(YContentEntry yce : yelement.getContents()){
      i++;
//            if(i==6){
//                System.out.println();
//            }
      LinkedList<YName> ynl = new LinkedList<YName>();
      for(YName yn : (List<YName>)(yce.getNames())){
        List<Part> lp = putNameNodesIntoLeafs(yn.getRichText().toParts());
        if(lp.size()>0){
          yn.setText(new YRichText(lp));
          ynl.add(yn);
        }
      }
      if(ynl.size()>0){
        yce.setNames(ynl);
        ycel.add(yce);
      }
    }
    yelement.setContents(ycel);
    return yelement;
  }

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

private boolean isLicensedContent(ElementMetadata elementMetadata, String contentPath) {
  YElement yElement = (YElement) elementMetadata.getContent();
  for (YContentEntry<?> entry : yElement.getContents()) {
    if (entry.isFile()) {
      YContentFile contentFile = (YContentFile) entry;
      if (contentFile.getLocations().contains(contentPath) && notLicensedContentTypes != null
          && notLicensedContentTypes.contains(contentFile.getType())) {
        return false;
      }
    }
  }
  return true;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

protected String resolveCoverUrl(YElement element) {
   for (YContentEntry e : element.getContents()) {
     if (e.isFile()) {
       YContentFile cFile = (YContentFile) e;
       String location = cFile.getLocations().get(0);
       if (location != null && ((cFile.getType() != null &&
cFile.getType().equals("cover") || anyContentAsCover))) {
         return "download/" + location.replace("yar://", "");
       }
     }
   }
   return null;
 }

代码示例来源:origin: pl.edu.icm.coansys/coansys-io-input

private void handleContent(DocumentDTO docDTO, @SuppressWarnings("rawtypes") YContentEntry content,
    ZipArchive currentZipArchive, long contentSizeLimit) {
  if (content.isFile()) {
    YContentFile yFile = (YContentFile) content;
    if (BWMetaConstants.mimePdfListExtension.contains(yFile.getFormat())) {
      fetchMediaFromZip(docDTO, yFile, currentZipArchive, ProtoConstants.mediaTypePdf, contentSizeLimit);
    } else if (BWMetaConstants.mimeTxtListExtension.contains(yFile.getFormat())) {
      fetchMediaFromZip(docDTO, yFile, currentZipArchive, ProtoConstants.mediaTypeTxt, contentSizeLimit);
    }
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-process-common

/**
 * Checks if the {@code YElement} has {@code FT_COVER} of {@code FileTypes}.
 * 
 * @param element,
 *            {@code YElement} used to validation. @return, true if
 *            {@code YElement} has correct structure and cover is present,
 *            or false otherwise.
 */
@SuppressWarnings("rawtypes")
public boolean hasCover(YElement element) {
  if (null == element) {
    return false;
  }
  for (YContentEntry entry : element.getContents()) {
    if (!entry.isFile()) {
      continue;
    }
    YContentFile contentFile = (YContentFile) entry;
    if (FileTypes.FT_COVER.equals(contentFile.getType())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

protected void fillFormats(HtmlMetaHeaders metadata, YElement yElement) {
  for (YContentEntry<?> yContentEntry : yElement.getContents()) {
    if (yContentEntry.isFile()) {
      YContentFile yContentFile = (YContentFile) yContentEntry;
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_FORMAT, yContentFile.getFormat());
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private Page resolveMultiFile(YContentDirectory dir) {
  Page result = new Page();
  if (dir.getType().equals(YConstants.CONTENT_MULTI_TYPE)) {
    for (YContentEntry e : dir.getEntries()) {
      if (e.isFile()) {
        YContentFile file = (YContentFile) e;
        if (!file.getLocations().isEmpty()) {
          String location = file.getLocations().get(0)
              .replace("yar://", "");
          if (file.getType().equals(YConstants.FT_PLAIN_TEXT)) {
            result.setText(location);
          } else {
            result.setScan(location);
          }
        }
      }
    }
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

List<Content> contents = new LinkedList<Content>();
for (YContentEntry<?> content : element.getContents()) {
  if (content.isFile()) {
    YContentFile file = (YContentFile) content;
    if (YConstants.FT_PLAIN_TEXT.equals(file.getType())) {

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private YDirectory resolveDirectory(YContentDirectory dir, IFilteringContext filteringContext,
    ContentResolvingContext contentResolvingContext) {
  
  YDirectory result = new YDirectory(dir.getId(), dir.getType(), getFolderName(dir));
  List<Content> cList = new LinkedList<Content>();
  boolean containsAvailableFile = false;
  for (YContentEntry<?> entry : dir.getEntries()) {
    if (!entry.isFile()) {
      YDirectory toBeAdded = resolveDirectory((YContentDirectory) entry, filteringContext, 
          contentResolvingContext);
      if (toBeAdded.isContainsAvailableFile()) {
        containsAvailableFile = true;
      }
      cList.add(toBeAdded);
    } else {
      YFile toBeAdded = resolveFile((YContentFile) entry, filteringContext, dir.getType(), 
          contentResolvingContext);
      if (toBeAdded.isAvailable()) {
        containsAvailableFile = true;
      }
      cList.add(toBeAdded);
    }
  }
  result.setContents(cList);
  result.setContainsAvailableFile(containsAvailableFile);
  return result;
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl

if (yContentEntry.isFile()) {
  YContentFile file = (YContentFile) yContentEntry;
  String type = file.getType();

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com