28
28
public class IpacTableFromSource extends IpacTablePartProcessor {
29
29
public static final String TBL_TYPE = "tblType" ;
30
30
public static final String TYPE_CATALOG = "catalog" ;
31
- public static final String TBL_INDEX = TableServerRequest .TBL_INDEX ; // the table to show if it's a multi-table file.
31
+ //public static final String TBL_INDEX = TableServerRequest.TBL_INDEX; // the table to show if it's a multi-table file.
32
+ private static final String SEARCH_REQUEST = "searchRequest" ;
33
+
32
34
33
35
protected File loadDataFile (TableServerRequest request ) throws IOException , DataAccessException {
34
36
35
37
String source = request .getParam (ServerParams .SOURCE );
36
38
String altSource = request .getParam (ServerParams .ALT_SOURCE );
37
39
String processor = request .getParam ("processor" );
40
+ String searchRequestJson = request .getParam (SEARCH_REQUEST );
38
41
39
42
if (StringUtils .isEmpty (source ) && processor != null ) {
40
43
return getByProcessor (processor , request );
44
+ } else if (searchRequestJson != null ) {
45
+ // wrapping search request is useful to hide filters of the wrapped search request
46
+ return SearchRequestUtils .fileFromSearchRequest (searchRequestJson );
41
47
} else {
42
48
// get source by source key
43
49
File inf = getSourceFile (source , request );
@@ -58,7 +64,7 @@ protected File loadDataFile(TableServerRequest request) throws IOException, Data
58
64
59
65
private File getByProcessor (String processor , TableServerRequest request ) throws DataAccessException {
60
66
if (StringUtils .isEmpty (processor )) {
61
- throw new DataAccessException ("Required parameter 'source ' is not given." );
67
+ throw new DataAccessException ("Required parameter 'processor ' is not given." );
62
68
}
63
69
TableServerRequest sReq = new TableServerRequest (processor , request );
64
70
FileInfo fi = new SearchManager ().getFileInfo (sReq );
@@ -82,9 +88,9 @@ public boolean doCache() {
82
88
/**
83
89
* resolve the file given a 'source' string. it could be a local path, or a url.
84
90
* if it's a url, download it into the application's workarea
85
- * @param source
86
- * @param request
87
- * @return
91
+ * @param source source file
92
+ * @param request table request
93
+ * @return file
88
94
*/
89
95
private File getSourceFile (String source , TableServerRequest request ) {
90
96
if (source == null ) return null ;
0 commit comments