Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6914 dpurdie 1
package com.erggroup.buildtool.smtp;
2
 
3
/**
4
 * This package provides utility functions to assist in the creation of URLs into 
5
 * the Release Manager Web Server
6
 * These are used in emails to assist the user in navigating to a Package or Release
7
 */
8
public class CreateUrls
9
{
10
    /**
11
     * 
12
     * @return Return the Base http reference to the Release Manager Web Server
13
     *         If one cannot be found create a dummy one.
14
     */
15
    public static String getRmBaseUrl()
16
    {
17
        String rmRef = System.getenv("GBE_RM_URL");
18
        if (rmRef == null) {
19
            rmRef = "http://GBE_RM_URL";
20
        }
21
        return rmRef;
22
    }
23
 
24
 
25
    /**
26
     * Create a URL to a Release Manager Web entry for a given Release and optioanl package
27
     * 
28
     * @param rtag_id Identify the Release via numeric tag
29
     * @param pv_id   Identify the package by pv_id - May be null
30
     * 
31
     * @return A URL to the package within Release Manager (Web Server)
32
     */
33
 
34
    public static String generateRmUrl(String rtag_id, String pv_id)
35
    {
36
        //  Create a Release Manager Reference
37
        String rmRef = getRmBaseUrl();
38
 
39
        rmRef += "/fixed_issues.asp?"
40
              + "rtag_id=" + rtag_id;
41
        if (pv_id != null )
42
        {
43
              rmRef += "&pv_id=" + pv_id; 
44
        }
45
 
46
        return rmRef;
47
    }
48
 
49
    /**
50
     * @param rtag_id
51
     * @param pv_id
52
     * @return A URL to the package within Release Manager (Web Server)
53
     */
54
    public static String generateRmUrl(int rtag_id, int pv_id)
55
    {
56
        return generateRmUrl(String.valueOf(rtag_id), String.valueOf(pv_id)); 
57
    }
58
 
59
 
60
    /**
61
     * @param rtag_id Identify the Release via numeric tag
62
     * 
63
     * @return  A URL to a Release entry within Release Manager (Web Server)
64
     */
65
    public static String generateReleaseUrl(int rtag_id)
66
    {
67
        return getRmBaseUrl() + "/dependencies.asp?rtag_id=" + rtag_id;
68
    }
69
 
70
    /**
71
     * 
72
     * @return Create an http ref to the error logfile
73
     */
74
    public static String generateUncBaseUrl()
75
    {
76
        String unc = System.getenv("GBE_UNC");
77
        if ( unc == null )
78
        {
79
            // Should not happen
80
            // GBE_UNC is checked in BuildDaemon at startup
81
            unc = "http://GBE_UNC";
82
        }
83
        return unc;
84
    }
85
}