org.opensubsystems.inventory.application
Class ItemDialog

java.lang.Object
  extended by org.opensubsystems.core.application.ThickClientDialog
      extended by org.opensubsystems.inventory.application.ItemDialog

public class ItemDialog
extends org.opensubsystems.core.application.ThickClientDialog

Dialog to create and edit items. This dialog doesn't dictate how the user interface looks like or what gui technology is used to implement the user interface. It dynamically determines what gui implementation should be used and it provides services to most common gui implementations to interact with the server.

Version:
$Id: ItemDialog.java,v 1.10 2007/01/07 06:13:57 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
Miro Halas
Code reviewed:
1.8 2006/04/05 05:15:56 bastafidli

Field Summary
protected  boolean m_bModify
          If this flag is true, then the dialog will act as modify dialog otherwise it will act as a create dialog.
protected  Item m_data
          Data for the item being modified.
protected  int m_iInventoryId
          Inventory where the item does or will exist.
protected  int m_iRootCategoryId
          Root category this item should or does exist in.
protected  java.util.List m_lstSubcategoryIds
          Subcategories this item exist or should exist in.
protected  java.util.Set m_setListeners
          Set where all listeners listening to the event notifications specific to this object are stored.
protected  java.lang.String m_strInternalNumber
          Unique internal identification number for this item.
 
Fields inherited from class org.opensubsystems.core.application.ThickClientDialog
m_client, m_dialogGui, m_parentDialog, m_strTitle
 
Constructor Summary
ItemDialog(org.opensubsystems.core.application.ThickClient client, java.lang.String strTitle, boolean bModify, Item itemData, int iRootCategoryId, java.util.List lstSubcategoryIds, java.lang.String strInternalNumber)
          Constructor for dialog to edit item.
 
Method Summary
 void addItemDialogGuiListener(ItemDialogListener listener)
          Add listener for this dialog.
 void displayCreateIdentificationDialog(double dDefaultCost, java.util.List lstAvoidExternalNumbers, java.util.List lstAvoidInternalNumbers, IdentificationDialogListener dialogListener)
          Display dialog to create identification.
 void displayCreateUnitDialog(double dDefaultCost, java.util.List lstAvoidCosts, UnitDialogListener dialogListener)
          Display dialog to create identification.
 Item displayDialog()
          Display the dialog.
 void displayModifyIdentificationDialog(Identification data, java.util.List lstAvoidExternalNumbers, java.util.List lstAvoidInternalNumbers, IdentificationDialogListener dialogListener)
          Display dialog to modify identification.
 void displayModifyUnitDialog(Unit data, java.util.List lstAvoidCosts, UnitDialogListener dialogListener)
          Display dialog to modify units.
protected  IdentificationController getIdentificationController()
          Get controller to invoke business logic.
protected  UnitController getUnitController()
          Get controller to invoke business logic.
 void removeItemDialogGuiListener(ItemDialogListener listener)
          Remove listener from this dialog.
 
Methods inherited from class org.opensubsystems.core.application.ThickClientDialog
getClient, getGui, getParentDialog, getTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_setListeners

protected java.util.Set m_setListeners
Set where all listeners listening to the event notifications specific to this object are stored.


m_bModify

protected boolean m_bModify
If this flag is true, then the dialog will act as modify dialog otherwise it will act as a create dialog. This will allow us to modify data, which were not yet created in the persistence store, but are held in memory and modified before they are stored.


m_data

protected Item m_data
Data for the item being modified. If item is being created this is null.


m_iInventoryId

protected int m_iInventoryId
Inventory where the item does or will exist.


m_iRootCategoryId

protected int m_iRootCategoryId
Root category this item should or does exist in.


m_lstSubcategoryIds

protected java.util.List m_lstSubcategoryIds
Subcategories this item exist or should exist in.


m_strInternalNumber

protected java.lang.String m_strInternalNumber
Unique internal identification number for this item.

Constructor Detail

ItemDialog

public ItemDialog(org.opensubsystems.core.application.ThickClient client,
                  java.lang.String strTitle,
                  boolean bModify,
                  Item itemData,
                  int iRootCategoryId,
                  java.util.List lstSubcategoryIds,
                  java.lang.String strInternalNumber)
           throws org.opensubsystems.core.error.OSSException
Constructor for dialog to edit item.

Parameters:
client - - client displaying this dialog
strTitle - - title of the dialog
bModify - - if this flag is true, then the dialog will act as modify dialog otherwise it will act as a create dialog. This will allow us to modify data, which were not yet created in the persistence store, but are held in memory and modified before they are stored
itemData - - item to be created or edited, but never null. When creating new item load the template data from the backend and then use the template data in this dialog.
iRootCategoryId - - root category this item should or does exist in
lstSubcategoryIds - - subcategories this item exist or should exist in
strInternalNumber - - internal identification number it this is a non uniquely tracked item or if the item is not unitquely tracked, can be null. If this is a new item it should be the next available value (of course this is just a suggestion since the availability can change by the time they are done)
Throws:
org.opensubsystems.core.error.OSSException - - an error as occured
Method Detail

displayDialog

public Item displayDialog()
                   throws org.opensubsystems.core.error.OSSException
Display the dialog.

Returns:
Item - created or modified item or the value passed in to the constructor if the dialog was cancelled.
Throws:
org.opensubsystems.core.error.OSSException - - an error as occured

displayCreateIdentificationDialog

public void displayCreateIdentificationDialog(double dDefaultCost,
                                              java.util.List lstAvoidExternalNumbers,
                                              java.util.List lstAvoidInternalNumbers,
                                              IdentificationDialogListener dialogListener)
Display dialog to create identification.

Parameters:
dDefaultCost - - default cost for the identification of the item. This is passed in since it can depend on others not yet persisted identifications.
lstAvoidExternalNumbers - - list of external numbers which cannot be used, since they may have already been used
lstAvoidInternalNumbers - - list of internal numbers which cannot be used, since they may have already been used
dialogListener - - listener which needs to be notified about changes and actions on the gui

displayModifyIdentificationDialog

public void displayModifyIdentificationDialog(Identification data,
                                              java.util.List lstAvoidExternalNumbers,
                                              java.util.List lstAvoidInternalNumbers,
                                              IdentificationDialogListener dialogListener)
Display dialog to modify identification.

Parameters:
data - - data to modify. This item doesn't have to exist in the persistence store but may have been before created and it is held in memory until some related data are created.
lstAvoidExternalNumbers - - list of external numbers which cannot be used, since they may have already been used
lstAvoidInternalNumbers - - list of internal numbers which cannot be used, since they may have already been used
dialogListener - - listener which needs to be notified about changes and actions on the gui

displayCreateUnitDialog

public void displayCreateUnitDialog(double dDefaultCost,
                                    java.util.List lstAvoidCosts,
                                    UnitDialogListener dialogListener)
Display dialog to create identification.

Parameters:
dDefaultCost - - default cost for the unit. This is passed in since it can depend on others not yet persisted units.
lstAvoidCosts - - list of cost values, which cannot be used, since they may have already been used
dialogListener - - listener which needs to be notified about changes and actions on the gui

displayModifyUnitDialog

public void displayModifyUnitDialog(Unit data,
                                    java.util.List lstAvoidCosts,
                                    UnitDialogListener dialogListener)
Display dialog to modify units.

Parameters:
data - - data to modify. This item doesn't have to exist in the persistence store but may have been before created and it is held in memory until some related data are created.
lstAvoidCosts - - list of cost values, which cannot be used, since they may have already been used
dialogListener - - listener which needs to be notified about changes and actions on the gui

addItemDialogGuiListener

public void addItemDialogGuiListener(ItemDialogListener listener)
Add listener for this dialog.

Parameters:
listener - - listener to add

removeItemDialogGuiListener

public void removeItemDialogGuiListener(ItemDialogListener listener)
Remove listener from this dialog.

Parameters:
listener - - listener to remove

getIdentificationController

protected IdentificationController getIdentificationController()
                                                        throws org.opensubsystems.core.error.OSSException
Get controller to invoke business logic.

Returns:
IdentificationController
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getUnitController

protected UnitController getUnitController()
                                    throws org.opensubsystems.core.error.OSSException
Get controller to invoke business logic.

Returns:
UnitController
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.