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

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

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

Bundle.getID介绍

暂无

代码示例

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

@Override
public int hashCode() {
  int hash = 5;
  hash += 71 * hash + getType();
  hash += 71 * hash + getID().hashCode();
  return hash;
}

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

@Override
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
  if (this.getClass() != objClass) {
    return false;
  }
  final Bundle other = (Bundle) obj;
  if (this.getType() != other.getType()) {
    return false;
  }
  if (!this.getID().equals(other.getID())) {
    return false;
  }
  return true;
}

代码示例来源: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: org.dspace/dspace-jspui-api

bundlePolicies.put(Integer.valueOf(myBundle.getID()), myPolicies);

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

protected void deleteBundle(Context context, Item item, Bundle b)
  throws AuthorizeException, SQLException, IOException {
  // Check authorisation
  authorizeService.authorizeAction(context, item, Constants.REMOVE);
  bundleService.delete(context, b);
  log.info(LogManager.getHeader(context, "remove_bundle", "item_id="
    + item.getID() + ",bundle_id=" + b.getID()));
  context
    .addEvent(new Event(Event.REMOVE, Constants.ITEM, item.getID(), Constants.BUNDLE, b.getID(), b.getName()));
}

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

@Override
public void removeBundle(Context context, Item item, Bundle bundle)
  throws SQLException, AuthorizeException, IOException {
  // Check authorisation
  authorizeService.authorizeAction(context, item, Constants.REMOVE);
  log.info(LogManager.getHeader(context, "remove_bundle", "item_id="
    + item.getID() + ",bundle_id=" + bundle.getID()));
  context.addEvent(new Event(Event.REMOVE, Constants.ITEM, item.getID(),
                Constants.BUNDLE, bundle.getID(), bundle.getName(), getIdentifiers(context, item)));
  bundleService.delete(context, bundle);
}

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

@Override
public Bundle create(Context context, Item item, String name) throws SQLException, AuthorizeException {
  if (StringUtils.isBlank(name)) {
    throw new SQLException("Bundle must be created with non-null name");
  }
  authorizeService.authorizeAction(context, item, Constants.ADD);
  // Create a table row
  Bundle bundle = bundleDAO.create(context, new Bundle());
  bundle.setName(context, name);
  itemService.addBundle(context, item, bundle);
  if (!bundle.getItems().contains(item)) {
    bundle.addItem(item);
  }
  log.info(LogManager.getHeader(context, "create_bundle", "bundle_id="
    + bundle.getID()));
  // if we ever use the identifier service for bundles, we should
  // create the bundle before we create the Event and should add all
  // identifiers to it.
  context.addEvent(new Event(Event.CREATE, Constants.BUNDLE, bundle.getID(), null));
  return bundle;
}

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

"Bundle: " + bundle.getID() + ", bitstream id: " + bitstreamId));
  continue;
                 "Encountered a bitstream not in this bundle while changing bitstream " +
                   "order. Bitstream order will not be changed.",
                 "Bundle: " + bundle.getID() + ", bitstream id: " + bitstreamId));
  return;
               "Size of old list and new list do not match. Bitstream order will not be " +
                 "changed.",
               "Bundle: " + bundle.getID()));
return;

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

List<Item> items = bundle.getItems();
if (items.isEmpty()) {
  log.error("Found orphaned bundle: " + bundle.getID());
  throw new DSpaceSWORDException("Orphaned bundle discovered");

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

@Override
public void delete(Context context, Bundle bundle) throws SQLException, AuthorizeException, IOException {
  log.info(LogManager.getHeader(context, "delete_bundle", "bundle_id="
    + bundle.getID()));
  authorizeService.authorizeAction(context, bundle, Constants.DELETE);
  context.addEvent(new Event(Event.DELETE, Constants.BUNDLE, bundle.getID(),
                bundle.getName(), getIdentifiers(context, bundle)));
  // Remove bitstreams
  List<Bitstream> bitstreams = bundle.getBitstreams();
  bundle.clearBitstreams();
  for (Bitstream bitstream : bitstreams) {
    removeBitstream(context, bundle, bitstream);
  }
  List<Item> items = new LinkedList<>(bundle.getItems());
  bundle.getItems().clear();
  for (Item item : items) {
    item.removeBundle(bundle);
  }
  // Remove ourself
  bundleDAO.delete(context, bundle);
}

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

@Override
public void addBundle(Context context, Item item, Bundle bundle) throws SQLException, AuthorizeException {
  // Check authorisation
  authorizeService.authorizeAction(context, item, Constants.ADD);
  log.info(LogManager.getHeader(context, "add_bundle", "item_id="
    + item.getID() + ",bundle_id=" + bundle.getID()));
  // Check it's not already there
  if (item.getBundles().contains(bundle)) {
    // Bundle is already there; no change
    return;
  }
  // now add authorization policies from owning item
  // hmm, not very "multiple-inclusion" friendly
  authorizeService.inheritPolicies(context, item, bundle);
  // Add the bundle to in-memory list
  item.addBundle(bundle);
  bundle.addItem(item);
  context.addEvent(new Event(Event.ADD, Constants.ITEM, item.getID(),
                Constants.BUNDLE, bundle.getID(), bundle.getName(),
                getIdentifiers(context, item)));
}

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

@Override
public void update(Context context, Bundle bundle) throws SQLException, AuthorizeException {
  // Check authorisation
  //AuthorizeManager.authorizeAction(ourContext, this, Constants.WRITE);
  log.info(LogManager.getHeader(context, "update_bundle", "bundle_id="
    + bundle.getID()));
  super.update(context, bundle);
  bundleDAO.save(context, bundle);
  if (bundle.isModified() || bundle.isMetadataModified()) {
    if (bundle.isMetadataModified()) {
      context.addEvent(new Event(Event.MODIFY_METADATA, bundle.getType(), bundle.getID(), bundle.getDetails(),
                    getIdentifiers(context, bundle)));
    }
    context.addEvent(new Event(Event.MODIFY, Constants.BUNDLE, bundle.getID(),
                  null, getIdentifiers(context, bundle)));
    bundle.clearModified();
    bundle.clearDetails();
  }
}

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

if (items.length == 0)
  log.error("Found orphaned bundle: " + bundles[0].getID());
  throw new DSpaceSWORDException("Orphaned bundle discovered");

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

"bundle_id=" + bundle.getID() + ",bitstream_id=" + bitstream.getID()));
context.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, bundle.getID(),
              Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()),
              getIdentifiers(context, bundle)));

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

+ bundle.getID() + ",bitstream_id=" + bitstream.getID()));
context.addEvent(new Event(Event.ADD, Constants.BUNDLE, bundle.getID(),
              Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()),
              getIdentifiers(context, bundle)));

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

if (bundle.getID() != pBundle.getID()) {
  bundleService.addBitstream(context, pBundle, bitstream);
  bundleService.removeBitstream(context, bundle, bitstream);

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

if(inputKey.startsWith(bundle.getID() + "_")){
  String[] vals = request.getParameter(inputKey).split(",");
  for (int i = 0; i < vals.length; i++) {

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

System.out.println("Bundle " + bundle.getID());

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

+ si.getBundle().getID() + "\"/>";

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

subheader.addCell(null, null, 1, 4, "indent").addHighlight("bold").addContent(T_subhead_bundle.parameterize(bundle.getName(),bundle.getID()));
subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_bundle_" + bundle.getID(), T_add_bundlePolicy_link);
this.rowBuilder(baseURL, table, bundlePolicies, bundle.getID(), Constants.BUNDLE, highlightID);

相关文章