com.mizar.trinidad.components
Class TrinidadCollection<E extends RowInterface>

java.lang.Object
  extended by com.mizar.persistence.jpa.facade.JPAFacade
      extended by com.mizar.faces.jpa.facade.FacesCollection
          extended by com.mizar.trinidad.components.TrinidadCollection<E>
Direct Known Subclasses:
ADFTreeFileHandler, TrinidadTable, TrinidadTree, TrinidadTreeTable

public class TrinidadCollection<E extends RowInterface>
extends FacesCollection


Nested Class Summary
protected static class TrinidadCollection.UpdateListReasons
           
 
Field Summary
protected  org.apache.myfaces.trinidad.model.RowKeySet disclosedRowKeys
           
protected  boolean exceptionThrown
           
protected  java.lang.String pkeyMask
           
protected  org.apache.myfaces.trinidad.model.RowKeySet selectedRowKeys
           
 
Fields inherited from class com.mizar.faces.jpa.facade.FacesCollection
currentRow, list, previousRow, selectionList
 
Fields inherited from class com.mizar.persistence.jpa.facade.JPAFacade
em, emf, model, persistenceUnitName, schemaName, sequencesValidated, silent, verbose
 
Constructor Summary
TrinidadCollection()
           
 
Method Summary
 void accept(javax.faces.event.ActionEvent ignore)
          A generic accept method that can be referenced by any action method The page flow scope is returned
 boolean addRow(RowInterface row)
           
 void addTrinidadCollectionListener(TrinidadCollectionListener listener)
           
 void cancel(javax.faces.event.ActionEvent ignore)
          A generic cancel handler that can be referenced by any action method
 void cancelEditing(javax.faces.event.ActionEvent ignore)
           
 void clearList()
           
 void dirtyDependentTables()
           
 void downloadCSV(javax.faces.event.ActionEvent ae)
           
 void downloadPDF(javax.faces.event.ActionEvent ae)
           
 void downloadXLS(javax.faces.event.ActionEvent ae)
           
 void downloadXML(javax.faces.event.ActionEvent ae)
           
 void exportToDbaseFile(javax.faces.event.ActionEvent ignored)
          NOTE: must be called with partialSubmit="false" or will fail badly The method converts the list to a DBase file and writes it to output stream
 void fireCurrentRowValueChanged(RowInterface oldValue, RowInterface newValue)
           
 java.util.List<TrinidadCollection> getDependentTables()
           
 org.apache.myfaces.trinidad.model.RowKeySet getDisclosedRowKeys()
           
 java.lang.String getPersistenceUnitName()
          If persistenceUnit has not previously been set, this method sets the persistenceUnitName as defined in JPAFacade with the name specified in SessionConstants.
 java.lang.String getPkeyMask()
           
 java.lang.reflect.Method getPostUpdateListMethod()
           
 java.lang.String getRedrawComponentId()
           
 org.apache.myfaces.trinidad.model.RowKeySet getSelectedRowKeys()
           
 java.lang.String getTableName()
           
protected  TrinidadCollection.UpdateListReasons getUpdateListReason()
           
 boolean isEditable()
           
 boolean isExceptionThrown()
           
 boolean isNewRowEditing()
           
 RowMutable mergeBean(RowMutable entity)
           
 RowInterface persistBean(GenericBean entity)
           
 RowMutable persistBean(RowMutable entity)
           
 void redrawCollection()
           
 boolean removeBean(RowMutable entity)
           
 void removeRow(javax.faces.event.ActionEvent ae)
           
 RowInterface removeRow(int index)
           
 boolean removeRow(RowInterface row)
           
 void resetGoToDashboard()
           
 void resetGoToDashboard(java.lang.String aBeanName)
           
 void setCurrentRow(RowInterface row)
           
 void setDisclosedRowKeys(org.apache.myfaces.trinidad.model.RowKeySet disclosuredRows)
           
 void setExceptionThrown(boolean exceptionThrown)
           
 void setList(GenericBean bean)
           
 void setList(java.util.List<RowInterface> newList)
           
 void setList(RowInterface bean)
           
 void setNewRowEditing(boolean newRowEditing)
           
 void setPkeyMask(java.lang.String pkeyMask)
           
 void setPostUpdateListMethod(java.lang.reflect.Method postUpdateListMethod)
          The method calls this.postUpdateMethod() if posetUpdateMethod is not null.
 void setPostUpdateListMethod(java.lang.String postUpdateListMethod)
          The method calls this.postUpdateMethod() if posetUpdateMethod is not null.
 void setRedrawComponentId(java.lang.String tableId)
           
 void setSelectedRowKeys(org.apache.myfaces.trinidad.model.RowKeySet selectedRows)
           
protected  void setUpdateListReason(TrinidadCollection.UpdateListReasons updateListReason)
           
 void startEditing(javax.faces.event.ActionEvent ignore)
           
 void startEditingNew(javax.faces.event.ActionEvent ignore)
           
 
Methods inherited from class com.mizar.faces.jpa.facade.FacesCollection
closeEm, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, decrementPosition, decrementPosition, downloadFile, exportToExcel, find, getBean, getBeanClass, getBeanFromRow, getBeanList, getClassNameRoot, getCurrentMutableRow, getCurrentRow, getEm, getEmScope, getExportName, getGeom, getList, getListSize, getManagedBeanName, getMaxDownloadSize, getMaxResults, getReference, getResultList, getRowClass, getRowConstructor, getRowSQL, getSelectionList, getSingleResult, getTrackedQuery, getTruncatedList, getValue, incrementPosition, incrementPosition, isDefaultRowConstructor, isFileDownloadable, isListDirty, isSelectionListDirty, maxResultsOff, maxResultsOff, maxResultsOn, newRow, newRow, refresh, refreshBean, resetCurrentRow, selectRows, selectRows, selectRowsExpression, selectRowsExpression, selectRowsJPQL, selectRowsJPQL, selectRowsJPQL, selectRowsJPQL, selectRowsSQL, selectRowsSQL, selectRowsSQL, selectRowsSQL, selectRowsSQL, selectRowsSQL, setBeanClass, setCurrentRow, setCurrentRow, setCurrentRow, setDefaultRowConstructor, setEmScope, setExportName, setListDirty, setManagedBeanName, setMaxDownloadSize, setMaxResults, setRowClass, setRowConstructor, setSelectionList, setSelectionListDirty, setTrackedQuery
 
Methods inherited from class com.mizar.persistence.jpa.facade.JPAFacade
closeEm, closeEmf, executeDDL, executeNativeUpdate, executeNativeUpdate, executeUpdate, getClosableConnectionAccessor, getConnection, getConnection, getEm, getEmf, getEmf, getLogger, getPassword, getPassword, getSchemaName, getSequencesValidated, getSid, getSilent, getTableName, getToleratedErrorCodes, getUrl, getUser, getVerbose, mergeBean, persist, persistBean, printAnyBean, queryTester, queryTester, refreshBean, remove, removeBean, removeBean, setEmf, setPersistenceUnitName, setSilent, setToleratedErrorCodes, setVerbose, validateSequences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectedRowKeys

protected org.apache.myfaces.trinidad.model.RowKeySet selectedRowKeys

disclosedRowKeys

protected org.apache.myfaces.trinidad.model.RowKeySet disclosedRowKeys

pkeyMask

protected java.lang.String pkeyMask

exceptionThrown

protected boolean exceptionThrown
Constructor Detail

TrinidadCollection

public TrinidadCollection()
Method Detail

redrawCollection

public void redrawCollection()

setRedrawComponentId

public void setRedrawComponentId(java.lang.String tableId)

getRedrawComponentId

public java.lang.String getRedrawComponentId()

setExceptionThrown

public void setExceptionThrown(boolean exceptionThrown)

isExceptionThrown

public boolean isExceptionThrown()

setNewRowEditing

public void setNewRowEditing(boolean newRowEditing)

isNewRowEditing

public boolean isNewRowEditing()

cancel

public void cancel(javax.faces.event.ActionEvent ignore)
A generic cancel handler that can be referenced by any action method


accept

public void accept(javax.faces.event.ActionEvent ignore)
A generic accept method that can be referenced by any action method The page flow scope is returned


cancelEditing

public void cancelEditing(javax.faces.event.ActionEvent ignore)

startEditing

public void startEditing(javax.faces.event.ActionEvent ignore)

startEditingNew

public void startEditingNew(javax.faces.event.ActionEvent ignore)

isEditable

public boolean isEditable()

getTableName

public java.lang.String getTableName()

setList

public void setList(RowInterface bean)
Overrides:
setList in class FacesCollection

setList

public void setList(GenericBean bean)
Overrides:
setList in class FacesCollection

setList

public void setList(java.util.List<RowInterface> newList)
Overrides:
setList in class FacesCollection

clearList

public void clearList()
Overrides:
clearList in class FacesCollection

setPkeyMask

public void setPkeyMask(java.lang.String pkeyMask)

getPkeyMask

public java.lang.String getPkeyMask()

setDisclosedRowKeys

public void setDisclosedRowKeys(org.apache.myfaces.trinidad.model.RowKeySet disclosuredRows)

getDisclosedRowKeys

public org.apache.myfaces.trinidad.model.RowKeySet getDisclosedRowKeys()

setSelectedRowKeys

public void setSelectedRowKeys(org.apache.myfaces.trinidad.model.RowKeySet selectedRows)

getSelectedRowKeys

public org.apache.myfaces.trinidad.model.RowKeySet getSelectedRowKeys()

downloadXLS

public void downloadXLS(javax.faces.event.ActionEvent ae)

downloadPDF

public void downloadPDF(javax.faces.event.ActionEvent ae)

downloadXML

public void downloadXML(javax.faces.event.ActionEvent ae)

downloadCSV

public void downloadCSV(javax.faces.event.ActionEvent ae)

addRow

public boolean addRow(RowInterface row)

removeRow

public void removeRow(javax.faces.event.ActionEvent ae)

removeRow

public boolean removeRow(RowInterface row)

removeRow

public RowInterface removeRow(int index)

getDependentTables

public java.util.List<TrinidadCollection> getDependentTables()

dirtyDependentTables

public void dirtyDependentTables()

resetGoToDashboard

public void resetGoToDashboard()

resetGoToDashboard

public void resetGoToDashboard(java.lang.String aBeanName)

setCurrentRow

public void setCurrentRow(RowInterface row)
Overrides:
setCurrentRow in class FacesCollection

fireCurrentRowValueChanged

public void fireCurrentRowValueChanged(RowInterface oldValue,
                                       RowInterface newValue)

addTrinidadCollectionListener

public void addTrinidadCollectionListener(TrinidadCollectionListener listener)

exportToDbaseFile

public void exportToDbaseFile(javax.faces.event.ActionEvent ignored)
NOTE: must be called with partialSubmit="false" or will fail badly The method converts the list to a DBase file and writes it to output stream

Parameters:
ignored -

setPostUpdateListMethod

public void setPostUpdateListMethod(java.lang.String postUpdateListMethod)
The method calls this.postUpdateMethod() if posetUpdateMethod is not null. We use it to launch javascript functions; but it can be used for anything. The posetUpdateListMethod can determine the reason for the update by called getUpdateListReason()

Parameters:
postUpdateListMethod - the name of the method in the TrinidadTable implementor
See Also:
TrinidadTable.refreshList(), TrinidadTree.refreshList(), TrinidadTreeTable.refreshList(), setPostUpdateListMethod(Method), getUpdateListReason()

setPostUpdateListMethod

public void setPostUpdateListMethod(java.lang.reflect.Method postUpdateListMethod)
The method calls this.postUpdateMethod() if posetUpdateMethod is not null. We use it to launch javascript functions; but it can be used for anything. The posetUpdateListMethod can determine the reason for the update by called getUpdateListReason() The method is called from the refreshList of TrinidadTable, TrinidadTree, or TrinidadTreeTable.

Parameters:
postUpdateListMethod -
See Also:
TrinidadTable.refreshList(), TrinidadTree.refreshList(), TrinidadTreeTable.refreshList(), setPostUpdateListMethod(String), getUpdateListReason()

getPostUpdateListMethod

public java.lang.reflect.Method getPostUpdateListMethod()

setUpdateListReason

protected void setUpdateListReason(TrinidadCollection.UpdateListReasons updateListReason)
Parameters:
updateListReason -
See Also:
setPostUpdateListMethod(Method), setPostUpdateListMethod(String)

getUpdateListReason

protected TrinidadCollection.UpdateListReasons getUpdateListReason()
Returns:

getPersistenceUnitName

public java.lang.String getPersistenceUnitName()

If persistenceUnit has not previously been set, this method sets the persistenceUnitName as defined in JPAFacade with the name specified in SessionConstants. JPAFacade is not supposed to know about Faces, let alone Trinidad, but once Faces are involved we want to supercede many of the JPAFacade methods.

The method sets the JPAFacade.setPersistenceUnitName value to match that in SessionConstants.

Overrides:
getPersistenceUnitName in class JPAFacade
Returns:
the name of the persistenceUnit to be used with this collection

persistBean

public RowInterface persistBean(GenericBean entity)

persistBean

public RowMutable persistBean(RowMutable entity)

mergeBean

public RowMutable mergeBean(RowMutable entity)

removeBean

public boolean removeBean(RowMutable entity)