public interface ProtocolAttachmentService
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAttatchment(ProtocolAttachmentBase attachment)
Deletes an existing
ProtocolAttachmentBase. |
<T extends ProtocolAttachmentBase> |
getAttachment(Class<T> type,
Long id)
Retrieves an attachment from the database of a given type based on the attachment id.
|
<T extends ProtocolAttachmentBase & TypedAttachment> |
getAttachmentsWithOlderFileVersions(T attachment,
Class<T> type)
Deletes an existing
ProtocolAttachmentBase. |
ProtocolPersonBase |
getPerson(Integer personId)
Gets a Person BO from personId.
|
ProtocolAttachmentStatusBase |
getStatusFromCode(String code)
Gets a
ProtocolAttachmentStatus from a code. |
ProtocolAttachmentTypeBase |
getTypeFromCode(String code)
Gets a
ProtocolAttachmentType from a code. |
Collection<ProtocolAttachmentTypeBase> |
getTypesForGroup(String code)
Gets a Collection of
ProtocolAttachmentType from a group code. |
boolean |
isAttachmentActive(ProtocolAttachmentProtocolBase attachment)
This method will check if the given attachment is currently active (for the active version of the protocol it is attached to).
|
boolean |
isNewAttachmentVersion(ProtocolAttachmentProtocolBase attachment)
This method is to check if the attachment is the new version,ie, the first version.
|
boolean |
isSharedFile(ProtocolAttachmentPersonnelBase attachment)
This method is to check whether the attachment file is shared by old version of attachments.
|
void |
saveAttatchment(ProtocolAttachmentBase attachment)
Saves (persists) an
ProtocolAttachmentBase. |
void |
setProtocolAttachmentUpdateUsersName(List<? extends ProtocolAttachmentBase> protocolAttachmentBases)
Populate the updateUserFullName transient field in each ProtocolAttachmentBase object in the
list.
|
ProtocolAttachmentTypeBase getTypeFromCode(String code)
ProtocolAttachmentType from a code.code - the code.ProtocolAttachmentType. If the code is not
found then null is returned.IllegalArgumentException - if the code is nullCollection<ProtocolAttachmentTypeBase> getTypesForGroup(String code)
ProtocolAttachmentType from a group code.code - the group code.ProtocolAttachmentType. If no codes are
found then an empty Collection is returned.IllegalArgumentException - if the code is nullProtocolAttachmentStatusBase getStatusFromCode(String code)
ProtocolAttachmentStatus from a code.code - the code.ProtocolAttachmentStatus. If the code is not
found then null is returned.IllegalArgumentException - if the code is nullvoid saveAttatchment(ProtocolAttachmentBase attachment)
ProtocolAttachmentBase.
This method will modify the passed in attachment setting any missing properties. It
also saves all BOs that the attachment contains (ex. the File).attachment - the attachment.IllegalArgumentException - if the attachment or attachment's new file is nullvoid deleteAttatchment(ProtocolAttachmentBase attachment)
ProtocolAttachmentBase. It will also
delete any child BOs that should also be removed (ex. the File).attachment - the attachment.IllegalArgumentException - if the attachment or attachment's new file is null<T extends ProtocolAttachmentBase> T getAttachment(Class<T> type, Long id)
T - the typetype - the class token for the typeid - the attachment idIllegalArgumentException - if the type or id is nullProtocolPersonBase getPerson(Integer personId)
personId - the person idIllegalArgumentException - if the code or type is null.<T extends ProtocolAttachmentBase & TypedAttachment> Collection<T> getAttachmentsWithOlderFileVersions(T attachment, Class<T> type)
ProtocolAttachmentBase. It will also
delete any child BOs that should also be removed (ex. the File).
Unlike other methods in the service, passing an invalid attachment will just result in an empty Collection being returned.
T - the type of attachment - only certain types can have "versions" according to what KC recognizes as a versionattachment - the attachment.type - a class token for the typeboolean isNewAttachmentVersion(ProtocolAttachmentProtocolBase attachment)
attachment - boolean isAttachmentActive(ProtocolAttachmentProtocolBase attachment)
attachment - boolean isSharedFile(ProtocolAttachmentPersonnelBase attachment)
attachment - void setProtocolAttachmentUpdateUsersName(List<? extends ProtocolAttachmentBase> protocolAttachmentBases)
protocolAttachmentBases - The list of ProtocolAttachementBase objects you wish to populate the updateUserFullName field on.Copyright © 2013 The Kuali Foundation. All Rights Reserved.