/** * @return Return the URL for editing this item */ protected String getMETSOBJEDIT() { return contextPath+"/admin/item?itemID=" + item.getID(); }
public void onClick(View arg0) { // TODO Auto-generated method stub // To get the item from the listView for which the Add to Cart button is pressed Item item = getItem(position); // Delete the item from the cart by pressing the delete item button DatabaseHelper db = new DatabaseHelper(getContext()); db.deleteItemFromCart(item.getID()); remove(item); // Update the listView to reflect the changes notifyDataSetChanged(); } }
public void deleteItem(Item item){ SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_ITEMS, KEY_ID + " = ?", new String[]{String.valueOf(item.getID())}); db.close(); }
@Override public int hashCode() { int hash = 5; hash += 71 * hash + getType(); hash += 71 * hash + getID().hashCode(); return hash; }
@Override public boolean equals(Object object){ if(object instanceof Item){ Item item = (Item) object; if( this.getID() == item.getID() && this.getPrice() == item.getPrice()) { return true; } } return false; }
public String getOreStatementUri(Item item) throws DSpaceSwordException { return this.getSwordBaseUrl() + "/statement/" + item.getID() + ".rdf"; }
@Override public BasicWorkflowItem startWithoutNotify(Context c, WorkspaceItem wsi) throws SQLException, AuthorizeException, IOException { // make a hash table entry with item ID for no notify // notify code checks no notify hash for item id noEMail.put(wsi.getItem().getID(), Boolean.TRUE); return start(c, wsi); }
public IRI getMediaFeedUrl(Item item) throws DSpaceSwordException { return new IRI(this.getSwordBaseUrl() + "/edit-media/" + item.getID() + ".atom"); } }
public IRI getEditIRI(Item item) throws DSpaceSwordException { return new IRI(this.getSwordBaseUrl() + "/edit/" + item.getID()); }
public IRI getContentUrl(Item item) throws DSpaceSwordException { return new IRI(this.getSwordBaseUrl() + "/edit-media/" + item.getID()); }
@Override public void inheritCollectionDefaultPolicies(Context context, Item item, Collection collection) throws SQLException, AuthorizeException { adjustItemPolicies(context, item, collection); adjustBundleBitstreamPolicies(context, item, collection); log.debug(LogManager.getHeader(context, "item_inheritCollectionDefaultPolicies", "item_id=" + item.getID())); }
stm = db.prepareStatement("INSERT INTO ITEM (ID, TYPE, TITEL, UITGELEEND) VALUES (?, ?, ?, ?)"); db.setAutoCommit(false); for (int n = 0; n < ItemLijst.getItems().size(); n++) { Item huidigItem = ItemLijst.getItemObvIdx(n); stm.setString(1, huidigItem.getID().toString()); stm.setString(2, huidigItem.getType().toString()); stm.setString(3, huidigItem.getTitel()); stm.setString(4,String.valueOf(huidigItem.isUitgeleend())); stm.addBatch(); } stm.executeBatch(); db.commit();
@Override public Item create(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException { if (workspaceItem.getItem() != null) { throw new IllegalArgumentException( "Attempting to create an item for a workspace item that already contains an item"); } Item item = createItem(context); workspaceItem.setItem(item); log.info(LogManager.getHeader(context, "create_item", "item_id=" + item.getID())); return item; }
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())); }
@Override public void updateLastModified(Context context, Item item) throws SQLException, AuthorizeException { item.setLastModified(new Date()); update(context, item); //Also fire a modified event since the item HAS been modified context.addEvent(new Event(Event.MODIFY, Constants.ITEM, item.getID(), null, getIdentifiers(context, item))); }
@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); }
@Override public void createTemplateItem(Context context, Collection collection) throws SQLException, AuthorizeException { // Check authorisation AuthorizeUtil.authorizeManageTemplateItem(context, collection); if (collection.getTemplateItem() == null) { Item template = itemService.createTemplateItem(context, collection); collection.setTemplateItem(template); log.info(LogManager.getHeader(context, "create_template_item", "collection_id=" + collection.getID() + ",template_item_id=" + template.getID())); } }