Interface ItemForm

All Superinterfaces:
Extensible, Identifiable, OsidBrowsableForm, OsidExtensibleForm, OsidForm, OsidIdentifiableForm, OsidObjectForm, Suppliable
All Known Subinterfaces:
ItemBatchForm

public interface ItemForm extends OsidObjectForm

This is the form for creating and updating Items . Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the ItemAdminSession . For each data element that may be set, metadata may be examined to provide display hints or data constraints.

  • Method Details

    • getCategoryMetadata

      Metadata getCategoryMetadata()
      Gets the metadata for the category.
      Returns:
      metadata for the category
      Compliance:
      mandatory - This method must be implemented.
    • setCategory

      void setCategory(Id categoryId)
      Sets the category.
      Parameters:
      categoryId - the new category
      Throws:
      InvalidArgumentException - categoryId is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - categoryId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearCategory

      void clearCategory()
      Removes the category.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getAccountMetadata

      Metadata getAccountMetadata()
      Gets the metadata for the general ledger account.
      Returns:
      metadata for the account
      Compliance:
      mandatory - This method must be implemented.
    • setAccount

      void setAccount(Id accountId)
      Sets the general ledger account.
      Parameters:
      accountId - the new account
      Throws:
      InvalidArgumentException - accountId is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - accountId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearAccount

      void clearAccount()
      Removes the account.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getProductMetadata

      Metadata getProductMetadata()
      Gets the metadata for the product.
      Returns:
      metadata for the product
      Compliance:
      mandatory - This method must be implemented.
    • setProduct

      void setProduct(Id productId)
      Sets the product.
      Parameters:
      productId - the new product
      Throws:
      InvalidArgumentException - productId is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - productId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearProduct

      void clearProduct()
      Removes the product.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getAmountMetadata

      Metadata getAmountMetadata()
      Gets the metadata for the amount.
      Returns:
      metadata for the amount
      Compliance:
      mandatory - This method must be implemented.
    • setAmount

      void setAmount(Currency amount)
      Sets the amount.
      Parameters:
      amount - the new amount
      Throws:
      InvalidArgumentException - amount is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - amount is null
      Compliance:
      mandatory - This method must be implemented.
    • clearAmount

      void clearAmount()
      Removes the amount.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getDebitMetadata

      Metadata getDebitMetadata()
      Gets the metadata for the debit flag.
      Returns:
      metadata for the debit
      Compliance:
      mandatory - This method must be implemented.
    • setAmount

      void setAmount(boolean debit)
      Sets the debit flag.
      Parameters:
      debit - true for a debit, false for a credit
      Throws:
      InvalidArgumentException - debit is invalid
      NoAccessException - Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • clearDebit

      void clearDebit()
      Removes the debit flag.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getRecurringIntervalMetadata

      Metadata getRecurringIntervalMetadata()
      Gets the metadata for the recurring interval.
      Returns:
      metadata for the recurring interval
      Compliance:
      mandatory - This method must be implemented.
    • setRecurringInterval

      void setRecurringInterval(Duration interval)
      Sets the recurring interval.
      Parameters:
      interval - the new interval
      Throws:
      InvalidArgumentException - interval is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - interval is null
      Compliance:
      mandatory - This method must be implemented.
    • clearRecurringInterval

      void clearRecurringInterval()
      Removes the recurring interval and sets the item as a one-time charge.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getItemFormRecord

      ItemFormRecord getItemFormRecord(Type itemRecordType) throws OperationFailedException
      Gets the ItemFormRecord corresponding to the given item record Type .
      Parameters:
      itemRecordType - an item record type
      Returns:
      the item form record
      Throws:
      NullArgumentException - itemRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(itemRecordType) is false
      Compliance:
      mandatory - This method must be implemented.