NAME

App::Requirement::Arch::HTML::Flat - Generate a "flat" HTML document from a requirement structure

SYNOPSIS

use App::Requirements::Arch::HTML::Flat ;
use App::Requirements::Arch::Filter ;

my ($requirements_structure, $requirements, $categories) 
	= load_and_filter_requirements( ...) ;

keep_abstraction_level_requirements($requirements, @keep_abstraction_level) ;

my $html_document = generate_flat_html_document($requirements, $title, $header, $comment) ;

DESCRIPTION

This module provides functionality to generate a 'flat' (as opossed to the hierarchical structure used when developing requirements) HTML requirements document to be read by users not part of the requirements development.

SUBROUTINES/METHODS

Generate a 'flat' HTML requirements document. After transforming the requirements structure to a flat structure. Useful for reviews with reviwers that are not used to structured hierarchical requirement visualisation.

Arguments

  • \%requirements - A reference to the requirements stucture to process.

  • $title - The title of the generated HTML document.

  • $header - header to put in generated HTML document below the title.

  • $comment - Comment to add to the source of the generated HTML document. Will not be visible in a browser.

Returns

    item * $html_page - A HTML page.

generate_html($flat_document_structure, \%requirements, $title, $header, $comment)

Generate a 'flat' HTML requirements document.

Arguments

  • %flat_document_structure - A reference to a structure to be used to generate the HTML document

  • \%requirements - A reference to a hash containing requirements

  • $title - The title of the generated HTML document

  • $header - A string which will be inserted as-is in the HTML document, under the title

  • $comment - A string that is inserted as a comment

Returns

  • $html - A string containing the HTML document

transformt_text_to_html($string_to_htmlize)

Transform text elements to their HTML equivalent

Arguments

  • $string_to_htmlize

Returns

  • $html - transformed text

extract_from_flat_requirements(\%flat_document_structure, \%$requirements, \@levels, \&process_category, \&process_requirement)

Walks the flat requirement structur structure, for each category, and calls the passed subs

Arguments

  • \%flat_document_structure - The flat document strucure generated by 'generate_flat_document_structure'.

  • \%requirements - The actual requirements. Needed as the flat requirements structure only reference data in this structure.

  • \&process_category - A sub called on each category

  • \&process_requirement- A sub called on each requirement within the category

Returns

  • A text string containing all generated data.

process_requirements(\%requirements, \&process_requirements, $header_level, $parent_path)

Walks the requirements structure and apply a sub to each requirement

Arguments

  • \%requirements - The requirements.

  • \&process_requirements - Reference to a sub that will be applied to each requirements.

  • $header_level - The header level to use.

  • $parent_path - The path to the current requirement

Return

  • A text string containing all generated data.

generate_categories_links($header_level, $category, $index)

Arguments

  • $header_level - The level of the category

  • $category, - The name of the category

  • $index - uniq index for the category

Returns

  • A string containing a HTML link for the category

generate_categories_html($header_level, $category, $index)

Generates HTML for a category.

Arguments

  • $header_level - The level of the category

  • $category, - The name of the category

  • $index - uniq index for the category

Returns

  • A string containing a HTML representation for the category

index_generation(\%requirements, $requirement_name, $header_level, $parent_path, $current_id)

This function will be called once per requirement, and subrequirements, to generate anHTML link.

Arguments

  • \%requirements - The requirements structre.

  • $requirement_name - The name of the requirement.

  • $header_level - The level of the requirement.

  • $parent_path - A string reprecenting the path to the requirement.

  • $current_id - The id of the current requirement.

Returns

  • A string containing a HTML link for the category

generate_requirement_html(\%requirements, $requirement_name, $header_level, $parent_path, $current_id)

This function is called for each requirement, and subrequirements, to generate a HTML representation of the requirement.

Arguments

  • \%requirements - The requirements structre.

  • $requirement_name - The name of the requirement.

  • $header_level - The header level.

  • $parent_path - A string reprecenting the path to the requirement.

  • $current_id - The id of the current requirement.

Returns

  • A string containing a HTML representation for the requirement.

TO DO

Tags over <h6>, this would be a problem if we generate the whole requirement structure as we have more than 6 level of requirement breakdown.

SEE ALSO

AUTHOR

Khemir Nadim ibn Hamouda.
Ian Kumlien

1 POD Error

The following errors were encountered while parsing the POD:

Around line 370:

You forgot a '=back' before '=head2'