comparison farol/templates/producttree/view.j2 @ 45:7c4d001839e7

Move the Display of the ProductTree to its own page
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 07 Oct 2014 13:01:10 +0200
parents farol/templates/document/view.j2@9b0fb5ca7eff
children e39fd204eb33
comparison
equal deleted inserted replaced
44:df5182d0787f 45:7c4d001839e7
1 {#
2 # Description:
3 # Web Template used in Farol Design
4 #
5 # Authors:
6 # BenoƮt Allard <benoit.allard@greenbone.net>
7 #
8 # Copyright:
9 # Copyright (C) 2014 Greenbone Networks GmbH
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24 -#}
25
26 {% extends "base.j2" %}
27 {% from "macros.j2" import panel, modal %}
28 {% block title %}Product Tree{% endblock %}
29
30 {% set active = 'product' %}
31
32 {% block content %}
33 <div class='page-header'>
34 <h1>Document's Product Tree<a href="#prodtree_modal" data-toggle="modal">?</a> <small>{{ producttree._products | length }} Products defined</small></h1>
35 </div>
36 {% call modal('prodtree_modal', "Product Tree") %}
37 <p>The <strong>Product Tree</strong> container contains all the fully qualified product names that can be referenced elsewhere in the document (specifically when describing the products that are affected by a vulnerability using the <strong>Product Statuses</strong>, <strong>Threats</strong>, <strong>CVSS Score Sets</strong>, and <strong>Remediation</strong> containers). The <strong>Product Tree</strong> can have as many branches as needed, but each endpoint of the tree must be terminated with a <strong>Full Product Name</strong> element, which represents a product that can be referenced elsewhere.</p>
38 <p>The <strong>Product Tree</strong> can be kept simple (flat) or made more detailed (branched out). It also supports concatenating products to describe relationships, such as components contained in a product or products installed on other products.</p>
39 <dl>
40 <dt>Flat:</dt>
41 <dd><p>In the simplest case, a flat <strong>Product TreeM</strong> would contain one or more <strong>Full Product Name</strong> elements at the root level, one for each product that needs to be described.</p></dd>
42 <dt>Branched:</dt>
43 <dd><p>In a more detailed <strong>Product Tree</strong>, the root element would contain one or more <strong>Branch</strong> elements at the root level, one for each class/type/category of product, each of which again contains one or more <strong>Branch</strong> elements until all desired categories and subcategories are described to the satisfaction of the document issuer. Then each open <strong>Branch</strong> element is terminated with the actual product item in the form of a <strong>Full Product Name</strong> element.</p></dd>
44 <dt>Concatenated:</dt>
45 <dd><p>No matter whether a flat or branched structure is chosen, you may need to be able to describe the combination of two <strong>Full Product Name</strong> elements, such as when a product is only vulnerable when installed together with another, or to describe operating system components. To do that, a <strong>Relationship</strong> element is inserted at the root of the <strong>Product Tree</strong>, with attributes establishing a link between two existing <strong>Full Product Name</strong> elements, allowing the document producer to define a combination of two products that form a new <strong>Full Product Name</strong> entry.</p></dd>
46 <dt>Grouped:</dt>
47 <dd><p>Once <strong>Full Product Name</strong> elements are defined, they may be freely added to logical groups, which may then be used to refer to a group of products. Given that it is possible for a product to be a member of more than one logical group, some areas of the CVRF document may not allow references to product groups to avoid ambiguity.</p></dd>
48 </dl>
49 {% endcall %}
50 {% call panel(heading="Branches", badge=producttree._branches | length, title=4, extended=True) %}
51 {% for branch in producttree._branches recursive %}
52 {% call panel() %}
53 <p>{{ branch._type}}: <em>{{ branch._name }}</em> (<a href="{{ url_for('producttree.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p>
54 {% if branch._product %}
55 <strong><a href="{{ url_for('producttree.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong> (<a href="{{ url_for('producttree.edit_product', productid=branch._product._productid) }}">edit</a>)
56 {% else %}
57 {{ loop(branch._childs) }}
58 {% endif %}
59 {% if branch.isOrphaned() %}
60 <p class="text-danger">This branch is <em>orphaned</em>. A <a href="{{ url_for('producttree.add_product') }}">product</a> or a new <a href="{{ url_for('producttree.add_branch') }}">branch</a> should be created as child of this one.</p>
61 {% endif %}
62 {% endcall %}
63 {% endfor %}
64 <a href="{{ url_for('producttree.add_branch') }}" class="pull-right">add branch</a>
65 {% endcall %}
66 {% call panel(heading="Products", badge=producttree.nbProducts(), title=4) %}
67 {% for product in producttree._products if product._parent is sameas producttree %}
68 <p><strong><a href="{{ url_for('producttree.view_product', productid=product._productid) }}">{{ product._name }}</a></strong> (<a href="{{ url_for('producttree.edit_product', productid=product._productid) }}">edit</a>)</p>
69 {% endfor %}
70 <a href="{{ url_for('producttree.add_product') }}" class="pull-right">add product</a>
71 {% endcall %}
72 {% call panel(heading="Relationships", badge=producttree._relationships | length, title=4) %}
73 {% for relationship in producttree._relationships %}
74 {% call panel() %}
75 <p><em>{{ cvrf.getProductForID(relationship._productreference)._name }}</em> as {{ relationship._relationtype | lower }} <em>{{ cvrf.getProductForID(relationship._relatestoproductreference)._name }}</em> (<a href="{{ url_for('producttree.edit_relationship', index=loop.index0) }}">edit</a>)</p>
76 {% if relationship._product %}<p><strong><a href="{{ url_for('producttree.view_product', productid=relationship._product._productid) }}">{{ relationship._product._name }}</a></strong> (<a href="{{ url_for('producttree.edit_product', productid=relationship._product._productid) }}">edit</a>)</p>{% endif %}
77 {% if relationship.isOrphaned() %}
78 <p class="text-danger">This relationship is <em>orphaned</em>. A product should be <a href="{{ url_for('producttree.add_product') }}">created</a> as child of this one.</p>
79 {% endif %}
80 {% endcall %}
81 {% endfor %}
82 <a href="{{ url_for('producttree.add_relationship') }}" class="pull-right">add</a>
83 {% endcall %}
84 {% call panel(heading="Groups", badge=producttree._groups | length, title=4) %}
85 {% for group in producttree._groups %}
86 {% call panel() %}
87 <a href="{{ url_for('producttree.edit_group', groupid=group._groupid) }}" class="pull-right">edit</a>
88 <ul>
89 {% for productid in group._productids %}
90 {% with product = cvrf.getProductForID(productid) %}
91 <li><a href="{{ url_for('producttree.view_product', productid=product._productid) }}">{{ product._name }}</a></li>
92 {% endwith %}
93 {% endfor %}
94 </ul>
95 {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %}
96 {% endcall %}
97 {% endfor %}
98 <a href="{{ url_for('producttree.add_group') }}" class="pull-right">add</a>
99 {% endcall %}
100 {% endblock %}

http://farol.wald.intevation.org