|
|
@ -7,15 +7,14 @@ import com.fr.design.mainframe.alphafine.CellType; |
|
|
|
import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; |
|
|
|
import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; |
|
|
|
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; |
|
|
|
import com.fr.design.mainframe.alphafine.cell.model.MoreModel; |
|
|
|
import com.fr.design.mainframe.alphafine.model.SearchResult; |
|
|
|
import com.fr.design.mainframe.alphafine.model.SearchResult; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.alphafine.search.SearchTextBean; |
|
|
|
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; |
|
|
|
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; |
|
|
|
import com.fr.general.http.HttpToolbox; |
|
|
|
import com.fr.general.http.HttpToolbox; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONException; |
|
|
|
|
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by XiaXiang on 2017/3/27. |
|
|
|
* Created by XiaXiang on 2017/3/27. |
|
|
@ -24,6 +23,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { |
|
|
|
private static volatile DocumentSearchManager instance; |
|
|
|
private static volatile DocumentSearchManager instance; |
|
|
|
private SearchResult lessModelList; |
|
|
|
private SearchResult lessModelList; |
|
|
|
private SearchResult moreModelList; |
|
|
|
private SearchResult moreModelList; |
|
|
|
|
|
|
|
private SearchResult searchResult; |
|
|
|
|
|
|
|
|
|
|
|
public static DocumentSearchManager getInstance() { |
|
|
|
public static DocumentSearchManager getInstance() { |
|
|
|
if (instance == null) { |
|
|
|
if (instance == null) { |
|
|
@ -54,6 +54,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { |
|
|
|
public SearchResult getLessSearchResult(String[] searchText) { |
|
|
|
public SearchResult getLessSearchResult(String[] searchText) { |
|
|
|
lessModelList = new SearchResult(); |
|
|
|
lessModelList = new SearchResult(); |
|
|
|
moreModelList = new SearchResult(); |
|
|
|
moreModelList = new SearchResult(); |
|
|
|
|
|
|
|
searchResult = new SearchResult(); |
|
|
|
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { |
|
|
|
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { |
|
|
|
if (ArrayUtils.isEmpty(searchText)) { |
|
|
|
if (ArrayUtils.isEmpty(searchText)) { |
|
|
|
lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); |
|
|
|
lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); |
|
|
@ -63,7 +64,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { |
|
|
|
if(noConnectList != null){ |
|
|
|
if(noConnectList != null){ |
|
|
|
return noConnectList; |
|
|
|
return noConnectList; |
|
|
|
} |
|
|
|
} |
|
|
|
SearchResult searchResult = new SearchResult(); |
|
|
|
searchResult = new SearchResult(); |
|
|
|
for (int j = 0; j < searchText.length; j++) { |
|
|
|
for (int j = 0; j < searchText.length; j++) { |
|
|
|
String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText[j]; |
|
|
|
String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText[j]; |
|
|
|
try { |
|
|
|
try { |
|
|
@ -106,4 +107,9 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { |
|
|
|
return moreModelList; |
|
|
|
return moreModelList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public SearchResult getSearchResult(SearchTextBean searchTextBean) { |
|
|
|
|
|
|
|
getLessSearchResult(searchTextBean.getSegmentation()); |
|
|
|
|
|
|
|
return searchResult; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|