Class ConsolidatedPickSlipContext

java.lang.Object
org.apache.velocity.context.AbstractContext
All Implemented Interfaces:
Serializable, Cloneable, org.apache.velocity.context.Context, org.apache.velocity.context.InternalEventContext

public class ConsolidatedPickSlipContext extends AbstractDocumentContext<BusinessProcessModel>
Context for ConsolidatedPickLabel generating and sorting the form entries.
See Also:
  • Constructor Details

    • ConsolidatedPickSlipContext

      public ConsolidatedPickSlipContext()
  • Method Details

    • init

      public void init(BusinessProcessModel businessProcessModel, DocumentPageModel documentPageModel)
      Overrides:
      init in class AbstractDocumentContext<BusinessProcessModel>
    • escapeHtml

      public String escapeHtml(String stringToEscape)
      Escapes String to generate safe HTML
      Parameters:
      stringToEscape - String to escape
      Returns:
      escaped String
    • createPickSlipFormEntries

      protected List<ConsolidatedPickSlipFormEntry> createPickSlipFormEntries(List<ConsignmentEntryModel> consignmentEntries)
      Creates a list of ConsignmentEntryModel. Groups by product and bin and sorts using a comparator.
      Parameters:
      consignmentEntries - Consignment Entries
    • extractBin

      protected String extractBin(AllocationEventModel allocationEventModel)
      Extracts the bin out of the StockLevelModel in the AllocationEventModel
      Parameters:
      allocationEventModel - the AllocationEventModel
      Returns:
      a string containing the bin
    • extractConsignments

      protected List<ConsignmentModel> extractConsignments(BusinessProcessModel businessProcessModel)
      Parameters:
      businessProcessModel - the businessProcess containing the consignments
      Returns:
      list of ConsignmentModel
    • getSite

      protected BaseSiteModel getSite(BusinessProcessModel businessProcessModel)
      Specified by:
      getSite in class AbstractDocumentContext<BusinessProcessModel>
    • getDocumentLanguage

      protected LanguageModel getDocumentLanguage(BusinessProcessModel businessProcessModel)
      Specified by:
      getDocumentLanguage in class AbstractDocumentContext<BusinessProcessModel>
    • extractAllocationEvents

      protected Collection<AllocationEventModel> extractAllocationEvents(ConsignmentEntryModel consignmentEntryModel)
      Extracts the bin location of the product for the selected ConsignmentEntryModel
      Parameters:
      consignmentEntryModel - the ConsignmentEntryModel for which we request the Consolidated Pick Slip label
      Returns:
      The binCode location of the product
    • getProductImageURL

      public String getProductImageURL(ProductModel productModel)
      Extracts the image url for the thumbnail of a ProductModel
      Parameters:
      productModel - the ProductModel for which we request Product Image
      Returns:
      the source url for the product thumbnail (expecting the relative path as a string)
    • getRowQuantity

      public int getRowQuantity(int columns)
      Returns the quantity of row for the amount of column based on the list of ConsignmentModel
      Parameters:
      columns - amount of columns needed
      Returns:
      amount of rows required minus one.
    • getDate

      public org.apache.velocity.tools.generic.DateTool getDate()
    • getFormEntries

      public List<ConsolidatedPickSlipFormEntry> getFormEntries()
    • setFormEntries

      public void setFormEntries(List<ConsolidatedPickSlipFormEntry> formEntries)
    • getConsignmentList

      public List<ConsignmentModel> getConsignmentList()
    • setConsignmentList

      public void setConsignmentList(List<ConsignmentModel> consignmentList)
    • getConsolidatedPickSlipComparator

      protected Comparator<ConsolidatedPickSlipFormEntry> getConsolidatedPickSlipComparator()
    • setConsolidatedPickSlipComparator

      public void setConsolidatedPickSlipComparator(Comparator<ConsolidatedPickSlipFormEntry> consolidatedPickSlipComparator)
    • getInventoryEventService

      protected InventoryEventService getInventoryEventService()
    • setInventoryEventService

      public void setInventoryEventService(InventoryEventService inventoryEventService)
    • pushCurrentTemplateName

      public void pushCurrentTemplateName(String arg0)
    • popCurrentTemplateName

      public void popCurrentTemplateName()
    • getCurrentTemplateName

      public String getCurrentTemplateName()
    • getTemplateNameStack

      public String[] getTemplateNameStack()
    • pushCurrentMacroName

      public void pushCurrentMacroName(String arg0)
    • popCurrentMacroName

      public void popCurrentMacroName()
    • getCurrentMacroName

      public String getCurrentMacroName()
    • getCurrentMacroCallDepth

      public int getCurrentMacroCallDepth()
    • getMacroNameStack

      public String[] getMacroNameStack()
    • icacheGet

      public org.apache.velocity.util.introspection.IntrospectionCacheData icacheGet(Object arg0)
    • icachePut

      public void icachePut(Object arg0, org.apache.velocity.util.introspection.IntrospectionCacheData arg1)
    • setCurrentResource

      public void setCurrentResource(org.apache.velocity.runtime.resource.Resource arg0)
    • getCurrentResource

      public org.apache.velocity.runtime.resource.Resource getCurrentResource()
    • setMacroLibraries

      public void setMacroLibraries(List<org.apache.velocity.Template> arg0)
    • getMacroLibraries

      public List<org.apache.velocity.Template> getMacroLibraries()
    • attachEventCartridge

      public org.apache.velocity.app.event.EventCartridge attachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0)
      Specified by:
      attachEventCartridge in interface org.apache.velocity.context.InternalEventContext
    • getEventCartridge

      public org.apache.velocity.app.event.EventCartridge getEventCartridge()
      Specified by:
      getEventCartridge in interface org.apache.velocity.context.InternalEventContext