3.2.8 2.0.3向2.1.x升级

从2.0.3到2.1.0的升级对您的终端用户应该是完全透明的。但是,两个版本之间发生了一些变化。依赖在使用应用的过程中,可能需要特别注意以下几点:

可用性

以下变更在用户体验上可能具有影响度:

  • 导出的任何元素列表都可以使用附加菜单“ Excel导出…”。有关更多信息,请参阅:清单管理 在终端用户文档中。

REST/JSON API

检查RESTTJSON文档 适用于API的最新版本。

该API在此版本中稳定。

由于安全的原因,iTop的下一个主要版本中将禁止用户帐户对简档门户用户使用RESTTJSON Web服务。如果仅使用一种Web服务来检查用户的凭据,请调整代码以使用新的core/check_credentials用户。

数据模型定制

在数据模型定义中,XML的格式已从1.0更改为1.1。 XML格式的更改是透明的,因为新格式完全向后兼容。格式更改的完整列表在XML数据模型引用

简档定义中的类组

简档(角色)的行为在iTop 2.0.3和iTop 2.1.0中完全相同。但是,已经对用于定义简档(角色)的“组”的内部名称执行了清除操作。因此,基于前一组名称的自定义可能与iTop 2.1.0不兼容。

有两种方法可以解决此问题:

  • 速有效的解决方案:只需将文件夹datamodels/2.x/itop-profiles-itil替换为从iTop 2.0.3中提取的先前的版本。
  • 净的迁移:分析XML自定义并根据以下列出的更改进行调整:
2.0.3组2.1.0组
Incident and class:Incident合并为 Incident
Call and class:UserRequest合并为 UserRequest
Problem and class:Problem合并为Problem
LnkTickets重命名Ticketing
class:EmergencyChange重命名 EmergencyChange
class:RoutineChange重命名RoutineChange
class:NormalChange重命名 NormalChange
LnkServices已移除
LnkKnownErrors已移除
Portal user - write已移除
Portal user - delete已移除
  • 命名组:只需通过用新名称替换旧名称来调整模块中的XML。
  • 并组:可以视为重命名:只需通过将组的名称替换为合并组的名称来调整您的自定义设置。
  • 除的组:简档(角色)的定义实际上并未使用这些组。如果您的定制正在修改这些组的内容,则可以将其完全从定制中删除。如果您的自定义是将这样的组添加到现有简档或基于此类组定义新的简档,则必须简档将该组的先前定义(从iTop 2.0.3提取)到您的自定义中。

继承的状态标志

iTop的版本2.1.0支持新的XML标签<inherit_flags_from>parent_state << inherit_flags_from>。此标签告诉iTop,当前状态的标志是从指定的parent_state继承的。这允许更紧凑的定义标志(也更易于维护)。但是,此重构可能具有对父标准应用的更改的标签,因为它更改了XML的结构。

作为生命周期状态的标志定义的“因式分解”示例,可以将以下XML部分更改为:

<state id="new">
  <flags>
    <attribute id="org_id">
      <mandatory />
    </attribute>
  </flags>
</state><state id="assigned">
  <flags>
    <attribute id="org_id">
      <mandatory />
    </attribute>
  </flags>
</state>

至:

<state id="new">
  <flags>
    <attribute id="org_id">
      <mandatory />
    </attribute>
  </flags>
</state><state id="assigned">
  <inherit_flags_from>new</inherit_flags_from>
  <flags />
</state>

最终结果是属性org_id的标志的实际定义已从XML的重构版本中的分配状态中消失。

如果数据模型的XML更改包含属性级别的标志的重新定义,则必须变更将_delta =“ redefine”转换为_delta =“ define”以在iTop 2.1.0中获得相同的效果。

示例:数据模型的2.1.0之前的更改:

<state id="assigned">
  <flags>
    <attribute id="org_id" _delta="redefine">
      <hidden />
    </attribute>
  </flags>
</state>

以与iTop 2.1.0兼容的方式编写的相同更改将是:

<state id="assigned">
  <flags>
    <attribute id="org_id" _delta="define">
      <hidden />
    </attribute>
  </flags>
</state>

GetIcon/MakeIconFromName

方法MakeIconFromName已被弃用。

如果您的定制包括用于调用MakeIconFromName的GetIcon的重新定义,则在GetIcon的重载上方插入以下XML:

 
<method id="MakeIconFromName" _delta="define">
   <static>true</static>
   <access>protected</access>
   <type>Overload-DBObject</type>
   <code><![CDATA[        protected static function MakeIconFromName($sIconName, $bImgTag = true)
      {
              $sIcon = '';
              if ($sIconName != '')
              {
                      $sPath = utils::GetAbsoluteUrlModulesRoot().'itop-request-mgmt/images/'.$sIconName;
                      if ($bImgTag)
                      {
                              $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
                      }
                      else
                      {
                              $sIcon  = $sPath;
                      }
              }
              return $sIcon;
      }]]></code>
</method>

原贴链接:https://www.itophub.io/wiki/page?id=2_7_0%3Ainstall%3A203_to_210_migration_notes


2.0.3 to 2.1.0 Migration Notes

The upgrade from 2.0.3 to 2.1.0 should be totally transparent to your end-users. However a few things changed between the two versions. Depending on the way you use the application you may want to pay special attention to the following points:

Usability

The following change may have an impact on the user experience:

  • An extra menu “Excel export…” is available to export any list of elements. For more information, refer to: Managing Lists in the end-user documentation.

REST/JSON API

Check the REST/JSON Documentation for the latest version of the API.

The API is stable in this revision.

For security reasons, the use of REST/JSON webservices by user accounts with the profile Portal User will be disabled in the next major version of iTop. If you use one of the webservices only to check the credentials of a user, adjust your code to use the new core/check_credentialsoperation.

Data Model Customizations

The format of the XML has changed from 1.0 to 1.1 in the datamodel definition. The changes in the XML format are transparent since the new format is fully backward compatible. The complete list of format changes is listed in the XML Data Model Reference

Class groups in Profile definitions

The behavior of the profiles is exactly the same in iTop 2.0.3 and iTop 2.1.0. However, a cleanup has been performed on the internal names of “groups” used to define the profiles. Therefore customization based on the former group names may be incompatible with iTop 2.1.0.

There are two ways to address this issue:

  • Quick and dirty fix: simply replace the folder datamodels/2.x/itop-profiles-itil by its previous version extracted from iTop 2.0.3.

  • Clean migration: analyse your XML customization and adjust it based on the changes listed below:

2.0.3 Groups2.1.0 Groups
Incident and class:IncidentMerged into Incident
Call and class:UserRequestMerged into UserRequest
Problem and class:ProblemMerged into Problem
LnkTicketsRenamed into Ticketing
class:EmergencyChangeRenamed into EmergencyChange
class:RoutineChangeRenamed into RoutineChange
class:NormalChangeRenamed into NormalChange
LnkServicesRemoved
LnkKnownErrorsRemoved
Portal user - writeRemoved
Portal user - deleteRemoved
  • Renamed groups: simply adjust the XML in your module by replacing the old name with the new name.

  • Merged groups: this can be treated as a rename: simply adjust your customization by replacing the name of the group with the named of the merged-in group.

  • Removed groups: such groups were actually not used by the definition of the profiles. If your customization was modifying the content of these groups, you can completely remove this from your customization. If your customization was adding such a group to an existing profile or defining a new profile based on such a group, you'll have to import the previous definition of the group (extracted from iTop 2.0.3) into your customization.

Inherited state flags

The version 2.1.0 of iTop supports a new XML tag <inherit_flags_from>parent_state</inherit_flags_from>. This tag tells iTop that the flags from the current state are inherited from the specified parent_state. This allows for a much more compact definition the flags (which is also easier to maintain). But this refactoring may have an impact on the alterations applied to the standard data model, since it changes the structure of the XML.

As an example of “factorization” of the flags definitions for the life-cycle states, the following XML part can be changed from:

<state id="new">
  <flags>
    <attribute id="org_id">
      <mandatory />
    </attribute>
  </flags>
</state><state id="assigned">
  <flags>
    <attribute id="org_id">
      <mandatory />
    </attribute>
  </flags>
</state>

to:

<state id="new">
  <flags>
    <attribute id="org_id">
      <mandatory />
    </attribute>
  </flags>
</state><state id="assigned">
  <inherit_flags_from>new</inherit_flags_from>
  <flags />
</state>

The net effect is that the actual definition of the flags for the attribute org_id has disappeared from the assigned state in the refactored version of the XML.

If your XML alteration of the data model contains a redefinition of the flags at the attribute level, then you must change the _delta=“redefine” into a_delta=“define” to obtain the same effect in iTop 2.1.0

Example: pre-2.1.0 alteration of the data model:

<state id="assigned">
  <flags>
    <attribute id="org_id" _delta="redefine">
      <hidden />
    </attribute>
  </flags>
</state>

The same alteration written in a manner compatible with iTop 2.1.0, will be:

<state id="assigned">
  <flags>
    <attribute id="org_id" _delta="define">
      <hidden />
    </attribute>
  </flags>
</state>

GetIcon/MakeIconFromName

The method MakeIconFromName has been deprecated.

If your customizations include a redefinition of GetIcon, which used to call MakeIconFromName, then insert the following XML right above the overload of GetIcon:

make_icon_from_name.xml
 
<method id="MakeIconFromName" _delta="define">
   <static>true</static>
   <access>protected</access>
   <type>Overload-DBObject</type>
   <code><![CDATA[        protected static function MakeIconFromName($sIconName, $bImgTag = true)
      {
              $sIcon = '';
              if ($sIconName != '')
              {
                      $sPath = utils::GetAbsoluteUrlModulesRoot().'itop-request-mgmt/images/'.$sIconName;
                      if ($bImgTag)
                      {
                              $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
                      }
                      else
                      {
                              $sIcon  = $sPath;
                      }
              }
              return $sIcon;
      }]]></code>
</method>
标签:
由 superadmin 在 2020/08/27, 15:58 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司