|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.sys.document.authorization.AccountingLineAuthorizerBase
public class AccountingLineAuthorizerBase
The default implementation of AccountingLineAuthorizer
Constructor Summary | |
---|---|
AccountingLineAuthorizerBase()
|
Method Summary | |
---|---|
protected boolean |
approvedForUnqualifiedEditing(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
boolean currentUserIsDocumentInitiator)
Determines if the given line is editable, no matter what a KIM check would say about line editability. |
boolean |
determineEditPermissionOnField(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
String fieldName,
boolean editablePage)
Allows the overriding of whether a field on an accounting line is editable or not |
boolean |
determineEditPermissionOnLine(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
boolean currentUserIsDocumentInitiator,
boolean pageIsEditable)
A hook to decide, pre-KIM check, if there's an edit permission on the given accounting line |
protected String |
getActionInfixForExtantAccountingLine(AccountingLine accountingLine,
String accountingLinePropertyName)
Gets the "action infix" for the given accounting line which already exists on the document, so that the action knows it is supposed to add to source vs. |
protected String |
getActionInfixForNewAccountingLine(AccountingLine accountingLine,
String accountingLinePropertyName)
Gets the "action infix" for the given accounting line, so that the action knows it is supposed to add to source vs. |
protected String |
getActionLabel(String messageKey,
Object... values)
get a label for an action with the specified message key and values |
protected Map<String,AccountingLineViewAction> |
getActionMap(AccountingLineRenderingContext accountingLineRenderingContext,
String accountingLinePropertyName,
Integer accountingLineIndex,
String groupTitle)
collection the actions that are allowed for the given accounting line |
List<AccountingLineViewAction> |
getActions(AccountingDocument accountingDocument,
AccountingLineRenderingContext accountingLineRenderingContext,
String accountingLinePropertyName,
Integer accountingLineIndex,
org.kuali.rice.kim.bo.Person currentUser,
String groupTitle)
Returns the basic actions - add for new lines, delete and balance inquiry for existing lines |
protected AccountingLineViewAction |
getAddAction(AccountingLine accountingLine,
String accountingLinePropertyName,
String groupTitle)
construct the add action for the given accounting line, typically, a new accounting line |
protected String |
getAddMethod(AccountingLine accountingLine,
String accountingLineProperty)
Builds the action method name of the method that adds accounting lines for this group |
protected AccountingLineViewAction |
getBalanceInquiryAction(AccountingLine accountingLine,
String accountingLinePropertyName,
Integer accountingLineIndex,
String groupTitle)
construct the balance inquiry action for the given accounting line |
protected String |
getBalanceInquiryMethod(AccountingLine accountingLine,
String accountingLineProperty,
Integer accountingLineIndex)
Builds the action method name of the method that performs a balance inquiry on accounting lines for this group |
protected AccountingLineViewAction |
getDeleteAction(AccountingLine accountingLine,
String accountingLinePropertyName,
Integer accountingLineIndex,
String groupTitle)
construct the delete action for the given accounting line |
protected String |
getDeleteLineMethod(AccountingLine accountingLine,
String accountingLineProperty,
Integer accountingLineIndex)
Builds the action method name of the method that deletes accounting lines for this group |
protected String |
getFieldName(AccountingLineViewField field)
get the full property name of the given field |
protected String |
getKFSImagePath()
|
protected String |
getKimHappyPropertyNameForField(String convertedName)
|
protected String |
getRiceImagePath()
|
Set<String> |
getUnviewableBlocks(AccountingDocument accountingDocument,
AccountingLine accountingLine,
boolean newLine,
org.kuali.rice.kim.bo.Person currentUser)
Returns a new empty HashSet |
boolean |
hasEditPermissionOnAccountingLine(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
org.kuali.rice.kim.bo.Person currentUser,
boolean pageIsEditable)
Determine whether the current user has permission to edit the given accounting line as a whole |
boolean |
hasEditPermissionOnField(AccountingDocument accountingDocument,
AccountingLine accountingLine,
String accountingLineCollectionProperty,
String fieldName,
boolean editableLine,
boolean editablePage,
org.kuali.rice.kim.bo.Person currentUser)
determine whether the current user has permission to edit the given field in the given accounting line |
protected boolean |
isErrorMapContainingErrorsOnLine(String accountingLinePropertyName)
Determines if the error map contains any errors which exist on the currently rendered accounting line |
boolean |
isGroupEditable(AccountingDocument accountingDocument,
List<? extends AccountingLineRenderingContext> accountingLineRenderingContexts,
org.kuali.rice.kim.bo.Person currentUser)
Determines if any entire group is rendered as editable, which means that a new line will appear |
boolean |
renderNewLine(AccountingDocument accountingDocument,
String accountingGroupProperty)
Determines if new lines should be rendered for the given accounting line group (identified by its property name) |
protected String |
replaceCollectionElementsWithPlurals(String name)
Replaces references to collection elements to their respective plural names WARNING: this method is totally lame and I for one wished it didn't have to exist |
protected String |
stripDocumentPrefixFromName(String name)
Strips "document." and everything before from the property name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccountingLineAuthorizerBase()
Method Detail |
---|
public final List<AccountingLineViewAction> getActions(AccountingDocument accountingDocument, AccountingLineRenderingContext accountingLineRenderingContext, String accountingLinePropertyName, Integer accountingLineIndex, org.kuali.rice.kim.bo.Person currentUser, String groupTitle)
getActions
in interface AccountingLineAuthorizer
accountingDocument
- the accounting document the line to authorize is owned byaccountingLineRenderingContext
- a renderable context wrapping the accounting line that is being authorized againstaccountingLinePropertyName
- the name of the property that represents the accounting lineaccountingLineIndex
- value, as Integer, of the index of the given accounting line within the group's collection of accounting
lines; if null, then it is assumed that this is a new linegroupTitle
- title of the group from the data dictionary
org.kuali.kfs.sys.document.authorization.AccountingLineAuthorizer#getActions(org.kuali.kfs.sys.document.AccountingDocument,
org.kuali.kfs.sys.businessobject.AccountingLine, java.lang.String, java.lang.Integer, org.kuali.rice.kim.bo.Person,
java.lang.String)
protected boolean isErrorMapContainingErrorsOnLine(String accountingLinePropertyName)
accountingLinePropertyName
- the property name of the accounting line
public Set<String> getUnviewableBlocks(AccountingDocument accountingDocument, AccountingLine accountingLine, boolean newLine, org.kuali.rice.kim.bo.Person currentUser)
getUnviewableBlocks
in interface AccountingLineAuthorizer
accountingDocument
- the accounting document the line to authorize is owned byaccountingLine
- the accounting line that is being authorized againstnewLine
- whether the line is a new line or not
org.kuali.kfs.sys.document.authorization.AccountingLineAuthorizer#getUnviewableBlocks(org.kuali.kfs.sys.document.AccountingDocument,
org.kuali.kfs.sys.businessobject.AccountingLine, java.lang.String, boolean)
public boolean renderNewLine(AccountingDocument accountingDocument, String accountingGroupProperty)
AccountingLineAuthorizer
renderNewLine
in interface AccountingLineAuthorizer
accountingDocument
- the document that has accounting lines being authorizedaccountingGroupProperty
- the property of this accounting group
AccountingLineAuthorizer.renderNewLine(org.kuali.kfs.sys.document.AccountingDocument,
java.lang.String)
public boolean isGroupEditable(AccountingDocument accountingDocument, List<? extends AccountingLineRenderingContext> accountingLineRenderingContexts, org.kuali.rice.kim.bo.Person currentUser)
AccountingLineAuthorizer
isGroupEditable
in interface AccountingLineAuthorizer
accountingDocument
- the accounting document which the collection of line are onaccountingLineRenderingContexts
- the accounting lines of the group, wrapped in AccountingLineRenderingContext implementationscurrentUser
- the current user
org.kuali.kfs.sys.document.authorization.AccountingLineAuthorizer#isGroupEditable(org.kuali.kfs.sys.document.AccountingDocument,
java.lang.String, org.kuali.rice.kim.bo.Person)
protected Map<String,AccountingLineViewAction> getActionMap(AccountingLineRenderingContext accountingLineRenderingContext, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line group
public final boolean hasEditPermissionOnField(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, String fieldName, boolean editableLine, boolean editablePage, org.kuali.rice.kim.bo.Person currentUser)
hasEditPermissionOnField
in interface AccountingLineAuthorizer
accountingDocument
- the given accounting documentaccountingLine
- the given accounting line in the documentfieldName
- the name of a field in the given accounting lineeditableLine
- whether the parent line of this field is editableeditablePage
- whether the parent page of this field is editablecurrentUser
- the current useraccountingLineCollectionProperty
- the property of the collection the given accounting line is in
public boolean determineEditPermissionOnField(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, String fieldName, boolean editablePage)
accountingDocument
- the accounting document the line to test is onaccountingLine
- the accounting line to testaccountingLineCollectionProperty
- the property that the accounting line lives infieldName
- the name of the field we are testingeditableLine
- whether the parent line of this field is editableeditablePage
- whether the parent page of this field is editable
public final boolean hasEditPermissionOnAccountingLine(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, org.kuali.rice.kim.bo.Person currentUser, boolean pageIsEditable)
hasEditPermissionOnAccountingLine
in interface AccountingLineAuthorizer
accountingDocument
- the given accounting documentaccountingLine
- the given accounting line in the documentcurrentUser
- the current useraccountingLineCollectionProperty
- the property of the group that holds these accounting linespageIsEditable
- whether the current page is editable by the current user or not
public boolean determineEditPermissionOnLine(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, boolean currentUserIsDocumentInitiator, boolean pageIsEditable)
accountingDocument
- the accounting document the line is or wants to be associated withaccountingLine
- the accounting line itselfaccountingLineCollectionProperty
- the collection the accounting line is or would be part ofcurrentUserIsDocumentInitiator
- is the current user the initiator of the document?
protected boolean approvedForUnqualifiedEditing(AccountingDocument accountingDocument, AccountingLine accountingLine, String accountingLineCollectionProperty, boolean currentUserIsDocumentInitiator)
accountingDocument
- the accounting document the line is or wants to be associated withaccountingLine
- the accounting line itselfaccountingLineCollectionProperty
- the collection the accounting line is or would be part ofcurrentUserIsDocumentInitiator
- is the current user the initiator of the document?
protected String getKimHappyPropertyNameForField(String convertedName)
field
- AccountingLineViewField to find KIM-happy property name for
protected String getFieldName(AccountingLineViewField field)
field
- the field to get the name from
protected String stripDocumentPrefixFromName(String name)
name
- the property name to strip the document portion off of
protected String replaceCollectionElementsWithPlurals(String name)
name
- the property name with perhaps collection elements in
protected AccountingLineViewAction getBalanceInquiryAction(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line group
protected AccountingLineViewAction getDeleteAction(AccountingLine accountingLine, String accountingLinePropertyName, Integer accountingLineIndex, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line group
protected AccountingLineViewAction getAddAction(AccountingLine accountingLine, String accountingLinePropertyName, String groupTitle)
accountingLine
- the given accounting lineaccountingLinePropertyName
- the property name of the given account line, typically, the form nameaccountingLineIndex
- the index of the given accounting line in its accounting line groupgroupTitle
- the title of the accounting line group
protected String getActionLabel(String messageKey, Object... values)
messageKey
- the given message key that points to the labelvalues
- the given values that would be displayed in label
protected String getAddMethod(AccountingLine accountingLine, String accountingLineProperty)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting line
protected String getDeleteLineMethod(AccountingLine accountingLine, String accountingLineProperty, Integer accountingLineIndex)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineaccountingLineIndex
- the index of the given accounting line within the the group being rendered
protected String getBalanceInquiryMethod(AccountingLine accountingLine, String accountingLineProperty, Integer accountingLineIndex)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting lineaccountingLineIndex
- the index of the given accounting line within the the group being rendered
protected String getActionInfixForNewAccountingLine(AccountingLine accountingLine, String accountingLinePropertyName)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting line
protected String getActionInfixForExtantAccountingLine(AccountingLine accountingLine, String accountingLinePropertyName)
accountingLine
- the accounting line an action is being checked foraccountingLinePropertyName
- the property name of the accounting line
protected String getRiceImagePath()
protected String getKFSImagePath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |