Enum Class QueueEntity

java.lang.Object
java.lang.Enum<QueueEntity>
org.bgerp.plugin.inventoru.model.queue.QueueEntity
All Implemented Interfaces:
Serializable, Comparable<QueueEntity>, Constable

public enum QueueEntity extends Enum<QueueEntity>
An entity a queue can list: everything about it the otherwise entity-agnostic queue machinery needs — the table to select from, the fields a column or a filter may address, the object type its param:<id> columns and filters belong to, and how access to its rows is restricted. Adding an entity to the queues is meant to be this enum plus its titles, nothing else: columns, filters, sorting, the search query, the chooser of visible filters and the screens are shared.
  • Enum Constant Details

    • STORE

      public static final QueueEntity STORE
      Warehouses. Access is restricted by StoreAccessService, unlike the others.
    • ITEM

      public static final QueueEntity ITEM
      Items. Visible to anyone allowed to open the screen — an item belongs to no warehouse.
    • DEVICE

      public static final QueueEntity DEVICE
      Equipment. Lives on a warehouse, so the same restriction as warehouses applies.
    • MANUFACTURER

      public static final QueueEntity MANUFACTURER
      Manufacturers. A directory: visible to anyone allowed to open the screen.
    • MODEL

      public static final QueueEntity MODEL
      Equipment models. A directory as well; its title is the model name.
    • MOVEMENT

      public static final QueueEntity MOVEMENT
      Stock movements — a journal rather than a catalogue: rows are never updated or deleted, and each one names the warehouse it happened on, so warehouse access restricts it. Its free text is the comment, which is what a 'title' filter searches.
  • Method Details

    • values

      public static QueueEntity[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static QueueEntity valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static QueueEntity of(String id)
    • getId

      public String getId()
      Stored in the entity column of the queue and used in configuration.
    • getTitleKey

      public String getTitleKey()
      Phrase to show a person, to be passed through the localizer. The id is a configuration token ('store', 'item', 'device') and reads as one when put on a screen.
    • getTable

      public String getTable()
      Table the queue selects from, always aliased as t.
    • getObjectType

      public String getObjectType()
      Object type of the parameters a param:<id> column or filter may address.
    • isSoftDelete

      public boolean isSoftDelete()
      Whether the table has a deleted_at column, which the 'deleted' filter needs.
    • getFieldExpression

      public String getFieldExpression(String name)
      SQL expression of a plain field addressable from the configuration as column.N.value=<name>.
      Returns:
      the expression, or null when the entity has no such field.
    • getFieldNames

      public Set<String> getFieldNames()
      Sorted, so that the list of available fields an error message names reads the same way every time — see QueueColumn.of.
    • accessRestriction

      public Set<Integer> accessRestriction(Connection con, DynActionForm form) throws Exception
      Rows the user may see.
      Returns:
      null when unrestricted, otherwise the IDs of the warehouses the rows must belong to — an empty set meaning nothing is visible.
      Throws:
      Exception
    • getAccessColumn

      public String getAccessColumn()
      Column of the table holding the warehouse an accessRestriction(Connection, DynActionForm) applies to.
      Returns:
      the column, or null when the entity is not restricted that way.