Red Hat Web Application Framework 6.1 Manuale Utente Pagina 161

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 230
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 160
Chapter 11. Services Tutorials 147
public String getSummary(DomainObject dobj) {
Note note = (Note)dobj;
// Truncate body text & remove any HTML.
return StringUtils.truncateString(note.getBody(),
200,
true);
}
...
Example 11-10. Core search metadata
11.6.1.2. Supplementary search metadata
The next set of optional methods allow for provision of auditing data that will be useful for
narrowing search results, namely creation and modification date and the party who performed
these two actions. This information can be trivially provided if the domain object already using
com.arsdigita.auditing package:
...
public Date getCreationDate(DomainObject dobj) {
Note note = (Note)dobj;
BasicAuditTrail audit = BasicAuditTrail.retrieveForACSObject(note);
return audit == null ? null : audit.getCreationDate();
}
public Party getCreationParty(DomainObject dobj) {
Note note = (Note)dobj;
BasicAuditTrail audit = BasicAuditTrail.retrieveForACSObject(note);
return audit == null ? null : audit.getCreationParty();
}
public Date getLastMofidiedDate(DomainObject dobj) {
Note note = (Note)dobj;
BasicAuditTrail audit = BasicAuditTrail.retrieveForACSObject(note);
return audit == null ? null : audit.getLastModifiedDate();
}
public Party getLastMofidiedParty(DomainObject dobj) {
Note note = (Note)dobj;
BasicAuditTrail audit = BasicAuditTrail.retrieveForACSObject(note);
return audit == null ? null : audit.getLastModifiedParty();
}
...
Example 11-11. Supplementary search metadata
Vedere la pagina 160
1 2 ... 156 157 158 159 160 161 162 163 164 165 166 ... 229 230

Commenti su questo manuale

Nessun commento