Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (99 sloc) 3.9 KB
% title 'Welcome';
%= form_for $self->url_for => begin
<table width='100%'><tr><td> </td><td>
%= text_field 'match'
%= submit_button 'Search'
</td><td> </td></tr></table>
% end
<!--a href= <= $self->url_for('assets/smart2.xls') > >smart</a-->
% if (param('match')) {
% (my $match=param('match'))=~s/(.*)/\U$1/g;
% my $em_rs = $self->app->schema->resultset('EntityMaster')->search(
% {max_version => 1});
% my (%ent,%itm,%bus_rule);
% while (my $em=$em_rs->next) {
% my $rs = $self->app->schema->resultset('StmListVw')->search(
% \[ q{ em_nm=? AND (upper(tgt_ent_nm) like ?
% OR upper(src_ent_nm) like ?
% OR upper(src_itm_nm) like ?
% OR upper(tgt_itm_nm) like ?
% OR upper(bus_rule) like ?) },
% [ 'em_nm', $em->ds_name ],
% [ 'tgt_ent_nm', '%' . $match . '%' ],
% [ 'src_ent_nm', '%' . $match . '%' ],
% [ 'src_itm_nm', '%' . $match . '%' ],
% [ 'tgt_itm_nm', '%' . $match . '%' ],
% [ 'bus_rule', '%' . $match . '%' ],
% ],
% { columns => [qw(tgt_ent_nm src_ent_nm
% tgt_itm_nm bus_rule src_itm_nm tgt_ent_type src_ent_type)],
% distinct => 1});
% while (my $row = $rs->next) {
% if ($row->tgt_ent_nm =~/$match/i) {
% $ent{$em->ds_name}{$row->tgt_ent_nm}{tgt}=1;
% $ent{$em->ds_name}{$row->tgt_ent_nm}{type}=$row->tgt_ent_type;
% if ($row->src_ent_nm) {
% $ent{$em->ds_name}{$row->tgt_ent_nm}{realtgt}=1;
% }
% }
% if ($row->tgt_itm_nm =~/$match/i) {
% $itm{$em->ds_name}{$row->tgt_itm_nm}{$row->tgt_ent_nm}{tgt}=1;
% }
% if ($row->src_itm_nm =~/$match/i) {
% $itm{$em->ds_name}{$row->src_itm_nm}{$row->src_ent_nm}{src}=1;
% }
%# if ($row->bus_rule =~/$match/ims) {
%# $itm{$em->name}{$row->bus_rule}
%# {$row->tgt_ent_nm}{$row->tgt_itm_nm}=1;
%# }
% if ($row->src_ent_nm && $row->src_ent_nm =~/$match/i) {
% $ent{$em->ds_name}{$row->src_ent_nm}{src}=1;
% $ent{$em->ds_name}{$row->src_ent_nm}{type}=$row->src_ent_type;
% }
% }
% }
<H3>Entities</H3>
% for my $em_nm (sort keys %ent) {
<H3><a href=<%== url_for('/emdet?em=' . $em_nm) %> ><%= $em_nm %>
</a></H3> <table><tr>
<th class="th" FILTER=ALL align=left> Entity </th>
<th class="th" FILTER=ALL align=left> Type </th>
<th class="th" FILTER=ALL align=left> </th>
<th class="th" FILTER=ALL align=left> </th>
<th class="th" FILTER=ALL align=left> </th></tr>
% for my $ent_nm (sort keys %{$ent{$em_nm}}){
<tr><td><%= $ent_nm %></td>
<td><%= $ent{$em_nm}{$ent_nm}{type} %></td>
<td><%== $ent{$em_nm}{$ent_nm}{tgt} && $ent{$em_nm}{$ent_nm}{realtgt}
? '<a href=' . url_for('/stmlist?em='
. $em_nm . '&tgt=' . $ent_nm) . '>Target</a>' : '' %></td>
<td><%== $ent{$em_nm}{$ent_nm}{src} ? '<a href=' . url_for('/stmlist?em='
. $em_nm . '&src=' . $ent_nm) . '>Source</a>' : '' %></td>
<td><a href= <%== url_for('/entdet?em=' . $em_nm . '&ent=' . $ent_nm) %> >
Attributes</a></td></tr>
% }
</table>
% }
<H3>Items</H3>
% for my $em_nm (sort keys %itm) {
<H3><a href=<%== url_for('/emdet?em=' . $em_nm) %> ><%= $em_nm %>
</a></H3> <table><tr>
<th class="th" FILTER=ALL align=left> Item </th>
<th class="th" FILTER=ALL align=left> Entity </th>
<th class="th" FILTER=ALL align=left> </th>
<th class="th" FILTER=ALL align=left> </th></tr>
% for my $itm_nm (sort keys %{$itm{$em_nm}}){
% for my $ent_nm (sort keys %{$itm{$em_nm}{$itm_nm}}){
% my $itm_att=$itm{$em_nm}{$itm_nm}{$ent_nm};
<tr><td><%= $itm_nm %></td><td><%= $ent_nm %></td>
<td><%== exists $itm_att->{tgt} ? '<a href=' . url_for('/stmlist?em='
. $em_nm . '&tgt=' . $ent_nm) . '>Target</a>' : '' %></td>
<td><%== exists $itm_att->{src} ? '<a href=' . url_for('/stmlist?em='
. $em_nm . '&src=' . $ent_nm) . '>Source</a>' : '' %></td>
</tr>
% }
% }
</table>
% }
% }
<br>
Something went wrong with that request. Please try again.