public class ScriptedObjectDB extends ObjectDB
Business object stored in database with scripted implementation.
CONTEXT_ACTION, CONTEXT_AGENDA, CONTEXT_ASSOCIATE, CONTEXT_COPY, CONTEXT_CREATE, CONTEXT_CROSSTAB, CONTEXT_DATAMAPSELECT, CONTEXT_DELETE, CONTEXT_EXPORT, CONTEXT_GRAPH, CONTEXT_IMPORT, CONTEXT_LIST, CONTEXT_NONE, CONTEXT_PANELLIST, CONTEXT_PLACEMAP, CONTEXT_POSTVALIDATE, CONTEXT_PREVALIDATE, CONTEXT_PRINTTMPL, CONTEXT_REFSELECT, CONTEXT_SEARCH, CONTEXT_STATETRANSITION, CONTEXT_UPDATE, CONTEXT_UPDATEALL, DB_DERBY, DB_H2, DB_HSQLDB, DB_MSSQL, DB_MYSQL, DB_ORACLE, DB_POSTGRESQL, DB_UNKNOWN, DEL_CASCAD, DEL_IGNORE, DEL_NULL, DEL_RESTRICT, FORM_LAYOUT_COMPACT, FORM_LAYOUT_DEFAULT, LIST_ADD, LIST_EDIT, LIST_READ, TYPE_QUERY, TYPE_SERVICE, TYPE_SERVICE_OPENDATASOFT, TYPE_SERVICE_SALESFORCE, TYPE_SERVICE_SIMPLICITE, VIEW_MODE_ACCORDION, VIEW_MODE_COLLAPSED, VIEW_MODE_EXTENDED, VIEW_MODE_TABS
Constructor and Description |
---|
ScriptedObjectDB() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateOnLink(ObjectField field)
Allow create on specific link ?
|
boolean |
canFollowLink(ObjectField field)
Allow follow a specific link ?
|
boolean |
canReference(java.lang.String object,
java.lang.String field)
Hook called to check if a referenced object can be displayed
|
boolean |
canUpdateAll(ObjectField f)
True if the field is bulk updatable, to override for specific behavior.
By default, return true if: - the field (and its foreign key) is visible and updatable, - not the single functional key in the object, - for status field, if the selection is in a same status. |
void |
checkExpression(java.lang.String expr)
Prepares an expression and apply structural and elementary syntax checks, this method is only intended to this basic usage
|
void |
clear() |
java.lang.String |
displayDataMap(java.lang.Object selector,
java.lang.Object params,
java.lang.Object nav)
UI DataMap selector wrapper
|
java.lang.String |
displayForm(java.lang.Object params,
java.lang.Object nav,
java.lang.Object page)
UI Form wrapper
|
java.lang.String |
displayList(java.lang.Object list,
java.lang.Object params,
java.lang.Object nav,
ObjectDB parent)
UI List wrapper
|
java.lang.String |
displayRefSelect(java.lang.Object selector,
java.lang.Object params,
java.lang.Object nav)
UI Reference selector wrapper
|
java.lang.String |
displaySearch(java.lang.Object search,
java.lang.Object params,
java.lang.Object nav)
UI Search wrapper
|
java.lang.Object |
evalExpression(java.lang.String expr,
int context,
java.lang.String[] row,
java.util.HashMap<java.lang.String,java.lang.Object> in,
java.util.HashMap<java.lang.String,java.lang.Object> out)
Overrides evalExpression using server script interpreter
|
java.util.ArrayList<java.lang.String> |
fieldCompletion(java.lang.String field,
java.lang.String query,
java.lang.String context)
Hook to override the default field completion (Lucene or SQL search on field)
- Usefull to implement an editable select-box, to call a WebService and/or to populate a specific list of choice - On client-side, use the field_completed(value) hook in the template to handle the selected value by user |
java.lang.String |
getAgendaDay(Agenda a,
java.util.Date d)
Hook to override agenda displayed date, usefull to add specific actions at the day header
|
java.lang.String |
getAgendaLabel(Agenda a,
ObjectField f)
Hook to customize agenda displayed field
|
java.lang.String |
getAgendaSelector(Agenda a,
java.lang.String selector)
Hook to override agenda displayed selector, usefull to mask or list specific users/groups at the agenda header
|
java.lang.String |
getAgendaValue(Agenda a,
ObjectField f,
java.lang.String val)
Hook to customize agenda displayed value
|
java.lang.String |
getAgendaWeek(Agenda a,
java.util.Vector<java.lang.String> days)
Hook to override agenda displayed week, usefull to add specific actions at the agenda header
|
long |
getCount(int maxRows)
Return the records count with the current search specification and filters.
|
java.util.Date |
getDeadlineDate(java.lang.String row_id,
java.lang.String state,
java.lang.String update_dt,
int timeout)
Eval the timeout date of the object state (can be overrided with a specific rule)
|
char |
getEmailRecipientType(java.lang.String alert,
java.lang.String email,
char type)
Hook to override the recipient type (TO/CC/BCC)
|
char |
getGroupEmailRecipientType(java.lang.String alert,
java.lang.String group,
char type)
Hook to override the recipient type (TO/CC/BCC) of a group
|
java.lang.String |
getImage(ObjectField f,
java.lang.String[] row)
Get the field icon from values array.
|
java.lang.String |
getStyle(ObjectField f,
double d)
Hook to specify field style for a crosstab value.
|
java.lang.String |
getStyle(ObjectField f,
java.lang.String[] row)
Gets specified field style from values array.
|
java.lang.String[] |
getTargetObject(java.lang.String rowId,
java.lang.String[] row)
Hook to substitute the current object/instance/rowId to another target object.
|
java.lang.String |
getUserKeyLabel(java.lang.String[] row)
Build a label to represent the user key of the record.
|
java.lang.String |
getUserKeySearch(java.lang.String[] row)
Build a label to represent the searchable fields.
|
void |
initAgenda(Agenda agenda)
Hook to init an agenda
|
void |
initAssociate(ObjectDB parent)
Hook to init the association before associate dialog
|
void |
initCopy()
Hook to init the Copy before user dialog
|
void |
initCreate()
Hook to init the Creation before user dialog
|
void |
initCrosstab(java.lang.String crosstabName)
Hook to init a crosstable
|
void |
initDataMapSelect(java.lang.String dataMapName,
ObjectDB parent)
Hook to init the data map select before user dialog
|
void |
initDelete()
Hook to init the Delete before delete dialog
|
void |
initExport()
Hook to init the Export before export dialog
|
void |
initGraph(java.lang.String graphName)
Hook to init a graph
|
void |
initList(ObjectDB parent)
Hook to init the List before user dialog
|
void |
initPlaceMap(PlaceMap placemap)
Hook to init a place map
|
void |
initPrintTemplate(java.lang.String printTemplateName)
Hook to init a print templates
|
void |
initRefSelect(ObjectDB parent)
Hook to init the reference select before select dialog
|
void |
initSearch()
Hook to init the Search before user dialog
|
void |
initUpdate()
Hook to init the Update before update dialog
|
java.lang.String |
invokeAction(Action action)
Action call
|
void |
invokeCallback(java.lang.String callbackName)
Simple callback method call
|
java.lang.Object |
invokeMethod(java.lang.String methodName,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] paramValues)
Method call with args
|
java.lang.Object |
invokePrint(PrintTemplate prt)
Print method call
|
boolean |
isActionEnable(java.lang.String[] row,
java.lang.String action)
Hook to check if one action is available for a specific record.
|
boolean |
isCopyEnable(java.lang.String[] row)
Hook to check if the copy action is available for a specified record
This method must be called to check if the action is available for the user and the specified record.
|
boolean |
isCreateEnable()
Hook to check if the create action is available
This method must be called to check if the action is available for the user.
|
boolean |
isCrosstabEnable(java.lang.String crosstab)
Hook to check if crosstab is available.
|
boolean |
isDeleteEnable(java.lang.String[] row)
Hook to check if the delete action is available for a specified record
This method must be called to check if the action is available for the user and the specified record.
|
boolean |
isGraphEnable(java.lang.String graph)
Hook to check if chart is available.
|
boolean |
isHistoric()
Is historizable ?
|
boolean |
isMergeMaster()
Hook to tell is current record the merge master ?
|
boolean |
isOpenEnable(java.lang.String[] row)
Hook to check if the open action is available for a specific record.
|
boolean |
isPrintTemplateEnable(java.lang.String[] row,
java.lang.String printTemplate)
Hook to check if print template is available for a specific record.
|
boolean |
isStateTransitionEnable(java.lang.String fromStatus,
java.lang.String toStatus)
Hook called when building the list of possible state transition.
|
boolean |
isUndoable()
Hook to allow undo/redo on the object
|
boolean |
isUpdateEnable(java.lang.String[] row)
Hook to check if the update action is available for a specified record
This method must be called to check if the action is available for the user and the specified record.
|
ObjectDB |
load(Grant grant)
Object definition loading
|
java.lang.String |
postAlert(Alert a)
Hook before after sending the alert
|
java.lang.String |
postCreate()
Hook called after the DB creation
|
java.lang.String |
postDelete()
Hook called after the DB deletion.
|
void |
postDeleteAll()
Hook called after bulk delete.
|
java.util.Vector<java.lang.String[]> |
postExport(java.util.Vector<java.lang.String[]> rows)
Hook called after search in export of data.
|
java.lang.String |
postImport()
Hook called after processing object import.
|
void |
postLoad()
Hook called after loading the object definition.
|
java.util.Vector<java.lang.String[]> |
postObjectSearch(java.util.Vector<java.lang.String[]> rows)
Hook called after search of object reference.
|
void |
postRedo()
Hook called after redo
|
java.lang.String |
postSave()
Hook called after the DB save
|
java.util.Vector<java.lang.String> |
postSaveTimesheet(Timesheet ts)
Hook called after Timesheet save
|
java.util.Vector<java.lang.String[]> |
postSearch(java.util.Vector<java.lang.String[]> rows)
Hook called after search with the fields filters.
|
void |
postSelect(java.lang.String rowId,
boolean copy)
Hook called after a single row selection
|
void |
postUndo()
Hook called after undo
|
java.lang.String |
postUpdate()
Hook called after the DB update
|
void |
postUpdateAll()
Hook called after bulk update.
|
java.util.Vector<java.lang.String> |
postValidate()
Hook called after system validation.
|
java.util.Vector<java.lang.String> |
postValidateSearch()
Hook called after search validation with the fields filters.
|
java.lang.String |
preAlert(Alert a)
Hook before before sending the alert
|
java.lang.String |
preCreate()
Hook called before the DB creation
|
java.lang.String |
preDelete()
Hook called before the DB deletion
|
java.lang.String |
preDeleteAll()
Hook called before bulk delete.
|
void |
preExport()
Hook called before search in export of data.
|
java.lang.String |
preImport()
Hook called before processing object import.
|
void |
preObjectSearch()
Hook called before search of object reference.
|
boolean |
preRedo()
Hook called before redo
|
java.lang.String |
preSave()
Hook called before the DB save
|
java.util.Vector<java.lang.String> |
preSaveTimesheet(Timesheet ts)
Hook called before Timesheet save
|
void |
preSearch()
Hook called before search with the fields filters.
|
void |
preSelect(java.lang.String rowId,
boolean copy)
Hook called before a single row selection
|
java.util.Vector<java.lang.String> |
preStateTransition(java.lang.String fromStatus,
java.lang.String toStatus)
Hook called just before pre validate hook in case of a state transition.
|
boolean |
preUndo()
Hook called before undo
|
java.lang.String |
preUpdate()
Hook called before the DB update
|
java.lang.String |
preUpdateAll()
Hook called before bulk update.
|
java.util.Vector<java.lang.String> |
preValidate()
Hook called before system validation.
|
java.util.Vector<java.lang.String> |
preValidateSearch()
Hook called before search validation with the fields filters.
|
boolean |
spamEmail(java.lang.String alert,
java.lang.String group,
java.lang.String email)
Hook called to check if the email is a recipient of the alert
|
boolean |
spamGroup(java.lang.String alert,
java.lang.String group)
Hook called to check if the group is a recipient of the alert
|
addLink, addLinkMetaObject, buildTreeList, canUpdateAllEnum, canUpdateAllStatus, checkCreateVisibilities, checkDelete, checkDeleteVisibilities, checkUpdateVisibilities, completeForeignKeys, count, create, del, delete, delete, deleteTree, evalCalculatedFields, evalCalculatedFields, evalNextRowId, evalObjectCalculatedFields, getAlert, getContext, getCount, getFieldDefaultValue, getFileName, getFilePath, getFirstRowId, getLastRowId, getNextRowId, getParentObject, getPreviousRowId, getQuery, getRefCount, getSearchSpec, getTemplateRoot, init, init, initFromTable, initUpdateAll, initWebService, invokeAction, invokePrint, load, makeTree, merge, populate, populate, populate, populateForeignKey, preLoad, prepareTemplate, save, search, search, search, searchCrosstab, searchExport, searchRowId, searchRowId, select, select, select, storeParentContext, storeParentContext, update, validate, validate, validateSearch
addAgenda, addConstraint, addCrosstab, addDataMap, addDefaultValues, addGraph, addHook, addLinkDataMap, addListOperationField, addPlaceMap, addPredefinedSearch, addPrintTemplate, addScript, addSharedScript, addTimesheet, applyConstraints, applyFieldConstraints, applyObjectConstraints, applyTargetConstraints, buildInsertSQL, canClose, canCopy, canCreateOnLinks, canDeleteAll, canExport, canFollowLink, canFollowLinks, canListAccessNewForm, canListAccessNewLine, canListAccessNewLoop, canPrint, canSave, canSelectRow, canUpdateAll, checkCreateConstraints, checkDeleteConstraints, checkUpdateConstraints, convertFilterToService, convertGuiToService, convertServiceToFilter, convertServiceToGui, enableGC, evalExpression, evalExpression, evalExpression, evalInputOldValue, evalInputValue, fieldsToListRow, fieldsToListRow, freeListTree, garbageCollection, genAction, genCommonActions, getAction, getActions, getAgenda, getAgendas, getBooleanParameter, getCacheFrom, getCacheKey, getCacheSelect, getCode, getCodes, getContextTitle, getCopyId, getCreatedBy, getCreatedDate, getCrosstab, getCrosstabs, getCtxHelp, getCtxHelps, getCurrentAction, getCurrentItem, getCurrentList, getCurrentPage, getCurrentPos, getCurrentRowId, getCurrentView, getData, getDataMap, getDataSource, getDataSourceVendor, getDbField, getDBField, getDbIndex, getDBIndex, getDBName, getDefaultLink, getDefaultSearchSpec, getDisplay, getDisplay, getDocFields, getDoubleParameter, getField, getField, getField, getField, getFieldArea, getFieldArea, getFieldAreas, getFieldAtIndex, getFieldByTranslation, getFieldFilter, getFieldIndex, getFieldIndex, getFieldOldValue, getFieldOrder, getFields, getFields, getFieldValue, getFieldValues, getFieldValues, getFilters, getFilters, getFlagParameter, getFloatParameter, getFonctId, getForeignKeys, getFormLayout, getFullInput, getFullInput, getFullInputIndex, getFullInputIndex, getFunctId, getGrant, getGraph, getGraphs, getHelp, getHistoricDBName, getHistoricName, getHook, getHooks, getIconCode, getId, getImage, getImageField, getIndex, getIndex, getInheritedObjects, getInput, getInput, getInputAtIndex, getInputIndex, getInputIndex, getInstanceName, getIntParameter, getLastUpdatedBy, getLastUpdatedDate, getLink, getLinkDataMap, getLinks, getListEditMode, getListOperationFields, getListSize, getListTree, getLongParameter, getMaxPage, getName, getObjectId, getObjectName, getObjectParameter, getOldStatus, getOldValues, getOldValues, getParameter, getParameter, getParentField, getParentIdx, getParentObjectRefField, getParentValues, getPlaceMap, getPlaceMaps, getPredefinedSearch, getPredefinedSearchIndex, getPrintTemplate, getPrintTemplates, getRefField, getRootField, getRowId, getRowIdField, getScripts, getSearchLimit, getSearchSpec, getSelectedIds, getSharedScripts, getStatus, getStatusField, getStatusIndex, getStyle, getTable, getTemplate, getTimesheet, getTimesheets, getTitle, getTitle, getValues, getValues, getView, getView, getViewMode, getViews, hasChanged, hasField, hasFieldType, hasFullInput, hasInput, hasMoreOnForm, hasMoreOnList, hasMoreOnSearch, hasSearchLimitError, haveMore, initLists, isAgendaInstance, isAreaVisible, isBatchInstance, isChildOf, isChildOf, isCopied, isCopy, isDataMapInstance, isDataMappedFrom, isDate, isDistinct, isExport, isFieldForbidden, isFieldSearchable, isFieldUpdatable, isFieldVisible, isFiltered, isForm, isHomeInstance, isIndexable, isInstanceOf, isLimit, isListEditable, isListSearch, isListSearchVisible, isListTree, isLoaded, isMainInstance, isMenuSearch, isMergeable, isModelerInstance, isMoreForm, isMoreFormEnable, isMoreListEnable, isMoreOnForm, isMoreOnList, isMoreRows, isMoreSearch, isNew, isPanelInstance, isPanelOf, isPanelOf, isPredefSearch, isProcessInstance, isQuerySpecific, isReadOnly, isReadOnlyFields, isRefCount, isRefCountEnable, isReferencedFrom, isReferencedFrom, isRefInstance, isScripted, isServiceSpecific, isSocial, isTmpInstance, isTreeviewInstance, isUIInstance, isUpdateAll, isWebServiceInstance, lastUsage, listRowToFields, listRowToFields, listRowToFields, listSelectAll, listSelectId, listSelectPage, listUnselectAll, listUnselectId, oldFieldsToListRow, oldFieldsToListRow, parseDataSourceName, parseTableName, prepareExpression, preparePagination, prepareSQL, removeField, removeParameter, removeParameters, resetAllFields, resetAllFieldsRequired, resetAllFieldsSearch, resetAllFieldsSearchRequired, resetAllFieldsUpdatable, resetContextDefaultValues, resetFilter, resetFilters, resetFilters, resetFiltersOrdersAndCalcDefaults, resetOrder, resetOrder, resetOrders, resetOrders, resetRequireds, resetSearchables, resetSelectedIds, resetUpdatables, resetValues, resetValues, resetVisibilities, selectCurrentItemFromList, selectItemFromList, setAllFieldsUpdatable, setAllFieldUpdatable, setCacheFrom, setCacheSelect, setClose, setCopy, setCopyId, setCreateOnLinks, setCrosstabVisibility, setCtxHelps, setCurrentAction, setCurrentList, setCurrentPage, setCurrentPos, setCurrentPos, setCurrentView, setData, setDataSource, setDataSourceVendor, setDBName, setDefaultLink, setDefaultSearchSpec, setDeleteAll, setDisplay, setDistinct, setExport, setFieldFilter, setFieldOldValue, setFieldOrder, setFields, setFieldValue, setFilters, setFilters, setFilters, setFollowLinks, setForm, setFormLayout, setFunctId, setGrant, setHaveMore, setHelp, setHistoric, setIconCode, setId, setIndexable, setInheritedObject, setInstanceName, setLimit, setListAccessNewForm, setListAccessNewLine, setListAccessNewLine, setListEdit, setListEditable, setListEditMode, setListSearch, setListSearchVisible, setListSize, setListTree, setMaxPage, setMenuSearch, setMergeable, setMoreForm, setMoreOnForm, setMoreOnList, setMoreRows, setMoreSearch, setName, setOldValues, setOldValues, setOldValues, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParentObject, setParentObjectRefField, setParentValues, setPredefinedSearchIndex, setPredefSearch, setPrint, setPrintTemplateVisibility, setQuerySpecific, setReadOnly, setRefCount, setRowId, setSave, setSearchLimit, setSearchLimitError, setSearchSpec, setSearchSpec, setSelectRow, setServiceSpecific, setSocial, setStatus, setStatus, setStatus, setStatusField, setTable, setTemplate, setTimeStamp, setTitle, setUpdateAll, setValues, setValues, setValues, setValues, setValues, setValues, setValues, setViewMode, stateUpdated, toHTML, toHTML, toJSON, toJSON, toJSON, toJSON, toJSON, toJSON, toJSON, toJSON, toJSON, toString, toString, updateState, useForm, useLimit, useTimeStamp
public void clear()
public java.lang.Object evalExpression(java.lang.String expr, int context, java.lang.String[] row, java.util.HashMap<java.lang.String,java.lang.Object> in, java.util.HashMap<java.lang.String,java.lang.Object> out) throws com.simplicite.util.exceptions.ScriptException
evalExpression
in class ObjectCore
expr
- Expressioncontext
- Contextrow
- Row (null means selected item)in
- Input variables to set before expression evaluationout
- Output variables to retrieve after expression evaluationcom.simplicite.util.exceptions.ScriptException
public void checkExpression(java.lang.String expr) throws com.simplicite.util.exceptions.ScriptException
ObjectCore
Prepares an expression and apply structural and elementary syntax checks, this method is only intended to this basic usage
checkExpression
in class ObjectCore
expr
- Expressioncom.simplicite.util.exceptions.ScriptException
public ObjectDB load(Grant grant)
ObjectDB
Object definition loading
public void postLoad()
ObjectDB
Hook called after loading the object definition.
public void initCopy()
ObjectDB
Hook to init the Copy before user dialog
public void initCreate()
ObjectDB
Hook to init the Creation before user dialog
initCreate
in class ObjectDB
public void initUpdate()
ObjectDB
Hook to init the Update before update dialog
initUpdate
in class ObjectDB
public void initDelete()
ObjectDB
Hook to init the Delete before delete dialog
initDelete
in class ObjectDB
public void initList(ObjectDB parent)
ObjectDB
Hook to init the List before user dialog
public void initRefSelect(ObjectDB parent)
ObjectDB
Hook to init the reference select before select dialog
initRefSelect
in class ObjectDB
public void initAssociate(ObjectDB parent)
ObjectDB
Hook to init the association before associate dialog
initAssociate
in class ObjectDB
public void initDataMapSelect(java.lang.String dataMapName, ObjectDB parent)
ObjectDB
Hook to init the data map select before user dialog
initDataMapSelect
in class ObjectDB
public void initExport()
ObjectDB
Hook to init the Export before export dialog
initExport
in class ObjectDB
public void initCrosstab(java.lang.String crosstabName)
ObjectDB
Hook to init a crosstable
initCrosstab
in class ObjectDB
public void initGraph(java.lang.String graphName)
ObjectDB
Hook to init a graph
public void initPrintTemplate(java.lang.String printTemplateName)
ObjectDB
Hook to init a print templates
initPrintTemplate
in class ObjectDB
public void initAgenda(Agenda agenda)
ObjectDB
Hook to init an agenda
initAgenda
in class ObjectDB
public void initPlaceMap(PlaceMap placemap)
ObjectDB
Hook to init a place map
initPlaceMap
in class ObjectDB
public void initSearch()
ObjectDB
Hook to init the Search before user dialog
initSearch
in class ObjectDB
public java.util.Vector<java.lang.String> preValidateSearch()
ObjectDB
Hook called before search validation with the fields filters. It may be useful to check filters.
preValidateSearch
in class ObjectDB
public java.util.Vector<java.lang.String> postValidateSearch()
ObjectDB
Hook called after search validation with the fields filters. It may be useful to check filters.
postValidateSearch
in class ObjectDB
public java.util.Vector<java.lang.String> preValidate()
ObjectDB
Hook called before system validation. It may be useful to force/calculate mandatory values.
preValidate
in class ObjectDB
public java.util.Vector<java.lang.String> postValidate()
ObjectDB
Hook called after system validation. It may be useful to check specific rules before update.
postValidate
in class ObjectDB
public java.util.Vector<java.lang.String> preStateTransition(java.lang.String fromStatus, java.lang.String toStatus)
ObjectDB
Hook called just before pre validate hook in case of a state transition. It may be useful to isolate specific state transition pre validation rules from other pre validation rules.
preStateTransition
in class ObjectDB
fromStatus
- From statustoStatus
- To statuspublic long getCount(int maxRows)
ObjectDB
Return the records count with the current search specification and filters.
public void preSearch()
ObjectDB
Hook called before search with the fields filters. It may be useful to add some specific filters.
public java.util.Vector<java.lang.String[]> postSearch(java.util.Vector<java.lang.String[]> rows)
ObjectDB
Hook called after search with the fields filters. It may be useful to calculate fields or to change the records.
postSearch
in class ObjectDB
rows
- The database resultpublic void preObjectSearch()
ObjectDB
Hook called before search of object reference. It may be useful to add some specific filters.
preObjectSearch
in class ObjectDB
public java.util.Vector<java.lang.String[]> postObjectSearch(java.util.Vector<java.lang.String[]> rows)
ObjectDB
Hook called after search of object reference. It may be useful to calculate fields or to change the records.
postObjectSearch
in class ObjectDB
rows
- The database resultpublic void preSelect(java.lang.String rowId, boolean copy)
ObjectDB
Hook called before a single row selection
public void postSelect(java.lang.String rowId, boolean copy)
ObjectDB
Hook called after a single row selection
postSelect
in class ObjectDB
rowId
- The unique selected row_idcopy
- Indicate if it's a select for a future copypublic java.lang.String preCreate()
ObjectDB
Hook called before the DB creation
public java.lang.String postCreate()
ObjectDB
Hook called after the DB creation
postCreate
in class ObjectDB
public java.lang.String preUpdate()
ObjectDB
Hook called before the DB update
public java.lang.String postUpdate()
ObjectDB
Hook called after the DB update
postUpdate
in class ObjectDB
public java.lang.String preSave()
ObjectDB
Hook called before the DB save
public java.lang.String postSave()
ObjectDB
Hook called after the DB save
public java.lang.String preDelete()
ObjectDB
Hook called before the DB deletion
public java.lang.String postDelete()
ObjectDB
Hook called after the DB deletion.
postDelete
in class ObjectDB
public boolean canUpdateAll(ObjectField f)
ObjectDB
True if the field is bulk updatable, to override for specific behavior.
By default, return true if:
- the field (and its foreign key) is visible and updatable,
- not the single functional key in the object,
- for status field, if the selection is in a same status.
canUpdateAll
in class ObjectDB
public java.lang.String preUpdateAll()
ObjectDB
Hook called before bulk update.
preUpdateAll
in class ObjectDB
public void postUpdateAll()
ObjectDB
Hook called after bulk update.
postUpdateAll
in class ObjectDB
public java.lang.String preDeleteAll()
ObjectDB
Hook called before bulk delete.
preDeleteAll
in class ObjectDB
public void postDeleteAll()
ObjectDB
Hook called after bulk delete.
postDeleteAll
in class ObjectDB
public java.util.Vector<java.lang.String> preSaveTimesheet(Timesheet ts)
ObjectDB
Hook called before Timesheet save
preSaveTimesheet
in class ObjectDB
public java.util.Vector<java.lang.String> postSaveTimesheet(Timesheet ts)
ObjectDB
Hook called after Timesheet save
postSaveTimesheet
in class ObjectDB
public void preExport()
ObjectDB
Hook called before search in export of data. It may be useful to add some specific filters.
public java.util.Vector<java.lang.String[]> postExport(java.util.Vector<java.lang.String[]> rows)
ObjectDB
Hook called after search in export of data. It may be useful to calculate fields or to change the records.
postExport
in class ObjectDB
rows
- The database resultpublic java.lang.String preImport()
ObjectDB
Hook called before processing object import.
It may be useful to add data to imported data
(attention : imported data cannot be changed here)
or to execute business rules before actually processing the import
public java.lang.String postImport()
ObjectDB
Hook called after processing object import. It may be useful to execute business rules after actually processing the import
postImport
in class ObjectDB
public boolean isActionEnable(java.lang.String[] row, java.lang.String action)
ObjectDB
Hook to check if one action is available for a specific record. This method must be called to check if the action is available for the user.
isActionEnable
in class ObjectDB
row
- Current recordaction
- Action namepublic boolean isPrintTemplateEnable(java.lang.String[] row, java.lang.String printTemplate)
ObjectDB
Hook to check if print template is available for a specific record. This method must be called to check if the print template is available for the user.
isPrintTemplateEnable
in class ObjectDB
printTemplate
- Print template namepublic boolean isMergeMaster()
ObjectDB
isMergeMaster
in class ObjectDB
public boolean isOpenEnable(java.lang.String[] row)
ObjectDB
Hook to check if the open action is available for a specific record. This method must be called to check if the action is available for the user.
isOpenEnable
in class ObjectDB
row
- Current recordpublic boolean isCreateEnable()
ObjectDB
Hook to check if the create action is available This method must be called to check if the action is available for the user.
isCreateEnable
in class ObjectDB
public boolean isCopyEnable(java.lang.String[] row)
ObjectDB
Hook to check if the copy action is available for a specified record This method must be called to check if the action is available for the user and the specified record.
isCopyEnable
in class ObjectDB
row
- Current recordpublic boolean isUpdateEnable(java.lang.String[] row)
ObjectDB
Hook to check if the update action is available for a specified record This method must be called to check if the action is available for the user and the specified record.
isUpdateEnable
in class ObjectDB
row
- Current recordpublic boolean isStateTransitionEnable(java.lang.String fromStatus, java.lang.String toStatus)
ObjectDB
Hook called when building the list of possible state transition. It may be useful to implement specific state transition condition rules.
isStateTransitionEnable
in class ObjectDB
fromStatus
- From statustoStatus
- To statuspublic boolean isDeleteEnable(java.lang.String[] row)
ObjectDB
Hook to check if the delete action is available for a specified record This method must be called to check if the action is available for the user and the specified record.
isDeleteEnable
in class ObjectDB
row
- Current recordpublic boolean isCrosstabEnable(java.lang.String crosstab)
ObjectDB
Hook to check if crosstab is available. This method must be called to check if the crosstab is available for the user.
isCrosstabEnable
in class ObjectDB
crosstab
- Crosstab namepublic boolean isGraphEnable(java.lang.String graph)
ObjectDB
Hook to check if chart is available. This method must be called to check if the chart is available for the user.
isGraphEnable
in class ObjectDB
graph
- Chart namepublic boolean canFollowLink(ObjectField field)
ObjectCore
canFollowLink
in class ObjectCore
field
- Reference field (foreign key)public boolean canCreateOnLink(ObjectField field)
ObjectCore
canCreateOnLink
in class ObjectCore
field
- Reference fieldpublic boolean canReference(java.lang.String object, java.lang.String field)
ObjectDB
Hook called to check if a referenced object can be displayed
canReference
in class ObjectDB
object
- Linked object name or view namefield
- Field name of foreign key (optional in case of object view)public boolean isHistoric()
ObjectCore
isHistoric
in class ObjectCore
public java.lang.String invokeAction(Action action) throws java.lang.Exception
ObjectDB
Action call
invokeAction
in class ObjectDB
action
- Actionjava.lang.Exception
public java.lang.Object invokePrint(PrintTemplate prt) throws java.lang.Exception
ObjectDB
Print method call
invokePrint
in class ObjectDB
prt
- Print templatejava.lang.Exception
public void invokeCallback(java.lang.String callbackName) throws java.lang.Exception
ObjectDB
Simple callback method call
invokeCallback
in class ObjectDB
callbackName
- Callback namejava.lang.Exception
public java.lang.Object invokeMethod(java.lang.String methodName, java.lang.Class<?>[] paramTypes, java.lang.Object[] paramValues) throws java.lang.Exception
ObjectDB
Method call with args
invokeMethod
in class ObjectDB
methodName
- Method nameparamTypes
- Table of class typesparamValues
- Table of valuesjava.lang.Exception
public java.lang.String[] getTargetObject(java.lang.String rowId, java.lang.String[] row)
ObjectCore
Hook to substitute the current object/instance/rowId to another target object. Applied in case of row action (open, copy, print...). Useful in case of inheritance, redirection to another object or table.
getTargetObject
in class ObjectCore
rowId
- Target rowIdrow
- Optional, current row if known, otherwise the record have to be selected with the rowIdpublic boolean isUndoable()
ObjectDB
Hook to allow undo/redo on the object
isUndoable
in class ObjectDB
public boolean preUndo()
ObjectDB
Hook called before undo
public void postUndo()
ObjectDB
Hook called after undo
public boolean preRedo()
ObjectDB
Hook called before redo
public void postRedo()
ObjectDB
Hook called after redo
public java.lang.String getUserKeyLabel(java.lang.String[] row)
ObjectDB
Build a label to represent the user key of the record. if row is null, the selected fields are used. May be overrided to implement specific label.
getUserKeyLabel
in class ObjectDB
row
- Any record, if row is null, the selected fields are usedpublic java.lang.String getUserKeySearch(java.lang.String[] row)
ObjectDB
Build a label to represent the searchable fields. if row is null, the selected fields are used. May be overrided to implement specific label.
getUserKeySearch
in class ObjectDB
row
- Any record, if row is null, the selected fields are usedpublic java.lang.String getStyle(ObjectField f, java.lang.String[] row)
ObjectCore
Gets specified field style from values array.
May be override to change the style with specific business rules
getStyle
in class ObjectCore
f
- Fieldrow
- Values arraypublic java.lang.String getStyle(ObjectField f, double d)
ObjectCore
Hook to specify field style for a crosstab value.
getStyle
in class ObjectCore
f
- Fieldd
- Valuepublic java.lang.String getImage(ObjectField f, java.lang.String[] row)
ObjectCore
getImage
in class ObjectCore
f
- Fieldrow
- Values arraypublic java.lang.String getAgendaDay(Agenda a, java.util.Date d)
ObjectDB
Hook to override agenda displayed date, usefull to add specific actions at the day header
getAgendaDay
in class ObjectDB
a
- Agenda definitiond
- Any datepublic java.lang.String getAgendaLabel(Agenda a, ObjectField f)
ObjectDB
Hook to customize agenda displayed field
getAgendaLabel
in class ObjectDB
a
- Agenda definitionf
- Agenda field to displaypublic java.lang.String getAgendaSelector(Agenda a, java.lang.String selector)
ObjectDB
Hook to override agenda displayed selector, usefull to mask or list specific users/groups at the agenda header
getAgendaSelector
in class ObjectDB
a
- Agenda definitionselector
- Generated selector based on the agenda linkspublic java.lang.String getAgendaValue(Agenda a, ObjectField f, java.lang.String val)
ObjectDB
Hook to customize agenda displayed value
getAgendaValue
in class ObjectDB
a
- Agenda definitionf
- Agenda field to displayval
- Value to displaypublic java.lang.String getAgendaWeek(Agenda a, java.util.Vector<java.lang.String> days)
ObjectDB
Hook to override agenda displayed week, usefull to add specific actions at the agenda header
getAgendaWeek
in class ObjectDB
a
- Agenda definitiondays
- Days of the week in service format yyyy-MM-ddpublic java.lang.String preAlert(Alert a)
ObjectDB
Hook before before sending the alert
public java.lang.String postAlert(Alert a)
ObjectDB
Hook before after sending the alert
public java.util.Date getDeadlineDate(java.lang.String row_id, java.lang.String state, java.lang.String update_dt, int timeout)
ObjectDB
Eval the timeout date of the object state (can be overrided with a specific rule)
getDeadlineDate
in class ObjectDB
row_id
- row_id (to select the record if needed)state
- Current stateupdate_dt
- Last update date in service format yyyy-MM-dd HH:mm:sstimeout
- Default designed delay in secondspublic char getEmailRecipientType(java.lang.String alert, java.lang.String email, char type)
ObjectDB
Hook to override the recipient type (TO/CC/BCC)
getEmailRecipientType
in class ObjectDB
alert
- Alert nameemail
- Emailtype
- Default designed typepublic char getGroupEmailRecipientType(java.lang.String alert, java.lang.String group, char type)
ObjectDB
Hook to override the recipient type (TO/CC/BCC) of a group
getGroupEmailRecipientType
in class ObjectDB
alert
- Alert namegroup
- Group nametype
- Default designed typepublic boolean spamEmail(java.lang.String alert, java.lang.String group, java.lang.String email)
ObjectDB
Hook called to check if the email is a recipient of the alert
public boolean spamGroup(java.lang.String alert, java.lang.String group)
ObjectDB
Hook called to check if the group is a recipient of the alert
public java.util.ArrayList<java.lang.String> fieldCompletion(java.lang.String field, java.lang.String query, java.lang.String context)
ObjectDB
Hook to override the default field completion (Lucene or SQL search on field)
- Usefull to implement an editable select-box, to call a WebService and/or to populate a specific list of choice
- On client-side, use the field_completed(value) hook in the template to handle the selected value by user
fieldCompletion
in class ObjectDB
field
- Field to searchquery
- User query/filtercontext
- Field context = form, search or listpublic java.lang.String displayForm(java.lang.Object params, java.lang.Object nav, java.lang.Object page) throws java.lang.Exception
ObjectDB
displayForm
in class ObjectDB
java.lang.Exception
public java.lang.String displayList(java.lang.Object list, java.lang.Object params, java.lang.Object nav, ObjectDB parent) throws java.lang.Exception
ObjectDB
displayList
in class ObjectDB
java.lang.Exception
public java.lang.String displaySearch(java.lang.Object search, java.lang.Object params, java.lang.Object nav) throws java.lang.Exception
ObjectDB
displaySearch
in class ObjectDB
java.lang.Exception
public java.lang.String displayRefSelect(java.lang.Object selector, java.lang.Object params, java.lang.Object nav) throws java.lang.Exception
ObjectDB
displayRefSelect
in class ObjectDB
java.lang.Exception
public java.lang.String displayDataMap(java.lang.Object selector, java.lang.Object params, java.lang.Object nav) throws java.lang.Exception
ObjectDB
displayDataMap
in class ObjectDB
java.lang.Exception
Copyright (c)2006-2014 Simplicite Software. All Rights Reserved.