gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YContentFile.getId()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 13:50:40 31 4
gpt4 key购买 nike

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

YContentFile.getId介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.ceon/ceon-converters-commons

public void addFile(Entry file) {
  if (!this.files.contains(file)) {
   this.files.add(file);
  } else {
    log.warn("Trying to add second file: "+file.description.getId()+" skipping");
  }
}

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

public void addFile(Entry file) {
  if (!this.files.contains(file)) {
   this.files.add(file);
  } else {
    log.warn("Trying to add second file: "+file.description.getId()+" skipping");
  }
}

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

private boolean checkIfContentPresent(final YElement yElement, final String fileId) {
  for (YContentEntry<?> content : yElement.getContents()) {
    if (content instanceof YContentFile) {
      if (StringUtils.equals(((YContentFile) content).getId(), fileId)) {
        return true;
      }
    }
  }
  return false;
}

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

@Override
  public void doWithFile(YContentFile yfile) {
    if (contentId.equals(yfile.getId())) {
      List<String> locations = yfile.getLocations();
      if (locations.size() > 0) {
        location = locations.iterator().next();
      }
    }
  }
};

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@SuppressWarnings("rawtypes")
private YContentFile findYContentFileById(Iterable<YContentEntry> contents, String id) {
  for (YContentEntry<?> contentEntry : contents) {
    if (contentEntry instanceof YContentFile) {
      YContentFile contentFile = (YContentFile) contentEntry;
      if (contentFile.getId().equals(id)) {
        return contentFile;
      }
    } else {
      YContentDirectory directory = (YContentDirectory) contentEntry;
      return findYContentFileById(directory.getEntries(), id);
    }
  }
  return null;
}

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

private String extractId(YContentFile yFile) {
  YName fileNameCandidate = yFile.getOneName(NameTypes.NM_FILE_NAME);
  if (fileNameCandidate == null) {
    fileNameCandidate = yFile.getOneName();
  }
  
  if (fileNameCandidate == null) {
    return yFile.getId();
  } else {
    return fileNameCandidate.getText();
  }
}

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

private FLocat createContentLocation(String elementId, YContentFile yfile) {
  FLocat fLocat = new FLocat();
  fLocat.setLOCTYPE("HANDLE"); 
  fLocat.setHref(yfile.getId());			
  return fLocat;
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
public DataResponse apply(YElement input) {
  ZipFile zipFile = processorState.getZipFile();
  ZipEntry lastEntry = processorState.getLastZipEntry();
  YAttribute attribute = new YAttribute(CommonExtractorContstants.SOURCE_ATTRIBUTE, zipFile.getName() + "/" + lastEntry.getName());
  input.getAttributes().add(attribute);
  DataResponse dataResponse = new DataResponse(input, dataResponseQualityComparator);
  for (YContentFile file : createIterable(input.getContents())) {
    String id = file.getId();
    String fileName = file.getLocations().get(0);
    ZipEntry entry = zipFile.getEntry(fileName);
    if (entry != null) {
      dataResponse.addContent(id, new ZipEntryResource(zipFile.getName(), entry));
    }
  }
  if(insertSource){
    dataResponse.addContent(CommonExtractorContstants.SOURCE_ATTRIBUTE, new ZipEntryResource(zipFile.getName(), lastEntry));
  }
  return dataResponse;
}

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

private List<ContentFileData> findChapterPages(List<YContentEntry> chapterEntries, Locale locale, String mainLevel) {
  List<ContentFileData> result = new ArrayList<ContentFileData>();
  for (YContentEntry<?> content : chapterEntries) {
    if (content instanceof YContentFile) {
      YContentFile file = (YContentFile) content;
      if (yModelPropertyExtractor.isFileAccepted(file, mainLevel)) {
        result.add(new ContentFileData(file.getId(), YModelUtils.getDefaultName(file), fetchName(file.getFormat(), locale), yModelPropertyExtractor.prepareLocation(file.getLocations())));
      }
    } else if (content instanceof YContentDirectory) {
      YContentDirectory dir = (YContentDirectory) content;
      if (ContentTypes.CONTENT_MULTI_TYPE.equals(dir.getType())) {
        result.addAll(findChapterPages(dir.getEntries(), locale, mainLevel));
      }
    }
  }
  return result;
}

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

private List<ContentInfo> getContentInfo(YContentFile file){
  Collection<String> names = convertNames(file.getNames());
  
  ContentInfo contentInfo = new ContentInfo.Builder(file.getFormat(), file.getId())
                        .locations(file.getLocations())
                        .names(names)
                        .type(file.getType())
                        .build();
  
  return Arrays.asList(contentInfo);
}

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

id = Long.parseLong(file.getId());
} catch (NumberFormatException ex) {
  id = 0;

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

private List<ContentEntryData> translateContent(List<YContentEntry> contentList, Locale locale, String mainLevel) {
  List<ContentEntryData> result = new ArrayList<ContentEntryData>();
  for (YContentEntry<?> content : contentList) {
    if (content instanceof YContentFile) {
      YContentFile file = (YContentFile) content;
      if (yModelPropertyExtractor.isFileAccepted(file, mainLevel)) {
        result.add(new ContentFileData(file.getId(), YModelUtils.getDefaultName(file), fetchName(file.getFormat(), locale), yModelPropertyExtractor.prepareLocation(file.getLocations())));
      }
    } else if (content instanceof YContentDirectory) {
      YContentDirectory dir = (YContentDirectory) content;
      if (ContentTypes.CONTENT_PAGED.equals(dir.getType()) && findIfContentExists(dir.getEntries(), mainLevel)) {
        result.add(new ContentDirectoryData(dir.getId(), getDirectoryName(dir), dir.getType(), fetchName(dir.getType(), locale)));
      } else if(findIfContentExists(dir.getEntries(), mainLevel)) {
        result.add(new ContentDirectoryData(dir.getId(), getDirectoryName(dir), dir.getType(), fetchName(dir.getType(), locale), translateContent(dir.getEntries(), locale, mainLevel)));
      }
    }
  }
  return result;
}

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

description.setDescriptions(template.getDescriptions());
description.setFormat(template.getFormat());
description.setId(template.getId());
description.setLanguages(template.getLanguages());
description.setLocations(template.getLocations());

代码示例来源:origin: pl.edu.icm.ceon/ceon-converters-commons

description.setDescriptions(template.getDescriptions());
description.setFormat(template.getFormat());
description.setId(template.getId());
description.setLanguages(template.getLanguages());
description.setLocations(template.getLocations());

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

final String fileName = file.getOneName().getText();
final String location = file.getLocations().get(0);
result.addContent(new ResourceData.ResourceFileData(file.getId(), fileName, location, file.getType()));

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