|
From: Peter S. <co...@pe...> - 2007-09-26 07:36:37
|
Hi Roberto,
Here's how I've implemented my searchDTO and GetterSetter.
@ReportSearcher(XeptoMetaDataSearchExecutor.class)
public class XeptoMetaDataSearchDTO extends MetaDataSearchDTO {
private static final long serialVersionUID = 1L;
int userId = 0;
public XeptoMetaDataSearchDTO(MetaDataSearchDTO searchData) {
this.setColumnSorted(searchData.getColumnSorted());
this.setColumnWidths(searchData.getColumnWidths());
this.setLatest(searchData.getLatest());
this.setMeta_ids(searchData.getMeta_ids());
this.setName(searchData.getName());
this.setSearch_strings(searchData.getSearch_strings());
this.setShownColumns(searchData.getShownColumns());
this.setSortedColumnOrder(searchData.getSortedColumnOrder());
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
}
------------------------------------------
public class XeptoMetaDataLogGetterSetter extends MetaDataLogGetterSetter
implements SearchDataGetterSetter {
public XeptoMetaDataLogGetterSetter(MetaDataLogViewer metadata) {
super(metadata);
}
@Override
public AbstractSearchDTO getSearchData() {
return new
XeptoMetaDataSearchDTO((MetaDataSearchDTO)super.getSearchData());
}
}
See? the getSearchData() method of the GetterSetter needs to convert the
searchDTO into my custom searchDTO...
I don't know if this was your original intention of a use case - but my
reason for doing it this way, is that I want to link each search to a
specific user (hence the userId property)... And then on the server I use an
ExternalEntityFilter (com.lightminds.appletserver.metalog) to apply the
entity filtering logic based on the user id that owns the search. (By having
the userid the server can "log in" as the specified user and the scheduled
report will only find entities that the user can access...)
regards,
Peter
|