File: Html.pm

package info (click to toggle)
libur-perl 0.470%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,184 kB
  • sloc: perl: 61,813; javascript: 255; xml: 108; sh: 13; makefile: 9
file content (81 lines) | stat: -rw-r--r-- 1,494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package UR::Object::View::Default::Html;

use strict;
use warnings;
require UR;
our $VERSION = "0.47"; # UR $VERSION;
use IO::File;

class UR::Object::View::Default::Html {
    is => 'UR::Object::View::Default::Xsl',
    has => {
        output_format => { value => 'html' },
        transform => { value => 1 },
        toolkit => { value => 'html' },
    }
};

1;

=pod

=head1 NAME

UR::Object::View::Default::Html - represent object state in HTML format 

=head1 SYNOPSIS

  #####
  
  package Acme::Product::View::OrderStatus::Html;

  class Acme::Product::View::OrderStatus::Html {
    is => 'UR::Object::View::Default::Html',
  };

  sub _generate_content {
    my $self = shift;
    my $subject = $self->subject;
    my $html = ...
    ....
    return $html;
  }

  #####

  $o = Acme::Product->get(1234);

  $v = $o->create_view(
      perspective => 'order status',
      toolkit => 'html',
      aspects => [
        'id',
        'name',
        'qty_on_hand',
        'outstanding_orders' => [   
          'id',
          'status',
          'customer' => [
            'id',
            'name',
          ]
        ],
      ],
  );

  $html1 = $v->content;

  $o->qty_on_hand(200);
  
  $html2 = $v->content;

=head1 DESCRIPTION

This class implements basic HTML views of objects.  It has standard behavior for all text views.

=head1 SEE ALSO

UR::Object::View::Default::Text, UR::Object::View, UR::Object::View::Toolkit::XML, UR::Object::View::Toolkit::Text, UR::Object

=cut