Subversion Repositories gelsvn

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 bj 1
package HTMLWorkspaceCreator;
2
 
3
# ************************************************************
4
# Description   : An html workspace creator
5
# Author        : Justin Michel
6
# Create Date   : 8/25/2003
7
# ************************************************************
8
 
9
# ************************************************************
10
# Pragmas
11
# ************************************************************
12
 
13
use strict;
14
 
15
use HTMLProjectCreator;
16
use WorkspaceCreator;
17
 
18
use vars qw(@ISA);
19
@ISA = qw(WorkspaceCreator);
20
 
21
# ************************************************************
22
# Subroutine Section
23
# ************************************************************
24
 
25
sub workspace_file_name {
26
  my($self) = shift;
27
  return $self->get_modified_workspace_name($self->get_workspace_name(),
28
                                            '_workspace.html');
29
}
30
 
31
 
32
sub pre_workspace {
33
  my($self) = shift;
34
  my($fh)   = shift;
35
  my($crlf) = $self->crlf();
36
 
217 bj 37
  print $fh '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', $crlf,
38
            '<html>', $crlf,
107 bj 39
            '<!-- $Id: HTMLWorkspaceCreator.pm 217 2006-05-05 09:35:48Z bj $ -->', $crlf,
40
            '<!-- MPC Command: -->', $crlf,
41
            "<!-- $0@ARGV -->", $crlf,
42
            '<head>', $crlf,
217 bj 43
            '<title>', $self->get_workspace_name(), '</title>', $crlf,
44
            '  <style type="text/css">', $crlf,
107 bj 45
            '    a {font: 12pt bold verdana, lucida; color: white; padding: 3px;}', $crlf,
46
            '    td {font: 12pt bold verdana, lucida; color: white; padding: 3px; background-color: cadetblue;}', $crlf,
47
            '    thead tr td {font: 18pt "trebuchet ms", helvetica; color: white; padding: 3px; background-color: teal;}', $crlf,
48
            '  </style>', $crlf,
49
            '</head>', $crlf,
50
            '<body>', $crlf;
51
}
52
 
53
 
54
sub write_comps {
55
  my($self)         = shift;
56
  my($fh)           = shift;
57
  my($creator)      = shift;
58
  my($project_info) = $self->get_project_info();
59
  my($crlf)         = $self->crlf();
60
 
217 bj 61
  print $fh "<table style=\"table-layout:fixed\" width=\"400\" " .
62
            "summary=\"MPC Projects\">$crlf" .
107 bj 63
            "<col style=\"background-color: darkcyan;\">$crlf" .
64
            "<thead>$crlf" .
217 bj 65
            "<tr><td>Projects In Build Order</td></tr>$crlf" .
107 bj 66
            "</thead>$crlf" .
67
            "<tbody>$crlf";
68
 
217 bj 69
  ## Sort the projects in build order instead of alphabetical order
70
  foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
107 bj 71
    my($name) = $$project_info{$project}->[0];
72
    print $fh "<tr><td>" .
73
              "<a href='$project'>$name</a>" .
74
              "</td></tr>$crlf";
75
  }
76
 
77
  print $fh "</tbody></table>";
78
}
79
 
80
 
81
sub post_workspace {
82
  my($self) = shift;
83
  my($fh)   = shift;
84
  print $fh "</body></html>" . $self->crlf();
85
}
86
 
87
 
88
1;