客户门户XML引用

您必须熟悉以下基础知识iTop XML设计.

有关客户门户定制功能的概述,请查看页面自定义您的客户门户

iTop的版本2.5对门户块(仪表板)进行了许多更改。本章介绍了新格式引入的修改的完整列表变更记录.

结构体

此结构特定于在itop-门户基础库上开发的门户。

标签用法描述
<module_design id="PORTAL_UNIQUE_ID" xsi:type="portal">强制性的为门户实例定义配置的结构化节点
<properties>强制性的实例的全局属性
<name>portal:itop-portal</name>强制性的门户名称
<logo>../images/itop-logo.png</logo>可选的在实例中使用的徽标。如果已定义,它将覆盖Designer中的一个或env-xxxxbranding/portal-logo.png
<themes>强制性的声明的CSS样式表
<theme id="custom">sample-portal-custom-css/custom.css</theme>零或更多CSS样式表列表。首先加载ID bootstrap |portal| custom ID,重新定义它们将覆盖默认文件。然后将加载其他ID。路径必须相对于env-xxx
<templates>强制性的声明的TWIG模板
<template id="layout">sample-portal-alter-twig/layout.html.twig</template>零或更多要覆盖的TWIG模板列表。可用值是整个页面的“布局”或主页内容的“主页”。 (砖块内容布局可以直接在每个砖块中定义)
<urlmaker_class>iTopPortalViewUrlMaker</urlmaker_class>可选的用于生成对象的类查看URL(例如,在通知,链接集中)
<triggers_query>SELECT TriggerOnPortalUpdate AS t WHERE t.target_class IN (:parent_classes)</triggers_query>强制性的OQL查询在更新实例上的对象时检索触发器
<attachments>强制性的结构节点
<allow_delete>true</allow_delete>强制性的可以在门户上删除附件吗?可用值为true | false
<allowed_portals>强制性的结构节点
<opening_mode>tab</opening_mode>强制性的定义如何打开其他门户-当前用户允许的门户。可用值为“ tab” |“ self”。 “选项卡”在新选项卡中打开门户,“自我”在当前选项卡中打开。默认价值是“ tab”。
<bricks>强制性的申报砖
<brick id="BRICK_UNIQUE_ID" xsi:type="ANY_FQCN_BRICK">零或更多一块砖的宣言。 ID在集合中必须唯一。 xsi:type必须是完全限定的类名(包括名称空间)。相同的xsi:type块可以有多个实例,只要它们的ID不同即可。在本节中查看各种类型的积木砖块 (请注意,只有公共标签显示在此节点下)
<active>true</active>可选的门户上的砖是否处于活动状态。请注意,仍然可以通过其URL访问在主页和导航菜单上均不可见的活动砖。可用值为true | false,默认值为true
<width>6</width>可选的主页上图块的宽度。价值必须是1-12之间的整数,其中12是整个行的宽度。默认价值为3。
<rank>可选的主页和导航菜单上砖的等级。如果未指定,将放在第一位。
<default>1</default>可选的在首页和导航菜单上均排名。价值必须是浮点数。
<home>1</home>可选的仅在首页上排名。价值必须是浮点数。
<navigation_menu>1</navigation_menu>可选的在导航菜单上排名。价值必须是浮点数。
<title>可选的主页和导航菜单上砖的标题。
<default>Brick:Portal:Foo:Bar</default>可选的主页和导航菜单上的标题。
<home>Brick:Portal:Foo:Bar</home>可选的仅在首页上显示标题。
<navigation_menu>Brick:Portal:Foo:Bar</navigation_menu>可选的标题仅在导航菜单上。
<description>Brick:Portal:Foo:Bar+</description>可选的将在主页上显示的砖块说明。
<visible>可选的砖在主页和导航菜单上是否可见。如果未指定,则两者均默认为true。
<home>true</home>可选的砖在主页上可见吗?可用值为true | false,默认值为true
<navigation_menu>true</navigation_menu>可选的导航菜单上是否显示砖块。可用值为true | false,默认值为true
<decoration_class>强制性的主页和导航菜单上砖的图标的CSS类。可以使用Glyphicon,Font Awesome或您自己的CSS类。
<default>fa fa-user fa-2x</default>可选的CSS类应用于首页和导航菜单。
<home>fa fa-user fa-2x</home>可选的主页上应用的CSS类。
<navigation_menu>fa fa-user fa-2x</navigation_menu>可选的在导航菜单上应用的CSS类。
<templates>可选的可以覆盖的砖块模板
<template id="page">零或更多TWIG模板的路径,用于覆盖默认模板。路径必须相对于env-xxx。可以用来裁切砖块(主页)或页面的模板。 ID属性是必填项,并且必须为“ tile”或“ page”。
<security>可选的简档能否看到此积木的限制
<allowed_profiles>SELECT URP_Profiles WHERE name = 'Portal user'</allowed_profiles>可选的OQL返回简档(角色)的成员可以看到此积木。如果省略,则所有未明确拒绝的简档(角色)都可以看到它。
<denied_profiles>OQL</denied_profiles>可选的简档(角色)无法看到此积木。
<forms>强制性的申报表格
<form id="name">零或更多表单的声明。 ID必须是唯一的
<class>ServiceSubcategory</class>强制性的表单的对象类。如果未定义子类,则子类将继承此表单
<properties>可选的结构节点
<display_mode>cosy</display_mode>可选的表单字段的显示模式。 “舒适”用于在值布局上放置常规标签; “紧凑”,用于并排布局,标签留出25%的空间,输入留出75%的空间; “密集”并排布局,输入填充所有可用空间。您还可以使用自定义的CSS类,该类将在表单上用作“form_xxx”,在字段上用作“form_field_xxx”。可用值是cosy | compact | dense | CUSTOM_form,默认值为cosy。
<always_show_submit>false</always_show_submit>可选的设置为false时,对象上的转换可用时,提交按钮将隐藏。可用值为true | false,默认值为false。
<navigation_rules>可选的导航规则适用于此表单。
<submit>可选的NR适用于commit/update按钮。请注意,不考虑转换按钮。
<default>go-to-object</default>强制性的在整页打开表单时要应用的导航规则的ID。
<modal>go-to-object</modal>强制性的将使用以模式打开表单时要应用的导航规则的ID(如果不存在)。
<cancel>可选的NR应用于取消按钮。
<default>close-form</default>强制性的在整页打开表单时要应用的导航规则的ID。
<modal>close-form</modal>强制性的将使用以模式打开表单时要应用的导航规则的ID(如果不存在)。
<fields>可选的声明的字段。如果为空,将仅显示树枝标签的字段。如果省略,则仅显示zlist详细信息中的字段,树枝标签将被忽略
<field id="title">零或更多字段的声明。 ID必须是该类的有效属性代码。如果不放在树枝标签中,将一个接一个地放置。缺少必填属性将自动添加到表单
<slave>true</slave>可选的是现场奴隶。如果存在,则标志将与来自datamodel/lifecycle的标志合并。可用值为true | false,默认值为true
<read_only>true</read_only>可选的注意!该标志不起作用,如果有需要,请使用TWIG。
<mandatory>true</mandatory>可选的是必填字段。如果存在,则标志将与来自datamodel/lifecycle的标志合并。可用值为true | false,默认值为true
<hidden>true</hidden>可选的被隐藏的领域。如果存在,则标志将与来自datamodel/lifecycle的标志合并。可用值为true | false,默认值为true
<must_prompt>true</must_prompt>可选的是字段必须提示。如果存在,则标志将与来自datamodel/lifecycle的标志合并。可用值为true | false,默认值为true
<must_change>true</must_change>可选的是变更字段。如果存在,则标志将与来自datamodel/lifecycle的标志合并。可用值为true | false,默认值为true
<twig>可选的表单布局。您可以在此菜单下使用任何HTML标记,以制作出完美的表单模板。如果未定义,则字段将一个接一个地放置。
<div class="form_field" data-field-id="title" data-field-flags="mandatory" data-field-display-mode="cosy">零或更多将带有“数据-field-id”属性的div放入表单。标签类是强制性的,必须包含“form_field”类。属性“数据-field-id”必须是该类的有效属性代码。可选地,您可以在该特定字段的布局中向表单添加“data-field-display-mode”属性(值可以紧凑)。
<modes>可选的声明的模式。如果未定义,则表单将适用于所有模式
<mode id="apply_stimulus">零或更多定义表单在此类中可用的模式。可用值是view | edit | create | apply_stimulus
<stimuli>可选的仅适用于apply_stimulus模式,定义了适用的刺激
<stimulus id="name">零或更多基于此激励代码,当前的表单将用于转换
<classes>强制性的宣告班
<class id="Contact">零或更多上课声明。类(或其祖先之一)必须定义为在实例中显示。 ID必须是有效的对象类
<scopes>强制性的声明范围
<scope id="name">零或更多范围的声明。范围定义了范围可以访问的对象集,这些对象对于简档是累积的用户
<oql_view>SELECT Contact WHERE org_id = :current_contact->org_id</oql_view>强制性的OQL查询,它定义了允许查看的对象集
<oql_edit>SELECT Contact WHERE id = :current_contact_id</oql_edit>可选的OQL查询,它定义了允许编辑的对象集。请注意,这仅适用于oql_view中的子集。
<ignore_silos>false</ignore_silos>可选的当设置为“ true”时,此范围的OQL将不限于当前用户的允许组织。值可以为true | false,默认为“ false”
<allowed_profiles>可选的声明了将可以访问该范围的简档(角色)。如果不存在此标签,则所有简档(角色)都可以访问范围。
<allowed_profile id="Portal User">零或更多可以访问该范围的简档的名称。 ID必须是唯一的,并且是有效的简档。
<lists>可选的演示列表。到目前为止,仅在门户中的对象的LinkedSet中使用。
<list id="default">零或更多声明清单。 ID必须是唯一的。支持的值是“列表”(用于对象的链接集)和“默认”(用作后备)
<items>强制性的声明的属性显示在列表中。
<item id="status">零或更多属性的声明。 ID必须是唯一的,并且必须是对象类的有效属性代码
<rank>10</rank>可选的属性在列表中的排名。最低至上。
<lifecycle>可选的生命周期:如果省略,则按简档(角色)拒绝刺激用户简档(角色)定义已应用
<stimuli>强制性的门户上禁用的事件列表
<stimulus id="stimulus_code">最后一个使用其代码作为ID声明刺激。
<denied_profiles>可选的宣布简档(角色)将无法访问该刺激。如果不存在此标签,则将拒绝所有简档(角色)进行刺激。
<denied_profile id="Portal User">零或更多在门户中将无法访问该激励的简档的名称。 ID必须是有效的简档。
<action_rules>可选的宣布功能规则。 AR是操作活动,将应用于特定功能上特定砖块中的对象表单。它们可以组合。
<action_rule id="contact-to-userrequest">零或更多功能规则的声明。 ID必须是唯一的。
<source_oql><![CDATA[SELECT Contact AS C WHERE C.id = :current_contact_id]]></source_oql>可选的将值从特定的对象复制到另一个时,请使用此标签指定OQL查询。 (例如,当前的联系人)注意:请使用source_oql或source_class,但不能两者都使用。注意2:source_class标签不支持抽象类,因为现在您必须为每个叶类重复标签规则。
<source_class>Service</source_class>可选的从砖块中单击的对象复制值时,请使用此标签指定对象类。 (例如,服务目录中的对象或ServiceSubCategory)注意:请使用source_oql或source_class,但不能两者都使用。
<presets>可选的声明的预设
<preset id="1">set(caller_id, $current_contact_id$)</preset>零或更多预设声明。 ID是唯一的。与source_oql | source_class结合使用时,将预置对象的属性价值。语法与ObjectCopier相似,支持的动词被设置| copy | add_to_list。
<navigation_rules>可选的声明的导航规则。 NR是操作活动,它将定义在单击对象表单的Submit/cancel按钮之后要去的地方。
<navigation_rule id="contact-to-userrequest" xsi:type="go-to-manage-brick">零或更多导航规则的声明。 ID在集合中必须唯一。 xsi:type必须是可用的之一,请参见“导航规则”部分。 (请注意,仅公共标签显示在此节点下)。

砖块

以下是基于itop-门户库构建的功能。您可以在单独的模块中实现自己的积木,只要它的名称(即xsi:type)不干扰现有积木即可。

标签用法描述
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\UserProfileBrick">强制性的连接了用户描述版砖。
<show_picture_form>true</show_picture_form>可选的显示隐藏的用户描述图片表单。可用值为true | false,默认值为true。
<show_preferences_form>true</show_preferences_form>可选的显示隐藏的用户偏好表单。可用值为true | false,默认值为true。
<show_password_form>true</show_password_form>可选的显示隐藏的用户密码表单。可用值为true | false,默认值为true。
<form>强制性的联系人信息版本表单用于所连接的用户。行为与门户的全局形式完全相同,请检查相应部分。
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick">零或更多浏览对象的分层并为每个级别指定操作活动(查看或编辑对象,然后从该对象创建另一个对象)。可以从多个视图(例如常规列表或树)中进行导航。用例可能是浏览对象目录,以查找用于创建您的请求的目录。
<levels>强制性的申报的水平
<level id="UNIQUE_ID">强制性的等级声明。 ID必须是唯一的,整数是更安全的,避免使用'-'
<class>ServiceFamily</class>可选的对象类在此级别上显示。忽略是否​​存在标签。
<oql><![CDATA[SELECT ServiceFamily]]></oql>可选的OQL查询定义要显示的对象类的子集。如果已定义,则将优先级替换为类标签。
<title>可选的该级别的标题。主要在列表模式下用作列标题。
<name_att>可选的属性类将显示为对象名称。默认值为“名称”。如果定义了操作活动,则该属性上的第一个可用
<tooltip_att>可选的属性类将显示在工具提示中
<description_att>可选的属性类将在对象名称旁边以短文本显示。 (注意:这在“列表”模式下不使用)
<image_att>可选的属性类将作为对象名称旁边的图像显示。 (注意:目前仅在“马赛克”模式下使用)
<fields>可选的在列表模式下显示的其他字段的列表(仅用于其他模式下的过滤)
<field id="UNIQUE_ID">零或更多属性类以显示为附加信息。将在过滤时使用。必须是该类的有效属性代码
<hidden>false</hidden>可选的隐藏该字段,使其不会显示,但仍由过滤器使用。可用值true | false,默认值为false。
<actions>可选的适用于该级别对象的操作活动。
<action id="UNIQUE_ID" xsi:type="drilldown">零或更多ID必须是唯一的。 xsi:type定义功能的类型。可用的类型为rilldown | view | create_from_this。
<title>Create a user request</title>可选的显示为功能标题的字符串
<icon_class>fc fc-new-request fc-1-6x fc-flip-horizontal</icon_class>可选的用于功能装饰的CSS类。除了您自己的类之外,还支持Bootstrap字形和FontAwesome类。
<opening_target>modal</opening_target>可选的定义如何完成功能。值可以是“模式”(在模式窗口中打开),“新”(在新窗口中)或“自身”(在当前窗口中)。默认价值为“模态”
<rank>1</rank>可选的功能菜单中的功能显示等级。最小的数字将是功能的主要操作活动。
<rules>可选的功能的功能规则
<rule id="UNIQUE_ID">零或更多ID必须是唯一的,并且对应于门户定义的有效功能规则。
<class>UserRequest</class>可选的未指定factory_method标签时,仅适用于功能[xsi:type =“ create_from_this”]。要创建的对象的类名。
<factory_method><![CDATA[\Ticket::CreateFromServiceSubcategory]]></factory_method>可选的未指定类标签时,仅适用于功能[xsi:type =“ create_from_this”]。将返回要使用的DBObject的标准方法名称(例如,返回标准门户中的ServiceSubcategory的UserRequest或事件依赖)。
<levels>可选的可选子级别。必须通过属性链接到父级别
<level id="UNIQUE_ID">强制性的子级别的声明。与父级别具有相同的标签,另外还包含以下内容。
<parent_att>servicefamily_id</parent_att>强制性的属性类将当前类链接到父级别的类
<browse_modes>强制性的浏览模式列表
<availables>强制性的可用浏览模式列表
<mode id="UNIQUE_ID">零或更多可用的浏览模式。 ID必须是唯一的并且是有效的浏览模式。标准模式是列表。
<default>list</default>强制性的默认浏览模式。必须是可用的浏览模式之一:list | tree | mosaic
<default_list_length>20</default_list_length>可选的设置项目列表的默认数量将显示。可用值为10 | 20 | 50 | -1
<data_loading>auto</data_loading>强制性的定义如何加载数据。可用值是自动的。 auto表示如果数据的计数小于实例的“ lazy_loading_阈值”模块_参数,则将以一次射击的方式加载数据。完整意味着所有数据将被立即加载。惰性意味着数据将在每个页面级别动态加载。该参数应该调整为数据的性能。
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick">零或更多允许通过在2轴上对对象进行分组和编辑来管理对象。通常用于管理正在进行的请求或一组配置项。
<class>Ticket</class>可选的对象类在砖块中管理。如果未定义标签,则为必填项,否则忽略。
<oql><![CDATA[SELECT Ticket]]></oql>可选的OQL查询定义了要在模块中管理的对象的子集。优先于标签类。
<opening_target>modal</opening_target>可选的定义如何完成功能。值可以是“模式”(在模式窗口中打开),“新”(新窗口)或“自身”(当前窗口)。默认价值为“模态”
<opening_mode>edit</opening_mode>可选的定义应如何打开对象。值可以编辑|查看,默认为“编辑”。请注意,即使将其设置为“ edit”,用户(范围和安全图层)在版本中不允许的对象也将在“视图”模式下打开。
<fields>可选的在对象列表中显示的属性列表,如果省略,将使用zlist“ list”。
<field id="UNIQUE_ID">零或更多属性显示在列表中,将在过滤时使用。 ID必须是该类的有效代码属性。
<display_modes>可选的显示模式列表,如果省略,将使用“列表”作为唯一显示类型
<availables>可选的可用显示模式列表
<mode id="UNIQUE_ID">零或更多可用的显示模式。 ID必须是唯一的并且是有效的显示模式。标准模式是列表|条形图|条形图。
<default>强制性的默认显示模式。如果省略标签'display_modes',则使用'list'。必须是已声明的可用显示模式之一
<tile>可选的砖块的显示模式。必须为以下之一:文字|徽章|饼图|条形图|顶部列表。默认为“文本”
<export>可选的从详细列表视图允许用户到导出数据。提供导出的``fields''或设置为true的导出``导出_default_fields''
<fields>可选的导出的属性列表(如果不需要默认值)。
<field id="UNIQUE_ID">零或更多属性至导出。 ID必须是该类的有效代码属性。
<export_default_fields>true</export_default_fields>可选的如果设置为true,则将使用在列表DataModel上定义的字段,并且即使提供了“字段”标签也将被忽略;如果设置为false并且未定义“字段”,则不会显示导出按钮。
<grouping>强制性的宣布分组。
<tabs>强制性的选项卡上的分组是通过OQL查询完成的,而表上的分组是在finalclass上完成的。
<show_tab_counts>false</show_tab_counts>可选的为每个选项卡显示对象计数。可用值为true | false。默认为false。
<attribute>operational_status</attribute>可选的根据属性的不同值进行分组。如果存在标签组,则为可选。
<limit>5</limit>可选的通过属性进行分组时,请限制组数。
<show_others>true</show_others>可选的设置限制后,将其他结果汇总到一个称为“其他”的结果中。可用值为true | false。默认为false。
<groups>可选的通过显式OQL查询进行分组。如果存在标签属性,则为可选。
<group id="UNIQUE_ID">零或更多团体宣言
<rank>1</rank>可选的选项卡在组中的排名
<title>Brick:Portal:OngoingRequests:Tab:OnGoing</title>强制性的标签标题
<description>Brick:Portal:OngoingRequests:Tab:OnGoing+</description>可选的标签说明,将显示在页面标题下方
<condition><![CDATA[SELECT Ticket AS T WHERE operational_status NOT IN ("closed", "resolved")]]></condition>强制性的OQL查询将应用于砖块的对象,以使该组
<default_list_length>20</default_list_length>可选的设置项目列表的默认数量将显示。可用值为10 | 20 | 50 | -1
<data_loading>auto</data_loading>强制性的定义如何加载数据。可用值是自动的。 auto表示如果数据的计数小于实例的“ lazy_loading_阈值”model_参数,则将以一次射击的方式加载数据。完整意味着所有数据将被立即加载。惰性意味着数据将在每个页面级别动态加载。该参数应该调整为数据的性能。
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\CreateBrick">零或更多显示对象创建表单。
<modal>true</modal>强制性的表单应该在模式对话框中还是在整个页面上。可用值为true | false,默认值为true。
<class>UserRequest</class>强制性的要创建的对象的类。
<rules>强制性的功能规则适用于表单。
<rule id="*UNIQUE_ID*">零或更多功能规则的声明。 ID必须是唯一的。有关更多信息,请参见功能规则部分。
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\FilterBrick">零或更多预过滤另一块砖。
<search_placeholder_value>eg. install office</search_placeholder_value>可选的在过滤器字段中显示为占位符的字符串。默认值为“ Brick:门户:过滤器:SearchInput:占位符”。
<search_submit_label>Search</search_submit_label>可选的提交按钮的标签。默认值为“ Brick:门户:过滤器:SearchInput:Submit”。
<search_submit_class>glyphicon glyphicon-search</search_submit_class>可选的CSS类添加在提交按钮上。例如,这可用于设置Glyphicon或Font Awesome图标。
<target_brick>强制性的结构节点。
<id>ongoing-tickets-for-portal-user</id>强制性的必须对应于目标砖的ID。
<type>Combodo\iTop\Portal\Brick\ManageBrick</type>强制性的必须对应于目标砖的xsi:type。截至今天,仅支持BrowseBrick和ManageBrick
<tab>list</tab>强制性的BrowseBrick:用于显示结果的浏览模式(镶嵌除外)。对于ManageBrick:要显示的选项卡(组ID)。
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\AggregatePageBrick">零或更多具有一对多砖瓦的页面。
<aggregate_page_bricks>强制性的要包括在页面中的砖块列表。
<aggregate_page_brick id="PAGE_BRICK_ID">最后一个要包含的砖ID
<rank>1</rank>可选的页面中图块的等级

变更记录

增强门户的数据模型可通过2016年夏季发布的iTop 2.3进行编辑

XML版本1.4

该版本随2017年7月发布的iTop 2.4 beta一起发布。

砖块

  • 滤器块:扩展包含在核心应用中。
  • UserProfileBrick:可以禁用简档图片,偏好和密码表单。从PHP 5.5.16起可用
   <brick xsi:type=UserProfileBrick>
      <show_picture_form>true</show_picture_form>
      <show_password_form>false</show_password_form>
      <show_preferences_form>true</show_preferences_form>

  BrowseBrick:

  • “树”模式在名称的顶部显示说明。
  • 默认功能是第一个声明的功能,添加了一个汉堡菜单,建议所有功能
  • 新模式“马赛克”在小型设备上很方便,允许显示与浏览对象相关的图像。
  <brick xsi:type=BrowseBrick>
     <browse_modes><availables><mode id="mosaic"/></availables></browse_modes>
     <levels><level><image_att>class_field_id</image_att></level></levels>

 在同一窗口的选项卡或弹出窗口中打开表单

 <brick xsi:type=BrowseBrick><levels><level><actions><action><opening_target>new</opening_target>... 
 <brick xsi:type=ManageBrick><opening_target>self</opening_target>... 

ManageBrick在选项卡上显示计数

 <brick xsi:type=ManageBrick><groupings><tabs><show_tab_count>true</show_tab_count>...

 Create Brick现在支持抽象类,对此没有特定的标签

形式

  • 词典条目现在可以形式使用。
  <legend>{{'Form:Portal:TicketEdit:Fieldset:General'|dict_s}}</legend> 
  • 表单上可配置的显示模式为变更的mmpropertiessdisplay_mode布局
  • 变更布局的字段上可配置的显示模式
 <div class="form_field" data-field-id="title" data-field-display-mode="cosy"> 
  • LinkedSet属性现在可以默认在表单打开时打开。
  <div class="form_field" data-field-id="contacts_list" data-field-opened="true"> 
  • 可以添加操作活动按钮
  • 可以为特定的转换专门定义表单,因此您可以决定要提示哪些字段,从而覆盖控制台行为。在这里检查更多细节 

例如,显示一个只读字段:

 <div class="form_field" data-field-id="org_id" data-field-flags="read_only"/>
  • 默认情况下,建议进行转换时,表单上的“提交”按钮现在处于隐藏状态。如果要复原以前的行为,请在XML定义的表单上使用此标签<always_show_submit>。
  •  
   <module_design id="itop-portal">
      <forms>
        <form id="ticket-create" _delta="if_exists">
          <properties _delta="define_if_not_exists">
            <always_show_submit _delta="force">true</always_show_submit>
          </properties>
        </form>
      </forms>
    </module_design>

其他

  • 可配置其他门户网站的开放模式
  • 您可以将转换隐藏给某些门户用户,例如,可以允许支持人员在门户中对分派和工单进行隐藏,而其他所有用户则不允许。但是,一旦定义了门户生命周期,就必须明确描述所有被拒绝的事件(刺激),除非所有被明确列出的被拒绝的简档(角色),否则此拒绝是针对所有简档(角色)的。
   <module_design id="itop-portal">
      <classes>
        <class id="Ticket">
          <lifecycle>
            <stimuli>
              <!-- ev_assigned and ev_resolved will NEVER be available in portal -->
              <stimulus id="ev_assign">
              </stimulus>
              <stimulus id="ev_resolved">
              </stimulus>
              <!-- ev_pending will be available in portal to other profiles than Support Agent -->
              <stimulus id="ev_pending">
                <denied_profiles>
                   <​denied_profile id="​Support Agent"/​> 
                </denied_profiles>
              </stimulus>
            </stimuli>
          </lifecycle>
        </class>
      </classes>
    </module_design>

XML版本1.5

砖块

  • ManageBrick:此版本为Manage Brick提供了新的显示类型(饼图,条形图和徽章)。
<brick xsi:type="Combodo\iTop\Portal\Brick\ManageBrick">
   <display_modes>
      <availables>
          <mode id="list"/>
          <mode id="pie-chart"/>
          <mode id="bar-chart"/>
      </availables>
      <default>pie-chart</default>
      <tile>badge</tile>
   </display_modes>
  • 它还允许将导出数据转换为Excel。
  <export><export_default_fields>true</export_default_fields>...

 可以指定导出的字段:

 <export><fields><field id="title"/>....

  组数可以限制:

  <grouping><tabs><limit>5</limit>...

当组的数量受到限制时,其余的可以汇总:

  <grouping><tabs><limit>5</limit><show_others>true</show_others>...

  Aggregated Brick_:要在页面中显示的新砖,另一块砖中的砖

XML版本1.7

形式

  • LinkedSet属性可以显示(或不显示)范围之外的项目。
<div class="form_field" data-field-id="contacts_list" data-field-ignore-scopes="true"/>

ManagedBrick上的选项卡描述

  • 现在可以指定标签说明,显示在砖标题的正下方。
  • 像往常一样,它可以是一个字典条目,例如Br​​ick:门户:OngoingRequest:Tab:OnGoing +,它不存在,需要并行创建。
ManageBrick
 
  <grouping><tabs><groups><group id="MyTab"><description>enter there your tab description...

在浏览和管理方块上列出大小

  • 变更现在可以使用“管理并浏览”模块的默认大小。
  • 可能的选项是10、20、50和-1,这表示不分页显示所有对象。默认值为20,就像无法设置时一样。
<default_list_length>-1</default_list_length>

在Browse Brick中使用n:n关系

  • 现在可以通过n-n关系在“浏览”模块中导航。
  • 您可以在“服务”和“服务”子类别的下方显示与应用解决方案,团队相关的文档,并在其成员或“客户合同”下方显示。
  • module-designs / module-design@itop-portal / bricks
<brick id="team-members" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick" _delta="define">
  <title><default>Teams members</default></title>
  <description>Browse brick navigation using n-n relation.</description>
  <decoration_class><default>fa fa-arrow-circle-o-left fa-2x</default></decoration_class>
  <levels>
    <level id="1">
      <class>Team</class>
      <levels>
        <level id="1">
          <class>Person</class>
          <--! parent_att can be an AttributeLinkedsetIndirect -->
          <--! before only AttributeExternalKey was possible -->
          <parent_att>team_list</parent_att>
          <name_att/>
          <tooltip_att>email</tooltip_att>
          <description_att>function</description_att>
          <title>Class:Person</title>
          <levels/>
          <actions>
            <action id="view" xsi:type="view"><rank>1</rank></action>
          </actions>
        </level>
      </levels>
    </level>
  </levels>
  <browse_modes>
    <availables>
      <mode id="list"/>
      <mode id="tree"/>
    </availables>
    <default>tree</default>
  </browse_modes>
  <default_list_length>-1</default_list_length>
  <data_loading>lazy</data_loading>
</brick>

导航规则

您可以创建导航规则并从任何表单调用它们

可能的规则

Close window
 
  <navigation_rule id="close-form" xsi:type="close"/>
Go to the homepage
 
  <navigation_rule id="go-to-homepage" xsi:type="go-to-homepage"/>
Open a manage brick
 
  <navigation_rule id="go-to-resolved-requests" xsi:type="go-to-manage-brick">
    <!-- Mandatory, ID of the ManageBrick to go to -->
    <id>ongoing-tickets-for-portal-user</id>
    <!-- Optional, must be an ID of the available display modes of the brick  -->
    <display_mode>list</display_mode>
    <!-- Optional, must be an ID of the grouping tab of the brick -->
    <grouping_tab>resolved</grouping_tab>
    <!-- Optional, a string to preset as filter in the brick. -->
    <!-- <filter>:this->caller_id_friendlyname</filter> -->
  </navigation_rule>
Open a browse brick
 
  <navigation_rule id="go-to-services" xsi:type="go-to-browse-brick">
    <!-- Mandatory, ID of the BrowseBrick to go to -->
    <id>services</id>
    <!-- Optional, must be an ID of the available browse modes of the brick -->
    <!-- <browse_mode>tree</browse_mode> -->
    <!-- Optional, a string to preset as filter in the brick. -->
    <!-- <filter>computer</filter> -->
  </navigation_rule>
Open a brick, developer method
 
  <navigation_rule id="go-to-change-overview" xsi:type="go-to-brick">
    <route>
      <id>p_aggregatepage_brick</id>
      <params>
        <param id="sBrickId">change-overview</param>
      </params>
    </route>
  </navigation_rule>
  <navigation_rule id="go-to-ongoing-tickets" xsi:type="go-to-brick">
    <route>
      <id>p_manage_brick_display_as</id>
      <params>
        <param id="sBrickId">ongoing-tickets-for-portal-user</param>
        <param id="sDisplayMode">list</param>
        <param id="sGroupingTab">resolved</param>
      </params>
    </route>
  </navigation_rule>
Open an object
 
  <navigation_rule id="go-to-object" xsi:type="go-to-object">
    <!-- Mandatory, opens the first result from the OQL. Result may vary ¯\_(ツ)_/¯  but ":this" available! -->
    <oql>SELECT Ticket WHERE id = :this->id</oql>
    <!-- Optional, mode of the object form, either view|edit -->
    <mode>view</mode>
    <!-- Optional, how to open the object form, replace the current form (current), in a modal (modal) or in the page (page) -->
    <opening_target>modal</opening_target>
  </navigation_rule>

然后,您可以从任何表单调用这些导航规则

module_design@itop-portal / forms
 
<form id="ticket-apply-stimulus">
  <properties>
    <navigation_rules _delta="define">
      <submit>
        <default>go-to-resolved-requests</default>
      </submit>
      <cancel>
        <default>go-to-homepage</default>
        <modal>close-form</modal>
      </cancel>
    </navigation_rules>
  </properties>
</form>

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


Customer portal XML Reference

You must be familiar with the fundamentals of iTop XML design.

For an overview of the Customer Portal customization capabilities, please have a look at the page Customize your Customer Portal

The version 2.5 of iTop introduce a number of changes to the Portal Bricks (Dashlets). The complete list of modifications introduced by the new formats are described in chapter Changes history.

Structure

This structure is specific to a portal developped over the itop-portal-base library.

TagUsageDescription
<module_design id="PORTAL_UNIQUE_ID" xsi:type="portal">mandatoryStructural node defining configuration for a portal instance
<properties>mandatoryGlobal properties of the instance
<name>portal:itop-portal</name>mandatoryPortal name
<logo>../images/itop-logo.png</logo>optionalLogo to use in the instance. If defined, will override the one from the Designer or env-xxx/branding/portal-logo.png
<themes>mandatoryDeclared CSS stylesheets
<theme id="custom">sample-portal-custom-css/custom.css</theme>zero or moreList of CSS stylesheets. IDs bootstrap|portal|custom are loaded first, redefining them will override the default files. Then other IDs will be loaded. Path must be relative to /env-xxx
<templates>mandatoryDeclared TWIG templates
<template id="layout">sample-portal-alter-twig/layout.html.twig</template>zero or moreList of TWIG template to override. Available values are "layout" for the whole page or "home" for the home page content. (Bricks content layout can be defined directly in each bricks)
<urlmaker_class>iTopPortalViewUrlMaker</urlmaker_class>optionalClass used for generating objects view urls (eg. in notifications, linksets)
<triggers_query>SELECT TriggerOnPortalUpdate AS t WHERE t.target_class IN (:parent_classes)</triggers_query>mandatoryOQL query to retrieve triggers when updating an object on the instance
<attachments>mandatoryStructural node
<allow_delete>true</allow_delete>mandatoryCan the attachments be deleted on the portal. Available values are true|false
<allowed_portals>mandatoryStructural node
<opening_mode>tab</opening_mode>mandatoryDefines how other portals -allowed for the current user- will be opened. Available values are "tab"|"self". "tab" opens the portal in a new tab, "self" opens it in the current tab. Default value is "tab".
<bricks>mandatoryDeclared bricks
<brick id="BRICK_UNIQUE_ID" xsi:type="ANY_FQCN_BRICK">zero or moreDeclaration of a brick. ID must be unique through the collection. xsi:type must be the fully qualified class name (including the namespace). There can be several instances of a same xsi:type brick as long as their IDs are differents. See the various types of bricks in section Bricks (Note that only the common tags are displayed under this node)
<active>true</active>optionalIs the brick active on the portal. Note that an active brick that is not visible on both the home page and the navigation menu can still be accessed from its URL. Available values are true|false, default is true
<width>6</width>optionalWidth of the tile on the home page. Value must be an integer between 1-12, 12 being the whole row width. Default value is 3.
<rank>optionalRank of the brick on the home page and the navigation menu. If not specified, will be placed first.
<default>1</default>optionalRank on both home page and navigation menu. Value must be an float.
<home>1</home>optionalRank on the home page only. Value must be an float.
<navigation_menu>1</navigation_menu>optionalRank on the navigation menu. Value must be an float.
<title>optionalTitle of the brick on the home page and the navigation menu.
<default>Brick:Portal:Foo:Bar</default>optionalTitle on both home page and navigation menu.
<home>Brick:Portal:Foo:Bar</home>optionalTitle on the home page only.
<navigation_menu>Brick:Portal:Foo:Bar</navigation_menu>optionalTitle on the navigation menu only.
<description>Brick:Portal:Foo:Bar+</description>optionalDescription of the brick that will be displayed on the home page.
<visible>optionalIs the brick visible on the home page and the navigation menu. If not specified, default is true on both.
<home>true</home>optionalIs the brick visible on the home page. Available values are true|false, default is true
<navigation_menu>true</navigation_menu>optionalIs the brick visible on the navigation menu. Available values are true|false, default is true
<decoration_class>mandatoryCSS classes for the brick's icon on the home page and the navigation menu. CSS classes from Glyphicon, Font Awesome or your own can be used.
<default>fa fa-user fa-2x</default>optionalCSS classes applied on both home page and navigation menu.
<home>fa fa-user fa-2x</home>optionalCSS classes applied on the home page.
<navigation_menu>fa fa-user fa-2x</navigation_menu>optionalCSS classes applied on the navigation menu.
<templates>optionalTemplates of the brick that can be overrided
<template id="page">zero or morePath to the TWIG template used to override the default one. Path must be relative to env-xxx. Can be used to cutomize the template of a brick's tile (home page) or page. ID attribute is mandatory and must be either "tile" or "page".
<security>optionalLimitation on which profile can see this brick or not
<allowed_profiles>SELECT URP_Profiles WHERE name = 'Portal user'</allowed_profiles>optionalOQL returning Profiles which members can see this brick. If omitted, all Profiles not explicitly denied can see it.
<denied_profiles>OQL</denied_profiles>optionalProfiles which cannot see this brick.
<forms>mandatoryDeclared forms
<form id="name">zero or moreDeclaration of a form. ID must be unique
<class>ServiceSubcategory</class>mandatoryObject class of the form. Child classes will inherit this form if they have none defined
<properties>optionalStructural node
<display_mode>cosy</display_mode>optionalDisplay mode of the form fields. "cosy" for a regular labels over values layout; "compact" for a side-by-side layout with 25% space for label and 75% for input; "dense" for a side-by-side layout with input filling all available space. You can also use a custom css class that will be used on the form as "form_xxx", as well as on the fields as "form_field_xxx". Available values are cosy|compact|dense|CUSTOM_VALUE, default is cosy.
<always_show_submit>false</always_show_submit>optionalWhen set to false, submit button is hidden when transitions are available on the object. Available values are true|false, default is false.
<navigation_rules>optionalNavigation rules to apply on this form.
<submit>optionalNR to apply on the submit/update buttons. Note that transition buttons are not concerned.
<default>go-to-object</default>mandatoryID of the navigation rule to apply when the form is opened in full page.
<modal>go-to-object</modal>mandatoryID of the navigation rule to apply when the form is opened in a modal, if not present, will be used.
<cancel>optionalNR to apply on the cancel button.
<default>close-form</default>mandatoryID of the navigation rule to apply when the form is opened in full page.
<modal>close-form</modal>mandatoryID of the navigation rule to apply when the form is opened in a modal, if not present, will be used.
<fields>optionalDeclared fields. If empty, only fields from twig tag will be displayed. If omitted only fields from zlist details will be displayed, twig tag will be ignored
<field id="title">zero or moreDeclaration of a field. ID must be a valid attribute code of the class. Will be placed one after the other if not placed in twig tag. Missing mandatory attributes will be automatically appended to the form
<slave>true</slave>optionalIs the field slave. If present, flag will be merged we those from the datamodel/lifecycle. Available values are true|false, default is true
<read_only>true</read_only>optionalATTENTION! This flag does not work, use a TWIG if you have that need.
<mandatory>true</mandatory>optionalIs the field mandatory. If present, flag will be merged we those from the datamodel/lifecycle. Available values are true|false, default is true
<hidden>true</hidden>optionalIs the field hidden. If present, flag will be merged we those from the datamodel/lifecycle. Available values are true|false, default is true
<must_prompt>true</must_prompt>optionalIs the field must prompt. If present, flag will be merged we those from the datamodel/lifecycle. Available values are true|false, default is true
<must_change>true</must_change>optionalIs the field must change. If present, flag will be merged we those from the datamodel/lifecycle. Available values are true|false, default is true
<twig>optionalForm layout. You can use any HTML tags under this on, to make a perfect form template. If not defined, fields will be placed one after the other.
<div class="form_field" data-field-id="title" data-field-flags="mandatory" data-field-display-mode="cosy">zero or morePlace a div with an "data-field-id" attribute to get it in the form. Class tag is mandatory must contains "form_field" class. "data-field-id" attribute must be a valid attribute code for the class. Optionally, you can add a "data-field-display-mode" attribute to change the layout of this specific field (values can be cosy|compact|dense).
<modes>optionalDeclared modes. If not defined, form will be for all modes
<mode id="apply_stimulus">zero or moreDefines in which modes the form will be available for this class. Available values are view|edit|create|apply_stimulus
<stimuli>optionalFor apply_stimulus mode only, defined applicable stimuli
<stimulus id="name">zero or moreThe current form will be used for transition based on this stimulus code
<classes>mandatoryDeclared classes
<class id="Contact">zero or moreDeclaration of class. A class (or one of its ancestors) MUST be defined to be displayed in the instance. ID must be a valid Object class
<scopes>mandatoryDeclared scopes
<scope id="name">zero or moreDeclaration of scope. A scope defines the set of objects a Profile can access, they are cumulative regarding the user profiles
<oql_view>SELECT Contact WHERE org_id = :current_contact->org_id</oql_view>mandatoryOQL query that defines the set of objects allowed to view
<oql_edit>SELECT Contact WHERE id = :current_contact_id</oql_edit>optionalOQL query that defines the set of objects allowed to edit. Note that this apply only on the sub set from oql_view.
<ignore_silos>false</ignore_silos>optionalWhen set to "true", the OQLs of this scope will not be restricted to the current user's allowed organizations. Values can be true|false, default is "false"
<allowed_profiles>optionalDeclared profiles that will have access to that scope. If this tag is not present, all profiles will have access to the scope.
<allowed_profile id="Portal User">zero or moreName of the Profile that will have access to that scope. ID must be unique and a valid Profile.
<lists>optionalPresentation lists. As of today, used only in objects' LinkedSet in the portal.
<list id="default">zero or moreDeclaration of list. ID must be unique. Supported values are 'list' (used for object's linkedset) and 'default' (used as fallback)
<items>mandatoryDeclared attributes to show in the list.
<item id="status">zero or moreDeclaration of attribute. ID must be unique and must be a valid attribute code of the object class
<rank>10</rank>optionalRank of the attribute in the list. Lowest comes first.
<lifecycle>optionalLifecycle: stimuli denied per Profiles, if omitted user profiles definition is applied
<stimuli>mandatoryList of events disabled on portal
<stimulus id="stimulus_code">at least oneDeclaration of a stimulus, using its code as id.
<denied_profiles>optionalDeclared profiles that will not have access to that stimulus. If this tag is not present, all profiles will be denied for the stimulus.
<denied_profile id="Portal User">zero or moreName of the Profile that will not have access to that stimulus in the portal. ID must be a valid Profile.
<action_rules>optionalDeclared action rules. AR are actions that will be applied to an object / form in a specific brick, on a specific action. They can be combined.
<action_rule id="contact-to-userrequest">zero or moreDeclaration of action rule. ID must be unique.
<source_oql><![CDATA[SELECT Contact AS C WHERE C.id = :current_contact_id]]></source_oql>optionalWhen copying values from a specific object to another, use this tag to specify the OQL query. (eg. The current contact) Note: Use either source_oql or source_class but not both. Note 2: Abstract classes are NOT supported with the source_class tag, for now you must duplicate action rules for each leaf classes.
<source_class>Service</source_class>optionalWhen copying values from the clicked object in a brick, use this tag to specify the object class. (eg. The Service or ServiceSubCategory in the Services catalog) Note : Use either source_oql or source_class but not both.
<presets>optionalDeclared presets
<preset id="1">set(caller_id, $current_contact_id$)</preset>zero or moreDeclaration of a preset. ID mus be unique. When combined with source_oql|source_class, will preset an attribute value of the object. Syntax is similar to ObjectCopier, supported verbs are set|copy|add_to_list.
<navigation_rules>optionalDeclared navigation rules. NR are actions that will define where to go after clicking on the submit/cancel buttons of an object form.
<navigation_rule id="contact-to-userrequest" xsi:type="go-to-manage-brick">zero or moreDeclaration of navigation rule. ID must be unique through the collection. xsi:type must one of the available ones, see the Navigation rules section. (Note that only common tags are displayed under this node).

Bricks

Here are the features built it the itop-portal-base library. You may implement your own brick in a separate module, provided that its name (i.e. xsi:type) does not interfere with the existing bricks.

TagUsageDescription
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\UserProfileBrick">mandatoryConnected user profile edition brick.
<show_picture_form>true</show_picture_form>optionalShow / hide the user profile picture form. Available values are true|false, default is true.
<show_preferences_form>true</show_preferences_form>optionalShow / hide the user preferences form. Available values are true|false, default is true.
<show_password_form>true</show_password_form>optionalShow / hide the user password form. Available values are true|false, default is true.
<form>mandatoryContact informations edition form for the connected user. Behave exactly like global forms of the portal, please check the corresponding section.
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick">zero or moreNavigate through an hierarchy of objects and specify actions for each levels (view or edit the object, create another object from this one). Navigation can be done from multiple views such as a regular list or a tree. An use case could be to browse the service catalog to find the one to create your request from.
<levels>mandatoryDeclared levels
<level id="UNIQUE_ID">mandatoryDeclaration of level. ID must be unique, integer are safer, avoid '-'
<class>ServiceFamily</class>optionalObject class to display on this level. Ignored if oql tag is present.
<oql><![CDATA[SELECT ServiceFamily]]></oql>optionalOQL query to define a sub-set of an object class to display. Takes priority over class tag if defined.
<title>optionalTitle for that level. Mainly used in list mode as column header.
<name_att>optionalClass attribute to be displayed as the object name. Default is "name" If actions are defined, the first one is available on that attribute
<tooltip_att>optionalClass attribute to be displayed in a tooltip
<description_att>optionalClass attribute to be displayed as a short text beside the object's name. (Note: This is not used in "list" mode)
<image_att>optionalClass attribute to be displayed as an image beside the object's name. (Note: This is only used in "mosaic" mode for now)
<fields>optionalList of extra fields to be displayed in list mode (used only for filtering in other modes)
<field id="UNIQUE_ID">zero or moreClass attribute to display as an extra information. Will be used when filtering. Must be a valid attribute code of the class
<hidden>false</hidden>optionalHide the field so it won't be displayed but still be used by the filter. Available values true|false, default is false.
<actions>optionalAvailable actions for objects of that level.
<action id="UNIQUE_ID" xsi:type="drilldown">zero or moreID must be unique. xsi:type defines the type of action. Available types are drilldown|view|create_from_this.
<title>Create a user request</title>optionalString to display as the action's title
<icon_class>fc fc-new-request fc-1-6x fc-flip-horizontal</icon_class>optionalCSS classes to use for the action decoration. Bootstrap glyphicons and FontAwesome classes are supported in addition to your own.
<opening_target>modal</opening_target>optionalDefines how the action should be done. Values can be "modal" (Opens in a modal window), "new" (in a new window) or "self" (in the current window). Default value is "modal"
<rank>1</rank>optionalAction display rank in actions menu. Lowest number will be the primary action for the object.
<rules>optionalAction rules for the action
<rule id="UNIQUE_ID">zero or moreID must be unique and correspond to a valid action rule of the portal definition.
<class>UserRequest</class>optionalAvailable only for action[xsi:type="create_from_this"] when factory_method tag is not specified. Class name of the object to create.
<factory_method><![CDATA[\Ticket::CreateFromServiceSubcategory]]></factory_method>optionalAvailable only for action[xsi:type="create_from_this"] when class tag is not specified. Fully qualified method name that will return the DBObject to use (eg. Returns an UserRequest or an Incident depending of the ServiceSubcategory in the standard portal).
<levels>optionalOptional sub levels. Must be linked to the parent level through an attribute
<level id="UNIQUE_ID">mandatoryDeclaration of sub level. Has the same tags as the parent level with the following as extras.
<parent_att>servicefamily_id</parent_att>mandatoryClass attribute that linked the current class to the parent level's class
<browse_modes>mandatoryList of browse modes
<availables>mandatoryList of available browse modes
<mode id="UNIQUE_ID">zero or moreAvailable browse mode. ID must be unique and a valid browse mode. Standard modes are list|tree|mosaic.
<default>list</default>mandatoryDefault browse mode. Must be one of the available browse modes: list|tree|mosaic
<default_list_length>20</default_list_length>optionalSet the default number of item lists will display. Available values are 10|20|50|-1
<data_loading>auto</data_loading>mandatoryDefines how the data will be loading. Available values are auto|full|lazy. auto means that data will be loaded in one shot if their count is less than the "lazy_loading_threshold" module_parameter of the instance. full means that all data will be loaded at once. lazy means that data will be loaded dynamically at each page / level. This parameter should be tuned to improve performances.
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick">zero or moreAllows to manage objects by grouping them on 2 axis and edit them. Typically to manage the ongoing requests or a group of CIs.
<class>Ticket</class>optionalClass of object to manage in the brick. Required if no oql tag defined, ignored otherwise.
<oql><![CDATA[SELECT Ticket]]></oql>optionalOQL query to define the subset of object to manage in the brick. Takes precedence over class tag.
<opening_target>modal</opening_target>optionalDefines how the action shoul be done. Values can be "modal" (Opens in a modal window), "new" (a new window) or "self" (the current window). Default value is "modal"
<opening_mode>edit</opening_mode>optionalDefine how the objects should be opened. Values can be edit|view, default is "edit". Note that even if this is set to "edit", objects not allowed in edition for the user (scopes and security layers) will open in "view" mode.
<fields>optionalList of attributes to display in the object list, if omitted zlist "list" will be used.
<field id="UNIQUE_ID">zero or moreAttribute to display in the list, will be used when filtering. ID must be a valid code attribute of the class.
<display_modes>optionalList of display modes, if omitted will use 'list' as the only display type
<availables>optionalList of available display modes
<mode id="UNIQUE_ID">zero or moreAvailable display modes. ID must be unique and a valid display mode. Standard modes are list|pie-chart|bar-chart.
<default>mandatoryDefault display mode. 'list' is used if tag 'display_modes' is omitted. Must be one of the declared available display modes
<tile>optionalDisplay mode of the brick's tile. Must be one of the following: text|badge|pie-chart|bar-chart|top-list. Default is "text"
<export>optionalAllows the user to export data from the detailed list view. Provide either the ''fields'' to export or the tag ''export_default_fields'' set to true
<fields>optionalList of attributes to export, if you don't want the default.
<field id="UNIQUE_ID">zero or moreAttribute to export. ID must be a valid code attribute of the class.
<export_default_fields>true</export_default_fields>optionalIf set to true, fields defined on the list DataModel will be used and ''Fields'' tag even if provided will be ignored, if set to false and no ''Fields'' defined, the export button will not be displayed.
<grouping>mandatoryDeclared grouping.
<tabs>mandatoryGrouping on tabs is done over an OQL query whereas grouping on tables is done on the finalclass.
<show_tab_counts>false</show_tab_counts>optionalShow object count for each tabs. Available values are true|false. Default is false.
<attribute>operational_status</attribute>optionalGrouping on distinct values of an attribute. Optional if tag groups is present.
<limit>5</limit>optionalLimit the groups number when grouping by attribute is done.
<show_others>true</show_others>optionalWhen a limit is set, Aggregate the other results in one called 'Others'. Available values are true|false. Default is false.
<groups>optionalGrouping by explicit OQL queries. Optional if tag attribute is present.
<group id="UNIQUE_ID">zero or moreDeclaration of group
<rank>1</rank>optionalRank of the tab among the groups
<title>Brick:Portal:OngoingRequests:Tab:OnGoing</title>mandatoryTitle of the tab
<description>Brick:Portal:OngoingRequests:Tab:OnGoing+</description>optionalDescription of the tab, will be displayed under the page title
<condition><![CDATA[SELECT Ticket AS T WHERE operational_status NOT IN ("closed", "resolved")]]></condition>mandatoryOQL query that will be applied on the brick's object set to make that group
<default_list_length>20</default_list_length>optionalSet the default number of item lists will display. Available values are 10|20|50|-1
<data_loading>auto</data_loading>mandatoryDefines how the data will be loading. Available values are auto|full|lazy. auto means that data will be loaded in one shot if their count is less than the "lazy_loading_threshold" module_parameter of the instance. full means that all data will be loaded at once. lazy means that data will be loaded dynamically at each page / level. This parameter shouldbe tuned to improve performances.
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\CreateBrick">zero or moreDisplays an object creation form.
<modal>true</modal>mandatoryShould the form be in a modal dialog or on a whole page. Available values are true|false, default is true.
<class>UserRequest</class>mandatoryClass of the object to create.
<rules>mandatoryAction rules to apply on the form.
<rule id="*UNIQUE_ID*">zero or moreDeclaration of action rule. ID must be unique. See Action Rule section for more informations.
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\FilterBrick">zero or morePre-filters another brick.
<search_placeholder_value>eg. install office</search_placeholder_value>optionalString to display as a placeholder in the filter field. Default is "Brick:Portal:Filter:SearchInput:Placeholder".
<search_submit_label>Search</search_submit_label>optionalLabel of the submit button. Default is "Brick:Portal:Filter:SearchInput:Submit".
<search_submit_class>glyphicon glyphicon-search</search_submit_class>optionalCSS classes to add on the submit button. This can be used to set a Glyphicon or Font Awesome icon for example.
<target_brick>mandatoryStructural node.
<id>ongoing-tickets-for-portal-user</id>mandatoryMust correspond to the id of the target brick.
<type>Combodo\iTop\Portal\Brick\ManageBrick</type>mandatoryMust correspond to the xsi:type of the target brick. As of today, only BrowseBrick and ManageBrick are supported
<tab>list</tab>mandatoryBrowseBrick: The browse mode to use for displaying the results (except mosaic). For ManageBrick: The tab to display (group id).
<brick id="UNIQUE_ID" xsi:type="Combodo\iTop\Portal\Brick\AggregatePageBrick">zero or moreA page with one to many brick tiles.
<aggregate_page_bricks>mandatoryList of bricks to include in the page.
<aggregate_page_brick id="PAGE_BRICK_ID">at least oneBrick id to include
<rank>1</rank>optionalRank of the tile in the page

Changes history

The datamodel for the Enhanced Portal became editable with iTop 2.3 released in summer 2016

XML Version 1.4

This version came live with iTop 2.4 beta, released in July 2017.

Bricks

  • Filter Brick: extension was included to the core application.

  • UserProfileBrick: Profile picture, preferences and password forms can be disabled.Available from PHP 5.5.16

   <brick xsi:type=UserProfileBrick>
      <show_picture_form>true</show_picture_form>
      <show_password_form>false</show_password_form>
      <show_preferences_form>true</show_preferences_form>
  • BrowseBrick:

    •  

    “Tree” mode displays a description on top of a name.

    •  

    Default action is the first declared action, an hamburger menu was added proposing all actions

    •  

    New mode “mosaic” convenient on small devices, allowing to display an image associated with the browsed objects.

  <brick xsi:type=BrowseBrick>
     <browse_modes><availables><mode id="mosaic"/></availables></browse_modes>
     <levels><level><image_att>class_field_id</image_att></level></levels>
  • Open a form in the same window, in a tab or a pop-up

 <brick xsi:type=BrowseBrick><levels><level><actions><action><opening_target>new</opening_target>... 
 <brick xsi:type=ManageBrick><opening_target>self</opening_target>... 
  • ManageBrick displays count on tabs

 <brick xsi:type=ManageBrick><groupings><tabs><show_tab_count>true</show_tab_count>... 
  • Create Brick now support abstract class, no specific tag for this

Forms

  • Dictionary entries now usable in forms.

         <legend>{{'Form:Portal:TicketEdit:Fieldset:General'|dict_s}}</legend> 
  • Configurable display mode on forms to change the layout form/properties/display_mode

  • Configurable display mode on fields to change the layout

  <div class="form_field" data-field-id="title" data-field-display-mode="cosy"> 
  • A LinkedSet attribute can now be open by default at form opening.

  <div class="form_field" data-field-id="contacts_list" data-field-opened="true"> 
  • Actions buttons can be added

  • Forms can be defined specifically for a particular transition, so you can decide which fields will be prompted, overwriting the console behavior. Check here for more details

Example, display a read only field:

  <div class="form_field" data-field-id="org_id" data-field-flags="read_only"/>
  • By default the submit button is now hidden on forms when transitions are proposed. If you want to restore the previous behavior use this tag <always_show_submit> on forms defined in XML.

    <module_design id="itop-portal">
      <forms>
        <form id="ticket-create" _delta="if_exists">
          <properties _delta="define_if_not_exists">
            <always_show_submit _delta="force">true</always_show_submit>
          </properties>
        </form>
      </forms>
    </module_design>

Others

  • Configurable opening mode for additional portals

  • You can hide a transition to some portal users, for example, support agent could be allowed to assign a ticket in the portal while all others would not. But as soon as you define a lifecycle tag then you must explicitly describe all denied Events (stimuli), this denial is for all profiles unless denied profiles are explicitly listed.

    <module_design id="itop-portal">
      <classes>
        <class id="Ticket">
          <lifecycle>
            <stimuli>
              <!-- ev_assigned and ev_resolved will NEVER be available in portal -->
              <stimulus id="ev_assign">
              </stimulus>
              <stimulus id="ev_resolved">
              </stimulus>
              <!-- ev_pending will be available in portal to other profiles than Support Agent -->
              <stimulus id="ev_pending">
                <denied_profiles>
                   <​denied_profile id="​Support Agent"/​> 
                </denied_profiles>
              </stimulus>
            </stimuli>
          </lifecycle>
        </class>
      </classes>
    </module_design>

XML Version 1.5

Bricks

  • ManageBrick: this version provides new display types (pie chart, bar chart and badge) to the Manage Brick.

<brick xsi:type="Combodo\iTop\Portal\Brick\ManageBrick">
   <display_modes>
      <availables>
          <mode id="list"/>
          <mode id="pie-chart"/>
          <mode id="bar-chart"/>
      </availables>
      <default>pie-chart</default>
      <tile>badge</tile>
   </display_modes>
  • It also allows to export data to Excel.

  <export><export_default_fields>true</export_default_fields>...
  • The exported fields can be specified:

  <export><fields><field id="title"/>....
  • The number of groups can be limited:

  <grouping><tabs><limit>5</limit>...
  • When the number of groups is limited, the remaining can be aggregated:

  <grouping><tabs><limit>5</limit><show_others>true</show_others>...
  • Aggregated Brick_ : a new brick to display in a page tiles from another bricks

XML Version 1.7

Forms

  • A LinkedSet attribute can display (or not) items that are out of scope.

<div class="form_field" data-field-id="contacts_list" data-field-ignore-scopes="true"/>

Tab description on ManagedBrick

  • It's now possible to specify a tab description, displayed just below the brick title.

  • As usual it can be a dictionary entry like Brick:Portal:OngoingRequest:Tab:OnGoing+which does not exist and need to be created in parallel.

ManageBrick
 
  <grouping><tabs><groups><group id="MyTab"><description>enter there your tab description...

List size on Browse and Manage Brick

  • It's now possible to change the default size of a Manage and Browse brick.

  • The possible options are 10, 20, 50 and -1 which mean display all objects without pagination. Default is 20, as it was when it was not possible to set it.

<default_list_length>-1</default_list_length>

Use n:n relation in Browse Brick

  • It's now possible to navigate in a Browse brick, through n-n relation.

  • You could display Documents associated to Application Solutions, Teams and below theirs Members or Customer Contracts, with below the included Services & Service Subcategories.

module-designs / module-design@itop-portal / bricks
 
<brick id="team-members" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick" _delta="define">
  <title><default>Teams members</default></title>
  <description>Browse brick navigation using n-n relation.</description>
  <decoration_class><default>fa fa-arrow-circle-o-left fa-2x</default></decoration_class>
  <levels>
    <level id="1">
      <class>Team</class>
      <levels>
        <level id="1">
          <class>Person</class>
          <--! parent_att can be an AttributeLinkedsetIndirect -->
          <--! before only AttributeExternalKey was possible -->
          <parent_att>team_list</parent_att>
          <name_att/>
          <tooltip_att>email</tooltip_att>
          <description_att>function</description_att>
          <title>Class:Person</title>
          <levels/>
          <actions>
            <action id="view" xsi:type="view"><rank>1</rank></action>
          </actions>
        </level>
      </levels>
    </level>
  </levels>
  <browse_modes>
    <availables>
      <mode id="list"/>
      <mode id="tree"/>
    </availables>
    <default>tree</default>
  </browse_modes>
  <default_list_length>-1</default_list_length>
  <data_loading>lazy</data_loading>
</brick>

Navigation rules

You can create navigation rules and call them from any form

Possible rules

Close window
 
  <navigation_rule id="close-form" xsi:type="close"/>
Go to the homepage
 
  <navigation_rule id="go-to-homepage" xsi:type="go-to-homepage"/>
Open a manage brick
 
  <navigation_rule id="go-to-resolved-requests" xsi:type="go-to-manage-brick">
    <!-- Mandatory, ID of the ManageBrick to go to -->
    <id>ongoing-tickets-for-portal-user</id>
    <!-- Optional, must be an ID of the available display modes of the brick  -->
    <display_mode>list</display_mode>
    <!-- Optional, must be an ID of the grouping tab of the brick -->
    <grouping_tab>resolved</grouping_tab>
    <!-- Optional, a string to preset as filter in the brick. -->
    <!-- <filter>:this->caller_id_friendlyname</filter> -->
  </navigation_rule>
Open a browse brick
 
  <navigation_rule id="go-to-services" xsi:type="go-to-browse-brick">
    <!-- Mandatory, ID of the BrowseBrick to go to -->
    <id>services</id>
    <!-- Optional, must be an ID of the available browse modes of the brick -->
    <!-- <browse_mode>tree</browse_mode> -->
    <!-- Optional, a string to preset as filter in the brick. -->
    <!-- <filter>computer</filter> -->
  </navigation_rule>
Open a brick, developer method
 
  <navigation_rule id="go-to-change-overview" xsi:type="go-to-brick">
    <route>
      <id>p_aggregatepage_brick</id>
      <params>
        <param id="sBrickId">change-overview</param>
      </params>
    </route>
  </navigation_rule>
  <navigation_rule id="go-to-ongoing-tickets" xsi:type="go-to-brick">
    <route>
      <id>p_manage_brick_display_as</id>
      <params>
        <param id="sBrickId">ongoing-tickets-for-portal-user</param>
        <param id="sDisplayMode">list</param>
        <param id="sGroupingTab">resolved</param>
      </params>
    </route>
  </navigation_rule>
Open an object
 
  <navigation_rule id="go-to-object" xsi:type="go-to-object">
    <!-- Mandatory, opens the first result from the OQL. Result may vary ¯\_(ツ)_/¯  but ":this" available! -->
    <oql>SELECT Ticket WHERE id = :this->id</oql>
    <!-- Optional, mode of the object form, either view|edit -->
    <mode>view</mode>
    <!-- Optional, how to open the object form, replace the current form (current), in a modal (modal) or in the page (page) -->
    <opening_target>modal</opening_target>
  </navigation_rule>

Then from any form you can call those navigation rules

module_design@itop-portal / forms
 
<form id="ticket-apply-stimulus">
  <properties>
    <navigation_rules _delta="define">
      <submit>
        <default>go-to-resolved-requests</default>
      </submit>
      <cancel>
        <default>go-to-homepage</default>
        <modal>close-form</modal>
      </cancel>
    </navigation_rules>
  </properties>
</form>
标签:
由 superadmin 在 2020/08/27, 17:28 创建
    

需要帮助?

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

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