Project

General

Profile

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

    
12
import java.net.URI;
13
import java.util.UUID;
14

    
15
import org.apache.log4j.Logger;
16

    
17
/**
18
 *
19
 * @author a.kohlbecker
20
 *
21
 */
22
public enum DataPortalContext {
23

    
24
	cichorieae,
25
	palmae,
26
	cyprus,
27
	floramalesiana;
28

    
29
	URI baseUri;
30
	URI cdmServerUri;
31
	UUID classificationUUID;
32
	String siteName; //TODO could be read with drush: $ drush vget site_name
33
	String themeName;
34

    
35

    
36
	public final Logger logger = Logger.getLogger(DataPortalContext.class);
37

    
38
	private DataPortalContext() {
39
		this.baseUri = TestConfiguration.getProperty(composePropertyKey("baseUri"), URI.class);
40
		this.cdmServerUri = TestConfiguration.getProperty(composePropertyKey("cdmServerUri"), URI.class);
41
		this.classificationUUID = TestConfiguration.getProperty(composePropertyKey("classificationUUID"), UUID.class);
42
		this.siteName = TestConfiguration.getProperty(composePropertyKey("siteName"));
43
	}
44

    
45
	private String composePropertyKey(String fieldName) {
46
		String key = this.getClass().getSimpleName().substring(0, 1).toLowerCase() + this.getClass().getSimpleName().substring(1) + "." + this.name() + "." + fieldName;
47
		return key;
48
	}
49

    
50
	public URI getBaseUri() {
51
		return baseUri;
52
	}
53

    
54
	public URI getCdmServerUri() {
55
		return cdmServerUri;
56
	}
57

    
58
	public UUID getClassificationUUID() {
59
		return classificationUUID;
60
	}
61

    
62
	public String getSiteName() {
63
		return siteName;
64
	}
65

    
66
}
(2-2/5)