public abstract class ProtocolAttachmentServiceImplBase extends Object implements ProtocolAttachmentService
ProtocolNoteAndAttachmentService.| Modifier and Type | Field and Description |
|---|---|
protected org.kuali.rice.krad.service.BusinessObjectService |
boService |
protected org.apache.commons.logging.Log |
LOG |
protected org.kuali.rice.kim.api.identity.PersonService |
personService |
protected ProtocolDao |
protocolDao |
| Constructor and Description |
|---|
ProtocolAttachmentServiceImplBase(org.kuali.rice.krad.service.BusinessObjectService boService,
ProtocolDao protocolDao)
Constructor than sets the dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAttatchment(ProtocolAttachmentBase attachment)
Deletes an existing
ProtocolAttachmentBase. |
protected ProtocolBase |
getActiveProtocol(String protocolNumber) |
<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. |
protected <T extends org.kuali.rice.krad.bo.PersistableBusinessObject> |
getCodeType(Class<T> type,
String code)
Gets a "code" BO from a code.
|
ProtocolPersonBase |
getPerson(Integer personId)
Gets a Person BO from personId.
|
abstract Class<? extends ProtocolAttachmentPersonnelBase> |
getProtocolAttachmentPersonnelClassHook() |
abstract Class<? extends ProtocolAttachmentProtocolBase> |
getProtocolAttachmentProtocolClassHook() |
abstract Class<? extends ProtocolAttachmentStatusBase> |
getProtocolAttachmentStatusClassHook() |
abstract Class<? extends ProtocolAttachmentTypeBase> |
getProtocolAttachmentTypeClassHook() |
abstract Class<? extends ProtocolAttachmentTypeGroupBase> |
getProtocolAttachmentTypeGroupClassHook() |
abstract Class<? extends ProtocolBase> |
getProtocolClassHook() |
abstract Class<? extends ProtocolPersonBase> |
getProtocolPersonClassHook() |
ProtocolAttachmentStatusBase |
getStatusFromCode(String code)
Gets a
ProtocolAttachmentStatus from a code. |
ProtocolAttachmentTypeBase |
getTypeFromCode(String code)
Gets a
ProtocolAttachmentType from a code. |
abstract 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 |
setPersonService(org.kuali.rice.kim.api.identity.PersonService personService)
Sets the personService attribute value.
|
void |
setProtocolAttachmentUpdateUsersName(List<? extends ProtocolAttachmentBase> protocolAttachmentBases)
Populate the updateUserFullName transient field in each ProtocolAttachmentBase object in the
list.
|
protected final org.kuali.rice.krad.service.BusinessObjectService boService
protected final ProtocolDao protocolDao
protected org.kuali.rice.kim.api.identity.PersonService personService
protected final org.apache.commons.logging.Log LOG
public ProtocolAttachmentServiceImplBase(org.kuali.rice.krad.service.BusinessObjectService boService,
ProtocolDao protocolDao)
boService - the BusinessObjectServiceIllegalArgumentException - if the boService or protocolDao is nullpublic abstract Class<? extends ProtocolBase> getProtocolClassHook()
public abstract Class<? extends ProtocolAttachmentStatusBase> getProtocolAttachmentStatusClassHook()
public abstract Class<? extends ProtocolPersonBase> getProtocolPersonClassHook()
public abstract Class<? extends ProtocolAttachmentTypeBase> getProtocolAttachmentTypeClassHook()
public abstract Class<? extends ProtocolAttachmentTypeGroupBase> getProtocolAttachmentTypeGroupClassHook()
public abstract Class<? extends ProtocolAttachmentProtocolBase> getProtocolAttachmentProtocolClassHook()
public abstract Class<? extends ProtocolAttachmentPersonnelBase> getProtocolAttachmentPersonnelClassHook()
public ProtocolAttachmentStatusBase getStatusFromCode(String code)
ProtocolAttachmentStatus from a code.getStatusFromCode in interface ProtocolAttachmentServicecode - the code.ProtocolAttachmentStatus. If the code is not
found then null is returned.public ProtocolAttachmentTypeBase getTypeFromCode(String code)
ProtocolAttachmentType from a code.getTypeFromCode in interface ProtocolAttachmentServicecode - the code.ProtocolAttachmentType. If the code is not
found then null is returned.public abstract Collection<ProtocolAttachmentTypeBase> getTypesForGroup(String code)
ProtocolAttachmentServiceProtocolAttachmentType from a group code.getTypesForGroup in interface ProtocolAttachmentServicecode - the group code.ProtocolAttachmentType. If no codes are
found then an empty Collection is returned.public void 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).saveAttatchment in interface ProtocolAttachmentServiceattachment - the attachment.public void deleteAttatchment(ProtocolAttachmentBase attachment)
ProtocolAttachmentBase. It will also
delete any child BOs that should also be removed (ex. the File).deleteAttatchment in interface ProtocolAttachmentServiceattachment - the attachment.public ProtocolPersonBase getPerson(Integer personId)
getPerson in interface ProtocolAttachmentServicepersonId - the person idpublic <T extends ProtocolAttachmentBase> T getAttachment(Class<T> type, Long id)
getAttachment in interface ProtocolAttachmentServiceT - the typetype - the class token for the typeid - the attachment idpublic boolean isNewAttachmentVersion(ProtocolAttachmentProtocolBase attachment)
ProtocolAttachmentServiceisNewAttachmentVersion in interface ProtocolAttachmentServiceProtocolAttachmentService.isNewAttachmentVersion(org.kuali.kra.protocol.noteattachment.ProtocolAttachmentProtocolBase)public boolean isAttachmentActive(ProtocolAttachmentProtocolBase attachment)
ProtocolAttachmentServiceisAttachmentActive in interface ProtocolAttachmentServiceprotected ProtocolBase getActiveProtocol(String protocolNumber)
public <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.
getAttachmentsWithOlderFileVersions in interface ProtocolAttachmentServiceT - 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 typeprotected <T extends org.kuali.rice.krad.bo.PersistableBusinessObject> T getCodeType(Class<T> type, String code)
T - the BO typetype - the typecode - the code valueIllegalArgumentException - if the code or type is null.public boolean isSharedFile(ProtocolAttachmentPersonnelBase attachment)
ProtocolAttachmentServiceisSharedFile in interface ProtocolAttachmentServiceProtocolAttachmentService.isSharedFile(org.kuali.kra.protocol.noteattachment.ProtocolAttachmentPersonnelBase)public void setProtocolAttachmentUpdateUsersName(List<? extends ProtocolAttachmentBase> protocolAttachmentBases)
ProtocolAttachmentServicesetProtocolAttachmentUpdateUsersName in interface ProtocolAttachmentServiceprotocolAttachmentBases - The list of ProtocolAttachementBase objects you wish to populate the updateUserFullName field on.org.kuali.kra.protocol.noteattachment.ProtocolAttachmentService#setProtocolAttachmentPersonnelUpdateUsersName(java.util.List)public void setPersonService(org.kuali.rice.kim.api.identity.PersonService personService)
personService - The personService to set.Copyright © 2013 The Kuali Foundation. All Rights Reserved.