Project

General

Profile

Download (1.5 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

    
13
/**
14
 * 
15
 * @author a.kohlbecker
16
 * 
17
 */
18
public class DataPortalManager {
19

    
20
	private static final String SYSTEM_PROPERTY_NAME_DATA_PORTAL_CONTEXT = "dataPortalContext";
21

    
22
	static DataPortalManager managerInstance = null;
23

    
24
	private DataPortalContext currentDataPortalContext = null;
25
	
26
	private DataPortalManager(){
27
		try {
28
			currentDataPortalContext = DataPortalContext.valueOf(System.getProperty(SYSTEM_PROPERTY_NAME_DATA_PORTAL_CONTEXT));
29
		} catch (NullPointerException e) {
30
			SystemUtils.reportInvalidSystemProperty(SYSTEM_PROPERTY_NAME_DATA_PORTAL_CONTEXT, e);
31
		} catch (IllegalArgumentException e) {
32
			SystemUtils.reportInvalidSystemProperty(SYSTEM_PROPERTY_NAME_DATA_PORTAL_CONTEXT, e);
33
		}
34
	}
35

    
36
	public static void prepare() {
37
		if (managerInstance == null) {
38
			managerInstance = new DataPortalManager();
39
			managerInstance.setupDataPortal();
40
		}
41
	}
42

    
43
	public static DataPortalContext currentDataPortalContext() {
44
		prepare();
45
		return managerInstance.currentDataPortalContext;
46
	}
47

    
48
	private void setupDataPortal() {
49
		// TODO configure the data portal using drush, see http://dev.e-taxonomy.eu/svn/trunk/drupal/modules/cdm_dataportal/jenkins-ci/integration.sh
50
	}
51

    
52
}
(4-4/5)