Project

General

Profile

Download (1.72 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2009 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9
package eu.etaxonomy.dataportal;
10

    
11
import java.net.URI;
12

    
13
import org.apache.log4j.Logger;
14

    
15
/**
16
 *
17
 * @author a.kohlbecker
18
 *
19
 */
20
public enum DataPortalSite {
21

    
22
    cichorieae,
23
    palmae,
24
    cyprus,
25
    floramalesiana,
26
    reference;
27

    
28
    DataPortalContext context;
29

    
30
    public final Logger logger = Logger.getLogger(DataPortalSite.class);
31

    
32
    private DataPortalSite() {
33

    
34
        try {
35

    
36
            URI siteUri = TestConfiguration.getProperty(composePropertyKey("siteUri"), URI.class, true);
37
            String siteName = TestConfiguration.getProperty(composePropertyKey("siteName"), true);
38
            String drupalRoot = TestConfiguration.getProperty(composePropertyKey("drupalRoot"), true);
39
            String sshHost = TestConfiguration.getProperty(composePropertyKey("sshHost"));
40
            String sshUser = TestConfiguration.getProperty(composePropertyKey("sshUser"));
41
            context = new DataPortalContext(siteUri, siteName, drupalRoot, sshHost, sshUser);
42
        } catch (TestConfigurationException e) {
43
            logger.error("Configuration Error: ", e);
44
            System.exit(-1);
45
        }
46
    }
47

    
48
    private String composePropertyKey(String fieldName) {
49
        String key = DataPortalContext.class.getSimpleName().substring(0, 1).toLowerCase() + DataPortalContext.class.getSimpleName().substring(1) + "." + this.name() + "." + fieldName;
50
        return key;
51
    }
52

    
53
    /**
54
     * @return
55
     */
56
    public DataPortalContext getContext() {
57
        return context;
58
    }
59

    
60
}
(6-6/14)