Class Memo
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
,OfEntity
- Direct Known Subclasses:
Issue
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
approved()
This method is invoked when the memo is finally approved.static String[]
boolean
boolean
canReopen
(SystemUser su) boolean
canReturnToInitiator
(MemoComment latestComment) static void
protected SystemUser
This method is invoked when a memo is escalated to another level.int
Typically, number of approvals required is determined by the number returned by theMemoType.getApprovalCount()
method.final String
final Date
getDate()
final Id
final int
protected String
final int
getNo()
final String
final String
final int
static String
getStatusValue
(int value) static String[]
final SystemEntity
final Id
final MemoType
getType()
final boolean
isLatestComment
(MemoComment memoComment) boolean
isMine
(SystemUser su) final Set
<SystemUser> listApprovers
(SystemEntity forEntity) final Set
<SystemUser> listCommenters
(SystemEntity forEntity) static String[]
protected void
rejected()
This method is invoked if the memo is rejected.renameAction
(String action) renameActionVerb
(String action) renameCommentAction
(String action) protected void
This is invoked just before the memo is reopened.protected void
returning
(MemoComment comment) This is invoked just before the memo is returned.save
(Transaction transaction, String content, SystemUser enteredFor) void
final void
setLastComment
(int lastComment) void
setNo
(int no) final void
setStatus
(int status) void
setSubject
(String subject) final void
setSystemEntity
(Id systemEntityId) final void
setSystemEntity
(SystemEntity systemEntity) final void
setSystemEntity
(BigDecimal idValue) final void
final void
final void
setType
(BigDecimal idValue) Display representation of the instance used for human-friendly display.void
updateSubject
(Transaction transaction, String subject) void
validate()
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions).void
This will be invoked by the system whenever the object is saved to the DB.void
This method will be invoked whenever an existing instance is deleted from the database.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validateChildAttach, validateChildDetach, validateChildUpdate, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.storedobject.core.OfEntity
check, findSystemEntityId
-
Constructor Details
-
Memo
public Memo()
-
-
Method Details
-
columns
-
browseColumns
-
protectedColumns
-
setSystemEntity
- Specified by:
setSystemEntity
in interfaceOfEntity
-
setSystemEntity
-
setSystemEntity
-
getSystemEntityId
- Specified by:
getSystemEntityId
in interfaceOfEntity
-
getSystemEntity
- Specified by:
getSystemEntity
in interfaceOfEntity
-
setType
-
setType
-
setType
-
getTypeId
-
getType
-
setNo
public void setNo(int no) -
getNo
-
setDate
-
getDate
-
setSubject
-
getSubject
-
setStatus
public final void setStatus(int status) -
getStatus
-
getStatusValues
-
getStatusValue
-
getStatusValue
-
getMemoStatus
-
renameAction
-
renameCommentAction
-
renameActionVerb
-
setLastComment
public final void setLastComment(int lastComment) -
getLastComment
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
getPendingWith
-
validateDelete
Description copied from class:StoredObject
This method will be invoked whenever an existing instance is deleted from the database. So, it will be called within an active transaction. Child classes can override this method to do validation when an existing instance is deleted from the database.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
Also, see
StoredObject.validate()
.- Overrides:
validateDelete
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validate
Description copied from class:StoredObject
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions). It will be invoked in all cases (while creating new objects and updating/deleting/un-deleting existing objects). If this method raises any exceptions, the process of saving to the DB will be abandoned.
This method is not usually used for validating data (For that purpose,
StoredObject.validateData(TransactionManager)
is recommended). It is mainly used for validating state of the object. Methods such asStoredObject.created()
,StoredObject.updated()
,StoredObject.deleted()
,StoredObject.undeleted()
etc. are used to check the specific states but overridden methods may check for other "application-specific"/"business-specific" states.This method is invoked only after one of the other operation-specific validate method is invoked depending on the save operation -
StoredObject.validateInsert()
,StoredObject.validateUpdate()
,StoredObject.validateDelete()
,StoredObject.validateUndelete()
.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
- Overrides:
validate
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
getLatestComment
-
save
- Throws:
Exception
-
updateSubject
- Throws:
Exception
-
isLatestComment
-
getReference
-
getApprovalsRequired
public int getApprovalsRequired()Typically, number of approvals required is determined by the number returned by theMemoType.getApprovalCount()
method. However, this method can be overridden and can return some other values based on some other conditions.- Returns:
- A positive number.
-
toDisplay
Description copied from class:StoredObject
Display representation of the instance used for human-friendly display.- Specified by:
toDisplay
in interfaceDisplayable
- Overrides:
toDisplay
in classStoredObject
- Returns:
- Display representation of the instance.
-
approved
protected void approved()This method is invoked when the memo is finally approved. You may set any extra attributes in your memo at this point because it will be saved after this call. If you want to carry out any other transactions in some related object, you may use theStoredObject.getTransaction()
of this. -
rejected
protected void rejected()This method is invoked if the memo is rejected. You may set any extra attributes in your memo at this point because it will be saved after this call. If you want to carry out any other transactions in some related object, you may use theStoredObject.getTransaction()
of this. -
escalating
This method is invoked when a memo is escalated to another level. This should return a system user at next level.Note: This is not used by the basic memo system because there is no concept of "escalation" in memo system. However, it could be implemented in a derived class.
- Returns:
- A system user at the next level.
-
reopening
protected void reopening()This is invoked just before the memo is reopened. You may set/change attributes of the memo at this stage. The memo will be saved after this call.Note: This is not used by the basic memo system because there is no concept of reopening a memo. However, it could be implemented in derived classes.
-
returning
This is invoked just before the memo is returned. You may set/change attributes of the memo at this stage. The memo will be saved after this call.- Parameters:
comment
- Comment entry for the receiver of the memo.
-
getContent
-
getInitialComment
-
getInitiatedById
-
getInitiatedBy
-
getLastCommentBy
-
isMine
-
listApprovers
-
listCommenters
-
listCommenters
-
listApprovers
-
canReturnToInitiator
-
canReopen
-
canEscalate
-
whyNoTakers
-