org.dspace.content.Bitstream.getDescription()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(177)

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

Bitstream.getDescription介绍

[英]Get the description of this bitstream - optional free text, typically provided by a user at submission time
[中]获取此位流的描述-可选自由文本,通常由用户在提交时提供

代码示例

代码示例来源:origin: DSpace/DSpace

static int countBitstreamByDesc(BundleName bundleName, Item item, String[] descList) {
  int count = 0;
  for (Bundle bundle : item.getBundles()) {
    if (!bundle.getName().equals(bundleName.name())) {
      continue;
    }
    for (Bitstream bit : bundle.getBitstreams()) {
      for (String desc : descList) {
        String bitDesc = bit.getDescription();
        if (bitDesc == null) {
          continue;
        }
        if (bitDesc.equals(desc.trim())) {
          count++;
        }
      }
    }
  }
  return count;
}

代码示例来源:origin: DSpace/DSpace

String description = bit.getDescription();

代码示例来源:origin: DSpace/DSpace

public void removeBitstream(Context context, Item item, Bitstream bitstream,
              boolean keep)
  throws SQLException, AuthorizeException, IOException {
  Bundle exempt = null;
  if (keep) {
    exempt = this.archiveBitstream(context, item, bitstream);
  }
  Iterator<Bundle> bundles = bitstream.getBundles()
                    .iterator();
  while (bundles.hasNext()) {
    Bundle bundle = bundles.next();
    if (exempt != null &&
      bundle.getID() != exempt.getID()) {
      bundles.remove();
      bundleService
        .removeBitstream(context, bundle,
                 bitstream);
    }
  }
  // there is nowhere in the metadata to say when this file was moved, so we
  // are going to drop it into the description
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
  String desc = bitstream.getDescription();
  String newDesc = "[Deleted on: " + sdf.format(new Date()) + "] ";
  if (desc != null) {
    newDesc += desc;
  }
  bitstream.setDescription(context, newDesc);
  bitstreamService.update(context, bitstream);
}

代码示例来源:origin: DSpace/DSpace

String oldName = myName;
String description = bitstream.getDescription();
if (!StringUtils.isEmpty(description)) {
  description = "\tdescription:" + description;

代码示例来源:origin: DSpace/DSpace

newBitstream.setDescription(context, bitstream.getDescription());
newBitstream.setFormat(context, bitstream.getFormat(context));
newBitstream.setSource(context, bitstream.getSource());

代码示例来源:origin: DSpace/DSpace

@Override
  public void additionalIndex(Context context, DSpaceObject dso, SolrInputDocument document) {
    if (dso instanceof Item) {
      Item item = (Item) dso;
      List<Bundle> bundles = item.getBundles();
      if (bundles != null) {
        for (Bundle bundle : bundles) {
          String bundleName = bundle.getName();
          if ((bundleName != null) && bundleName.equals(BUNDLE_NAME)) {
            List<Bitstream> bitstreams = bundle.getBitstreams();
            if (bitstreams != null) {
              for (Bitstream bitstream : bitstreams) {
                document.addField(SOLR_FIELD_NAME_FOR_FILENAMES, bitstream.getName());

                String description = bitstream.getDescription();
                if ((description != null) && (!description.isEmpty())) {
                  document.addField(SOLR_FIELD_NAME_FOR_DESCRIPTIONS, description);
                }
              }
            }
          }
        }
      }
    }
  }
}

代码示例来源:origin: org.dspace/dspace-xmlui-api

validityKey.append(bitstream.getName());
validityKey.append(bitstream.getSource());
validityKey.append(bitstream.getDescription());
validityKey.append(bitstream.getChecksum());
validityKey.append(bitstream.getChecksumAlgorithm());

代码示例来源:origin: DSpace/DSpace

/**
   * Add the bitstream metadata to the item
   *
   * @param item      The item
   * @param bitstream The bitstream
   * @param type      The type of bitstream
   * @throws SQLException An exception that provides information on a database access error or other errors.
   */
  protected void addMetadata(Item item, Bitstream bitstream, String type) throws SQLException {
    String value = bitstream.getFormat(Curator.curationContext()).getMIMEType() + "##";
    value += bitstream.getName() + "##";
    value += bitstream.getSizeBytes() + "##";
    value += item.getHandle() + "##";
    value += bitstream.getSequenceID() + "##";
    value += bitstream.getChecksum() + "##";
    if (bitstream.getDescription() != null) {
      value += bitstream.getDescription();
    }
    itemService.addMetadata(Curator.curationContext(), item, "dc", "format", type, "en", value);
  }
}

代码示例来源:origin: DSpace/DSpace

description = bitstream.getDescription();
format = bitstreamService.getFormatDescription(context, bitstream);
sizeBytes = bitstream.getSizeBytes();

代码示例来源:origin: DSpace/DSpace

dc.add(makeDC("title", "alternative", bsSource));
String bsDesc = bitstream.getDescription();
if (bsDesc != null) {
  dc.add(makeDC("description", null, bsDesc));

代码示例来源:origin: DSpace/DSpace

citedBitstream.setDescription(context, bitstream.getDescription());

代码示例来源:origin: org.dspace/dspace-xmlui-api

row.addCell().addContent(bitstream.getDescription());
row.addCell().addContent(format);

代码示例来源:origin: DSpace/DSpace

String oname = bit.getSource();
String name = bit.getName();
String description = bit.getDescription();

代码示例来源:origin: DSpace/DSpace

String desc = bitstream.getDescription();
if ("".equals(desc) || desc == null) {
  desc = bitstream.getName();

代码示例来源:origin: org.dspace/dspace-xmlui-api

String description = bitstream.getDescription();

代码示例来源:origin: org.dspace/dspace-jspui-api

String desc = primaryBitstream.getDescription();
out.print((desc != null) ? desc : "");
        .print("</td><td headers=\"t2\" class=\"standard\">");
      String desc = bitstreams[k].getDescription();
      out.print((desc != null) ? desc : "");

代码示例来源:origin: org.dspace/dspace-xmlui-api

String description = bitstream.getDescription();
String format = null;
BitstreamFormat bitstreamFormat = bitstream.getFormat();

代码示例来源:origin: org.dspace/dspace-xmlui-api

String url = makeBitstreamLink(item, bitstream);
long bytes = bitstream.getSize();
String desc = bitstream.getDescription();
String algorithm = bitstream.getChecksumAlgorithm();
String checksum = bitstream.getChecksum();

代码示例来源:origin: org.dspace/dspace-xmlui-api

description.setLabel(T_description);
description.setHelp(T_description_help);
description.setValue(bitstream.getDescription());

代码示例来源:origin: org.dspace/dspace-xmlui-api

description.setLabel(T_description_label);
description.setHelp(T_description_help);
description.setValue(bitstream.getDescription());

相关文章