Commit ded0f061 authored by Leo Gordon's avatar Leo Gordon
Browse files

unified url() & display_name() interface for all kinds of dataflow targets

parent ba3ad73f
......@@ -60,15 +60,19 @@ sub signature_template {
sub url {
my $self = shift @_;
my $ref_dba = shift @_; # if reference dba is the same as 'our' dba, a shorter url can be generated
if(my $adaptor = $self->adaptor) {
my $dbc_prefix = ($adaptor->db == $ref_dba) ? ':///' : $adaptor->db->dbc->url();
return $dbc_prefix .'/accu?'.$self->struct_name(). '=' . $self->signature_template();
} else {
return;
}
my ($self, $ref_dba) = @_; # if reference dba is the same as 'my' dba, a shorter url is generated
my $my_dba = $self->adaptor && $self->adaptor->db;
return ( ($my_dba and $my_dba ne ($ref_dba//'') ) ? $my_dba->dbc->url : ':///' )
. '/accu?' . $self->struct_name . '=' . $self->signature_template;
}
sub display_name {
my ($self, $ref_dba) = @_; # if reference dba is the same as 'my' dba, a shorter display_name is generated
my $my_dba = $self->adaptor && $self->adaptor->db;
return ( ($my_dba and $my_dba ne ($ref_dba//'') ) ? $my_dba->dbc->dbname.'/' : '') . $self->struct_name . $self->signature_template;
}
......
......@@ -156,18 +156,18 @@ sub get_compiled_module_name {
=cut
sub url {
my ($self, $ref_dba) = @_; # if reference dba is the same as 'our' dba, a shorter url is generated
my ($self, $ref_dba) = @_; # if reference dba is the same as 'my' dba, a shorter url is generated
my $adaptor = $self->adaptor;
return ( ($adaptor and $adaptor->db ne ($ref_dba//'') ) ? $adaptor->db->dbc->url . '/analysis?logic_name=' : '') . $self->logic_name;
my $my_dba = $self->adaptor && $self->adaptor->db;
return ( ($my_dba and $my_dba ne ($ref_dba//'') ) ? $my_dba->dbc->url . '/analysis?logic_name=' : '') . $self->logic_name;
}
sub display_name {
my ($self, $ref_dba) = @_; # if reference dba is the same as 'our' dba, a shorter display_name is generated
my ($self, $ref_dba) = @_; # if reference dba is the same as 'my' dba, a shorter display_name is generated
my $adaptor = $self->adaptor;
return ( ($adaptor and $adaptor->db ne ($ref_dba//'') ) ? $adaptor->db->dbc->dbname . '/' : '' ) . $self->logic_name;
my $my_dba = $self->adaptor && $self->adaptor->db;
return ( ($my_dba and $my_dba ne ($ref_dba//'') ) ? $my_dba->dbc->dbname . '/' : '' ) . $self->logic_name;
}
......
......@@ -58,19 +58,19 @@ sub insertion_method {
sub url {
my ($self, $ref_dba) = @_; # if reference dba is the same as 'our' dba, a shorter url is generated
my ($self, $ref_dba) = @_; # if reference dba is the same as 'my' dba, a shorter url is generated
my $adaptor = $self->adaptor;
return ( ($adaptor and $adaptor->db ne ($ref_dba//'') ) ? $adaptor->db->dbc->url : ':///' )
my $my_dba = $self->adaptor && $self->adaptor->db;
return ( ($my_dba and $my_dba ne ($ref_dba//'') ) ? $my_dba->dbc->url : ':///' )
. '/' . $self->table_name . '?insertion_method=' . $self->insertion_method;
}
sub display_name {
my ($self, $ref_dba) = @_; # if reference dba is the same as 'our' dba, a shorter display_name is generated
my ($self, $ref_dba) = @_; # if reference dba is the same as 'my' dba, a shorter display_name is generated
my $adaptor = $self->adaptor;
return ( ($adaptor and $adaptor->db ne ($ref_dba//'') ) ? $adaptor->db->dbc->dbname.'/' : '') . $self->table_name;
my $my_dba = $self->adaptor && $self->adaptor->db;
return ( ($my_dba and $my_dba ne ($ref_dba//'') ) ? $my_dba->dbc->dbname.'/' : '') . $self->table_name;
}
......
......@@ -528,7 +528,7 @@ sub _add_dataflow_rules {
$graph->add_edge( $from_node_name => $target_node_name,
color => $accu_colour,
style => 'dashed',
label => $target_object->struct_name().'#'.$branch_code,
label => '#'.$branch_code."\n".$target_object->display_name( $self->hive_dba ),
fontname => $df_edge_fontname,
fontcolor => $accu_colour,
dir => 'both',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment