File: confUtils.pm

package info (click to toggle)
eccodes 2.44.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 150,248 kB
  • sloc: cpp: 163,056; ansic: 26,308; sh: 21,602; f90: 6,854; perl: 6,363; python: 5,087; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 285; xml: 183; awk: 66
file content (64 lines) | stat: -rw-r--r-- 1,587 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
package confUtils;

use strict;

#The confluence space. Can be overridden with the -c switch!! See the main script.
our $confSpace="ECC";

my $CONF=$ENV{CONF}; 
die "Env var CONF should point to confluence.sh script" if ( $CONF eq "" || ! -f "$CONF" );

#====================================================
#
# Generic functions related to confluence 
#
#====================================================

#--------------------------------
# Upload a page to confluence
#--------------------------------

sub loadToConf {
    
    my ($fHtml,$title,$parentPage) = @_;
    
    my $cmd="$CONF -a addPage --noConvert --replace --space \"$confSpace\" --title \"$title\" --parent \"$parentPage\" --file $fHtml";
    
    print "\t\tUpload to conflunce with command:\n\t$cmd\n";   
    system($cmd);
}    

#---------------------------------------
# Create link to a page
#---------------------------------------

sub linkToPage {
    
    my ($page,$label) = @_;
    
    my $str="<ac:link>
  <ri:page ri:content-title=\"".$page."\"/>
  <ac:plain-text-link-body>
    <![CDATA[".$label."]]>
  </ac:plain-text-link-body>
  </ac:link>";

   return $str;
}   

sub makeInfo {
    
    my ($text) = @_;
    
    return "<ac:structured-macro ac:name=\"info\"><ac:parameter ac:name=\"icon\">false</ac:parameter>".
              "<ac:rich-text-body>".$text."</ac:rich-text-body></ac:structured-macro>";
}    

sub makeCode {
    
    my ($text) = @_;

    return "<ac:structured-macro ac:name=\"code\"><ac:plain-text-body><![CDATA[".$text."]]></ac:plain-text-body></ac:structured-macro>";
}

1;