ws_roxiequeryservice.hpp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef _ESPWIZ_WsRoxieQuery_HPP__
  14. #define _ESPWIZ_WsRoxieQuery_HPP__
  15. #ifdef _WIN32
  16. #define FILEVIEW_API __declspec(dllimport)
  17. #else
  18. #define FILEVIEW_API
  19. #endif
  20. #include "fileview.hpp"
  21. #include "fvrelate.hpp"
  22. #include "roxiecommlibscm.hpp"
  23. #include "roxiemanagerscm.hpp"
  24. #include <list>
  25. #include "WUWrapper.hpp"
  26. #include "ws_roxiequery_esp.ipp"
  27. class CWsRoxieQuerySoapBindingEx : public CWsRoxieQuerySoapBinding
  28. {
  29. StringBuffer m_portalURL;
  30. public:
  31. CWsRoxieQuerySoapBindingEx(IPropertyTree *cfg, const char *name, const char *process, http_soap_log_level llevel=hsl_none) : CWsRoxieQuerySoapBinding(cfg, name, process, llevel)
  32. {
  33. StringBuffer xpath;
  34. xpath.appendf("Software/EspProcess[@name='%s']/@portalurl", process);
  35. const char* portalURL = cfg->queryProp(xpath.str());
  36. if (portalURL && *portalURL)
  37. m_portalURL.append(portalURL);
  38. }
  39. virtual void getNavigationData(IEspContext &context, IPropertyTree & data)
  40. {
  41. IPropertyTree *folder = ensureNavFolder(data, "Roxie Queries", NULL, NULL, false, 7);
  42. StringBuffer path = "/WsSMC/NotInCommunityEdition?form_";
  43. if (m_portalURL.length() > 0)
  44. path.appendf("&EEPortal=%s", m_portalURL.str());
  45. ensureNavLink(*folder, "Search Roxie Files",path.str(), "Search Roxie Files", NULL, NULL, 2);
  46. ensureNavLink(*folder, "View Roxie Files", path.str(), "View Roxie Files", NULL, NULL, 3);
  47. }
  48. };
  49. class CWsRoxieQueryEx : public CWsRoxieQuery
  50. {
  51. private:
  52. Owned<IXslProcessor> m_xsl;
  53. Mutex m_superfilemutex;
  54. StringBuffer m_attsXSLT;
  55. StringBuffer m_graphStatsXSLT;
  56. public:
  57. IMPLEMENT_IINTERFACE;
  58. virtual ~CWsRoxieQueryEx(){};
  59. virtual void init(IPropertyTree *cfg, const char *process, const char *service);
  60. bool onRoxieQuerySearch(IEspContext &context, IEspRoxieQuerySearchRequest & req, IEspRoxieQuerySearchResponse & resp);
  61. bool onRoxieQueryList(IEspContext &context, IEspRoxieQueryListRequest &req, IEspRoxieQueryListResponse &resp);
  62. bool onQueryDetails(IEspContext &context, IEspRoxieQueryDetailsRequest & req, IEspRoxieQueryDetailsResponse & resp);
  63. bool onGVCAjaxGraph(IEspContext &context, IEspGVCAjaxGraphRequest &req, IEspGVCAjaxGraphResponse &resp);
  64. bool onShowGVCGraph(IEspContext &context, IEspShowGVCGraphRequest &req, IEspShowGVCGraphResponse &resp);
  65. bool onRoxieQueryProcessGraph(IEspContext &context, IEspRoxieQueryProcessGraphRequest &req, IEspRoxieQueryProcessGraphResponse &resp);
  66. private:
  67. void addToQueryString(StringBuffer &queryString, const char *name, const char *value);
  68. void addToQueryStringFromInt(StringBuffer &queryString, const char *name, int value);
  69. void getClusterConfig(char const * clusterType, char const * clusterName, char const * processName, StringBuffer& netAddress, int& port);
  70. bool getAllRoxieQueries(IEspContext &context, const char* cluster, const char* suspended, const char* sortBy, bool descending, __int64 displayEnd, IArrayOf<IEspRoxieQuery>& RoxieQueryList, __int64& totalFiles);
  71. IPropertyTree* getXgmmlGraph(const char *queryName, SocketEndpoint &ep, const char* graphName);
  72. void enumerateGraphs(const char *queryName, SocketEndpoint &ep, StringArray& graphNames);
  73. };
  74. #endif //_ESPWIZ_WsRoxieQuery_HPP__