use of org.incode.module.document.dom.impl.docs.DocumentState in project estatio by estatio.
the class Paperclip method getDocumentDate.
/**
* Either the {@link Document#getCreatedAt()} or {@link Document#getRenderedAt()}, depending upon the
* {@link Document#getState()} of the {@link Document}. Returns <tt>null</tt> for {@link DocumentTemplate}s.
*/
@NotPersistent
@Property(domainEvent = DocumentDateDomainEvent.class, editing = Editing.DISABLED)
public DateTime getDocumentDate() {
final DocumentAbstract documentAbstract = getDocument();
if (documentAbstract instanceof Document) {
final Document document = (Document) documentAbstract;
DocumentState state = document.getState();
return state.dateOf(document);
}
return null;
}
Aggregations