org.salespointframework.desktop.strategies.dataexchangeformsheet
Class CCStrategy

java.lang.Object
  extended by org.salespointframework.desktop.strategies.FormSheetStrategy
      extended by org.salespointframework.desktop.strategies.dataexchangeformsheet.MoveStrategy
          extended by org.salespointframework.desktop.strategies.dataexchangeformsheet.CCStrategy
All Implemented Interfaces:
ProcessErrorCodes
Direct Known Subclasses:
CCStrategy

public class CCStrategy
extends MoveStrategy

MoveStrategy for a Catalog source and destination.

Since:
v2.0
Version:
2.0 20/08/1999
Author:
Steffen Zschaler

Nested Class Summary
 
Nested classes/interfaces inherited from class org.salespointframework.desktop.strategies.FormSheetStrategy
FormSheetStrategy.ErrorHandler
 
Field Summary
 
Fields inherited from class org.salespointframework.desktop.strategies.FormSheetStrategy
DEFAULT_ERROR_HANDLER, m_ehErrHandler, MSG_POPUP_ERROR_HANDLER
 
Fields inherited from interface org.salespointframework.core.exceptions.ProcessErrorCodes
DATABASKET_CONFLICT_ERROR, DUPLICATE_KEY_EXCEPTION, ERR_FORCED_SHUTDOWN, ERR_INTERNAL, ERR_LOWERBOUND, ERR_NOERROR, ERR_UPPERBOUND, NOT_ENOUGH_ELEMENTS_ERROR, REMOVE_VETO_EXCEPTION
 
Constructor Summary
CCStrategy()
           
 
Method Summary
protected  int checkMove(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci)
          Check whether the indicated move is allowable.
protected  Gate getCheckMoveGate(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci, DataExchangeFormSheet ttfs)
          Get the first gate of a sub-process that will move items from one Catalog into another.
protected  Gate getCheckMoveToDestGate(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci, DataExchangeFormSheet ttfs)
          Get the first gate of the sub-process that will move items from the source to the destination.
protected  Gate getCheckMoveToSourceGate(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci, DataExchangeFormSheet ttfs)
          Get the first gate of the sub-process that will move items from the destination to the source.
 Transition getMoveToDestProcess(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci, DataExchangeFormSheet ttfs)
          Get the sub-process that will move items from the source to the destination.
 Transition getMoveToSourceProcess(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci, DataExchangeFormSheet ttfs)
          Get the sub-process that will move items from the destination to the source.
protected  void moveImpl(SaleProcess p, SalesPoint sp, Catalog cSource, Catalog cDest, DataBasket db, CatalogItem ci)
          Move the indicated item from the source Catalog into the destination Catalog.
 
Methods inherited from class org.salespointframework.desktop.strategies.dataexchangeformsheet.MoveStrategy
canMoveToDest, canMoveToSource
 
Methods inherited from class org.salespointframework.desktop.strategies.FormSheetStrategy
error, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CCStrategy

public CCStrategy()
Method Detail

getMoveToDestProcess

public Transition getMoveToDestProcess(SaleProcess p,
                                       SalesPoint sp,
                                       Catalog cSource,
                                       Catalog cDest,
                                       DataBasket db,
                                       CatalogItem ci,
                                       DataExchangeFormSheet ttfs)
Get the sub-process that will move items from the source to the destination.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
ttfs - the FormSheet that triggers the process.

getCheckMoveToDestGate

protected Gate getCheckMoveToDestGate(SaleProcess p,
                                      SalesPoint sp,
                                      Catalog cSource,
                                      Catalog cDest,
                                      DataBasket db,
                                      CatalogItem ci,
                                      DataExchangeFormSheet ttfs)
Get the first gate of the sub-process that will move items from the source to the destination.

This Gate will check whether the move is allowable, and if so, will trigger a Transition that performs it.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
ttfs - the FormSheet that triggers the process.
Returns:
getCheckMoveGate(org.salespointframework.core.SaleProcess, org.salespointframework.core.SalesPoint, org.salespointframework.core.data.interfaces.Catalog, org.salespointframework.core.data.interfaces.Catalog, org.salespointframework.core.data.interfaces.DataBasket, org.salespointframework.core.data.interfaces.CatalogItem, org.salespointframework.desktop.formsheets.DataExchangeFormSheet).

getMoveToSourceProcess

public Transition getMoveToSourceProcess(SaleProcess p,
                                         SalesPoint sp,
                                         Catalog cSource,
                                         Catalog cDest,
                                         DataBasket db,
                                         CatalogItem ci,
                                         DataExchangeFormSheet ttfs)
Get the sub-process that will move items from the destination to the source.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the destination.
ttfs - the FormSheet that triggers the process.

getCheckMoveToSourceGate

protected Gate getCheckMoveToSourceGate(SaleProcess p,
                                        SalesPoint sp,
                                        Catalog cSource,
                                        Catalog cDest,
                                        DataBasket db,
                                        CatalogItem ci,
                                        DataExchangeFormSheet ttfs)
Get the first gate of the sub-process that will move items from the destination to the source.

This Gate will check whether the move is allowable, and if so, will trigger a Transition that performs it.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the destination.
ttfs - the FormSheet that triggers the process.
Returns:
getCheckMoveGate(org.salespointframework.core.SaleProcess, org.salespointframework.core.SalesPoint, org.salespointframework.core.data.interfaces.Catalog, org.salespointframework.core.data.interfaces.Catalog, org.salespointframework.core.data.interfaces.DataBasket, org.salespointframework.core.data.interfaces.CatalogItem, org.salespointframework.desktop.formsheets.DataExchangeFormSheet).

getCheckMoveGate

protected Gate getCheckMoveGate(SaleProcess p,
                                SalesPoint sp,
                                Catalog cSource,
                                Catalog cDest,
                                DataBasket db,
                                CatalogItem ci,
                                DataExchangeFormSheet ttfs)
Get the first gate of a sub-process that will move items from one Catalog into another.

This Gate will check whether the move is allowable, and if so, will trigger a Transition that performs it.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is to be moved from the source into the destination Catalog.
ttfs - the FormSheet that triggers the process.

moveImpl

protected void moveImpl(SaleProcess p,
                        SalesPoint sp,
                        Catalog cSource,
                        Catalog cDest,
                        DataBasket db,
                        CatalogItem ci)
Move the indicated item from the source Catalog into the destination Catalog. You can assume that you are in a Transition.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is to be moved.

checkMove

protected int checkMove(SaleProcess p,
                        SalesPoint sp,
                        Catalog cSource,
                        Catalog cDest,
                        DataBasket db,
                        CatalogItem ci)
                 throws java.lang.InterruptedException
Check whether the indicated move is allowable. If so, return 0, otherwise return a non-zero error value that can be passed on to FormSheetStrategy.error(org.salespointframework.core.SaleProcess, int). You can assume that you are at a Gate.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
cDest - the destination Catalog.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is to be moved.
Throws:
java.lang.InterruptedException