deployutils.hpp 7.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. #ifndef DEPLOYUTILS_HPP_INCL
  15. #define DEPLOYUTILS_HPP_INCL
  16. #ifdef DEPLOYUTILS_EXPORTS
  17. #define DEPLOYUTILS_API __declspec(dllexport)
  18. #else
  19. #define DEPLOYUTILS_API __declspec(dllimport)
  20. #endif
  21. //disable the harmless warning about very long symbol names > 255 chars in debug mode
  22. //this is typical with STL
  23. #pragma warning( disable : 4786 )
  24. #include "jiface.hpp"
  25. #include "jthread.hpp"
  26. #include "environment.hpp"
  27. interface IPropertyTree;
  28. interface IProperties;
  29. interface IXslProcessor;
  30. interface IXslTransform;
  31. interface IConstEnvironment;
  32. interface IEnvDeploymentEngine;
  33. interface IDeploymentCallback;
  34. class StringAttr;
  35. class CWizardInputs;
  36. //---------------------------------------------------------------------------
  37. // Factory functions
  38. //---------------------------------------------------------------------------
  39. extern DEPLOYUTILS_API bool generateHeadersFromXsd(const IPropertyTree* pEnv, const char* xsdName, const char* jsName);
  40. extern DEPLOYUTILS_API bool generateHeaders(const IPropertyTree* pEnv, IConstEnvironment* pConstEnv);
  41. extern DEPLOYUTILS_API bool generateHeadersFromEnv(const IPropertyTree* pEnv, StringBuffer& sbDefn, bool writeOut = false);
  42. extern DEPLOYUTILS_API bool generateHardwareHeaders(const IPropertyTree* pEnv, StringBuffer& sbDefn, bool writeOut = false, IPropertyTree* pCompTree = NULL);
  43. extern DEPLOYUTILS_API bool generateBuildHeaders(const IPropertyTree* pEnv, bool isPrograms, StringBuffer& sbDefn, bool writeOut = false);
  44. extern DEPLOYUTILS_API bool generateHeaderForTopology(const IPropertyTree* pEnv, StringBuffer& sbDefn, bool writeOut = false);
  45. extern DEPLOYUTILS_API bool generateHeadersForEnvSettings(const IPropertyTree* pEnv, StringBuffer& sbDefn, bool writeOut = false);
  46. extern DEPLOYUTILS_API bool generateHeadersForEnvXmlView(const IPropertyTree* pEnv, StringBuffer& sbDefn, bool writeOut = false);
  47. extern DEPLOYUTILS_API bool getComputersListWithUsage(const IPropertyTree* pEnv, StringBuffer& sbComputers, StringBuffer& sbFilter);
  48. extern DEPLOYUTILS_API IPropertyTree* generateTreeFromXsd(const IPropertyTree* pEnv, IPropertyTree* pSchema, const char* compName,
  49. const char* buildSetName, const IPropertyTree* pCfg, const char* servicename,
  50. bool allSubTypes = true, bool cloudFlag = false, CWizardInputs* pWInputs = NULL,
  51. bool forceOptional=false);
  52. extern DEPLOYUTILS_API bool checkComponentReferences(const IPropertyTree* pEnv, IPropertyTree* pCompNode, const char* compName, StringBuffer& sMsg, const char* szNewName=NULL);
  53. extern DEPLOYUTILS_API bool generateHeaderForComponent(const IPropertyTree* pEnv, IPropertyTree* pSchema, const char* compName);
  54. extern DEPLOYUTILS_API const char* getUniqueName(const IPropertyTree* pEnv, StringBuffer& sName, const char* xpath, const char* category);
  55. extern DEPLOYUTILS_API void getTabNameArray(const IPropertyTree* pEnv, IPropertyTree* pSchema, const char* compName, StringArray& strArray);
  56. extern DEPLOYUTILS_API void getDefnPropTree(const IPropertyTree* pEnv, IPropertyTree* pSchema, const char* compName, IPropertyTree* pDefTree, StringBuffer xpath);
  57. extern DEPLOYUTILS_API void getDefnString(const IPropertyTree* pEnv, IPropertyTree* pSchema, const char* compName, StringBuffer& compDefn, StringBuffer& viewChildNodes, StringBuffer& multiRowNodes);
  58. extern DEPLOYUTILS_API IPropertyTree* getNewRange(const IPropertyTree* pEnvRoot, const char* prefix, const char* domain, const char* cType, const char* startIP, const char* endIP);
  59. extern DEPLOYUTILS_API void getCommonDir(const IPropertyTree* pEnv, const char* catType, const char* buildSetName, const char* compName, StringBuffer& sbVal);
  60. extern DEPLOYUTILS_API void deleteRecursive(const char* path);
  61. extern DEPLOYUTILS_API bool handleRoxieOperation(IPropertyTree* pEnv, const char* cmd, const char* xmlStr);
  62. extern DEPLOYUTILS_API bool handleThorTopologyOp(IPropertyTree* pEnv, const char* cmd, const char* xmlStr, StringBuffer& sMsg);
  63. extern DEPLOYUTILS_API void addComponentToEnv(IPropertyTree* pEnv, const char* buildSet, StringBuffer& sbNewName, IPropertyTree* pCompTree);
  64. extern DEPLOYUTILS_API bool onChangeAttribute(const IPropertyTree* pEnv, IConstEnvironment* pConstEnv, const char* attrName, IPropertyTree* pOnChange, IPropertyTree*& pNode, IPropertyTree* pParentNode,
  65. int position, const char* szNewValue, const char* prevValue, const char* buildset);
  66. extern DEPLOYUTILS_API bool xsltTransform(const StringBuffer& xml, const char* sheet, IProperties *params, StringBuffer& ret);
  67. extern DEPLOYUTILS_API void UpdateRefAttributes(IPropertyTree* pEnv, const char* szPath, const char* szAttr, const char* szOldVal, const char* szNewVal);
  68. extern DEPLOYUTILS_API bool ensureUniqueName(const IPropertyTree* pEnv, IPropertyTree* pParentNode, const char* szText);
  69. extern DEPLOYUTILS_API void addInstanceToCompTree(const IPropertyTree* pEnvRoot,const IPropertyTree* pInstance,StringBuffer& dups,StringBuffer& resp, IConstEnvironment* pConstEnv);
  70. extern DEPLOYUTILS_API void formIPList(const char* ip, StringArray& formattedIpList);
  71. extern DEPLOYUTILS_API void buildEnvFromWizard(const char * xml, const char* service,IPropertyTree* cfg, StringBuffer& envXml, MapStringTo<StringBuffer>* dirMap=NULL);
  72. extern DEPLOYUTILS_API void runScript(StringBuffer& output, StringBuffer& errMsg, const char* pathToScript);
  73. extern DEPLOYUTILS_API bool validateIPS(const char* ipAddressList);
  74. extern DEPLOYUTILS_API void getSummary(const IPropertyTree* pEnvRoot, StringBuffer& respXmlStr , bool prepareLink);
  75. extern DEPLOYUTILS_API void mergeAttributes(IPropertyTree* pTo, IPropertyTree* pFrom);
  76. extern DEPLOYUTILS_API void addEspBindingInformation(const char* xmlArg, IPropertyTree* pEnvRoot, StringBuffer& sbNewName, IConstEnvironment* pConstEnvconst,
  77. const IPropertyTree* pCfg, const char* serviceName);
  78. extern DEPLOYUTILS_API bool updateDirsWithConfSettings(IPropertyTree* pEnvRoot, IProperties* pParams, bool ovrLog = true, bool ovrRun = true);
  79. extern DEPLOYUTILS_API bool validateEnv(IConstEnvironment* pConstEnv, bool abortOnException = true);
  80. #endif