module.itop-storage-mgmt.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. // Copyright (C) 2010-2017 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. /**
  17. * Module providing advanced CIs for modeling storage: SAN, Volumes...
  18. *
  19. * @author Erwan Taloc <erwan.taloc@combodo.com>
  20. * @author Romain Quetiez <romain.quetiez@combodo.com>
  21. * @author Denis Flaven <denis.flaven@combodo.com>
  22. * @license http://opensource.org/licenses/AGPL-3.0
  23. */
  24. SetupWebPage::AddModule(
  25. __FILE__, // Path to the current file, all other file names are relative to the directory containing this file
  26. 'itop-storage-mgmt/2.4.0',
  27. array(
  28. // Identification
  29. //
  30. 'label' => 'Advanced Storage Management',
  31. 'category' => 'business',
  32. // Setup
  33. //
  34. 'dependencies' => array(
  35. 'itop-config-mgmt/2.4.0'
  36. ),
  37. 'mandatory' => false,
  38. 'visible' => true,
  39. 'installer' => 'StorageMgmtInstaller',
  40. // Components
  41. //
  42. 'datamodel' => array(
  43. 'model.itop-storage-mgmt.php'
  44. ),
  45. 'webservice' => array(
  46. ),
  47. 'data.struct' => array(
  48. // add your 'structure' definition XML files here,
  49. ),
  50. 'data.sample' => array(
  51. // add your sample data XML files here,
  52. ),
  53. // Documentation
  54. //
  55. 'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
  56. 'doc.more_information' => '', // hyperlink to more information, if any
  57. // Default settings
  58. //
  59. 'settings' => array(
  60. // Module specific settings go here, if any
  61. ),
  62. )
  63. );
  64. if (!class_exists('StorageMgmtInstaller'))
  65. {
  66. // Module installation handler
  67. //
  68. class StorageMgmtInstaller extends ModuleInstallerAPI
  69. {
  70. public static function BeforeWritingConfig(Config $oConfiguration)
  71. {
  72. // If you want to override/force some configuration values, do it here
  73. return $oConfiguration;
  74. }
  75. /**
  76. * Handler called before creating or upgrading the database schema
  77. * @param $oConfiguration Config The new configuration of the application
  78. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  79. * @param $sCurrentVersion string Current version number of the module
  80. */
  81. public static function BeforeDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  82. {
  83. if (strlen($sPreviousVersion) > 0)
  84. {
  85. // If you want to migrate data from one format to another, do it here
  86. self::RenameClassInDB('NasFileSystem', 'NASFileSystem');
  87. }
  88. }
  89. /**
  90. * Handler called after the creation/update of the database schema
  91. * @param $oConfiguration Config The new configuration of the application
  92. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  93. * @param $sCurrentVersion string Current version number of the module
  94. */
  95. public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  96. {
  97. }
  98. }
  99. }
  100. ?>