[svn r382] hacked jsf frontend working
This commit is contained in:
parent
37fdf22282
commit
9a605f177a
123 changed files with 7035 additions and 2418 deletions
|
|
@ -35,8 +35,9 @@ import java.util.Set;
|
|||
|
||||
import com.idcanet.vasc.core.AbstractVascBackendProxy;
|
||||
import com.idcanet.vasc.core.VascBackend;
|
||||
import com.idcanet.vasc.core.VascBackendPageNumber;
|
||||
import com.idcanet.vasc.core.VascBackendState;
|
||||
import com.idcanet.vasc.core.VascEntry;
|
||||
import com.idcanet.vasc.core.VascException;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -62,16 +63,20 @@ public class VascBackendProxySearch extends AbstractVascBackendProxy {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see com.idcanet.vasc.core.VascBackend#execute()
|
||||
* @see com.idcanet.vasc.core.VascBackend#execute(VascBackendState state)
|
||||
*/
|
||||
@Override
|
||||
public List<Object> execute() throws Exception {
|
||||
List<Object> result = backend.execute();
|
||||
if (getSearchString()==null) {
|
||||
records = backend.getPagesTotalRecords();
|
||||
public List<Object> execute(VascBackendState state) throws VascException {
|
||||
List<Object> result = backend.execute(state);
|
||||
if (state.getSearchString()==null) {
|
||||
if (backend.isPageable()) {
|
||||
records = backend.fetchTotalExecuteSize(state);
|
||||
} else {
|
||||
records = result.size();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
String searchString = getSearchString().toLowerCase();
|
||||
String searchString = state.getSearchString().toLowerCase();
|
||||
List<Object> search = new ArrayList<Object>(result.size()/4);
|
||||
for (Object o:result) {
|
||||
for (Method method:o.getClass().getMethods()) {
|
||||
|
|
@ -93,7 +98,12 @@ public class VascBackendProxySearch extends AbstractVascBackendProxy {
|
|||
if (method.getReturnType().isAssignableFrom(Map.class)) {
|
||||
continue;
|
||||
}
|
||||
Object res = method.invoke(o,null);
|
||||
Object res;
|
||||
try {
|
||||
res = method.invoke(o,null);
|
||||
} catch (Exception e) {
|
||||
throw new VascException(e);
|
||||
}
|
||||
if (res==null) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -109,17 +119,7 @@ public class VascBackendProxySearch extends AbstractVascBackendProxy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getPagesTotalRecords() {
|
||||
public long fetchTotalExecuteSize(VascBackendState state) {
|
||||
return records;
|
||||
}
|
||||
@Override
|
||||
public List<VascBackendPageNumber> getVascBackendPageNumbers() {
|
||||
if (getSearchString()==null) {
|
||||
return backend.getVascBackendPageNumbers();
|
||||
}
|
||||
// limit the pages to the number of search results.
|
||||
List<VascBackendPageNumber> r = backend.getVascBackendPageNumbers();
|
||||
int pages = new Long(getPagesTotalRecords()/getPageSize()).intValue();
|
||||
return r.subList(0, pages);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue