Merge pull request #228 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / HTMLWorkspaceCreator.pm
blobce743e2facfe7197a35747a6126d692d50179dfd
1 package HTMLWorkspaceCreator;
3 # ************************************************************
4 # Description : An html workspace creator
5 # Author : Justin Michel
6 # Create Date : 8/25/2003
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use HTMLProjectCreator;
16 use WorkspaceCreator;
18 use vars qw(@ISA);
19 @ISA = qw(WorkspaceCreator);
21 # ************************************************************
22 # Subroutine Section
23 # ************************************************************
25 sub workspace_file_extension {
26 #my $self = shift;
27 return '_workspace.html';
31 sub pre_workspace {
32 my($self, $fh) = @_;
33 my $crlf = $self->crlf();
35 ## Print the header
36 print $fh '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', $crlf,
37 '<html>', $crlf;
39 ## Next, goes the workspace comment
40 $self->print_workspace_comment($fh,
41 '<!-- MPC Command: -->', $crlf,
42 '<!-- ', $self->create_command_line_string($0, @ARGV),' -->', $crlf);
44 ## Then, comes the title and the CSS settings.
45 print $fh '<head>', $crlf,
46 '<title>', $self->get_workspace_name(), '</title>', $crlf,
47 ' <style type="text/css">', $crlf,
48 ' a {font: 12pt bold verdana, lucida; color: white; padding: 3px;}', $crlf,
49 ' td {font: 12pt bold verdana, lucida; color: white; padding: 3px; background-color: cadetblue;}', $crlf,
50 ' thead tr td {font: 18pt "trebuchet ms", helvetica; color: white; padding: 3px; background-color: teal;}', $crlf,
51 ' </style>', $crlf,
52 '</head>', $crlf,
53 '<body>', $crlf;
57 sub write_comps {
58 my($self, $fh, $creator) = @_;
59 my $crlf = $self->crlf();
61 ## Start the table for all of the projects
62 print $fh "<table style=\"table-layout:fixed\" width=\"400\" ",
63 "summary=\"MPC Projects\">$crlf",
64 "<col style=\"background-color: darkcyan;\">$crlf",
65 "<thead>$crlf",
66 "<tr><td>Projects In Build Order</td></tr>$crlf",
67 "</thead>$crlf",
68 "<tbody>$crlf";
70 ## Sort the projects in build order instead of alphabetical order
71 my $project_info = $self->get_project_info();
72 foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
73 print $fh "<tr><td><a href='$project'>",
74 $$project_info{$project}->[ProjectCreator::PROJECT_NAME],
75 "</a></td></tr>$crlf";
78 ## End the table
79 print $fh "</tbody></table>";
83 sub post_workspace {
84 my($self, $fh) = @_;
85 print $fh "</body></html>" . $self->crlf();