Revision 83b823a7
Added by Andreas Kohlbecker over 3 years ago
src/main/java/eu/etaxonomy/dataportal/DataPortalContext.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.dataportal; |
10 | 10 |
|
11 |
import java.io.File; |
|
12 |
import java.io.IOException; |
|
11 | 13 |
import java.net.URI; |
12 |
import java.util.UUID; |
|
14 |
|
|
15 |
import eu.etaxonomy.drush.DrushExecuter; |
|
13 | 16 |
|
14 | 17 |
/** |
15 | 18 |
* |
... | ... | |
18 | 21 |
*/ |
19 | 22 |
public class DataPortalContext { |
20 | 23 |
|
21 |
URI baseUri; |
|
22 |
URI cdmServerUri; |
|
23 |
UUID classificationUUID; |
|
24 |
String siteName; //TODO could be read with drush: $ drush vget site_name |
|
24 |
URI siteUri; |
|
25 |
String siteName; //TODO read with drush: $ drush vget site_name |
|
25 | 26 |
String themeName; |
26 |
private String siteLabel; |
|
27 |
File drupalRoot; |
|
28 |
String sshHost; |
|
29 |
String sshUser; |
|
27 | 30 |
|
28 |
public DataPortalContext(URI baseUri, URI cdmServerUri, UUID classificationUUID, String siteName, String siteLabel) { |
|
29 |
this.baseUri = baseUri; |
|
30 |
this.cdmServerUri = cdmServerUri; |
|
31 |
this.classificationUUID = classificationUUID; |
|
31 |
public DataPortalContext(URI siteUri, String siteName, String drupalRoot, String sshHost, String sshUser) { |
|
32 |
this.siteUri = siteUri; |
|
32 | 33 |
this.siteName = siteName; |
33 |
this.siteLabel = siteLabel; |
|
34 |
} |
|
35 |
|
|
36 |
public URI getBaseUri() { |
|
37 |
return baseUri; |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* <code>UNUSED</code> |
|
42 |
* @return |
|
43 |
*/ |
|
44 |
public URI getCdmServerUri() { |
|
45 |
return cdmServerUri; |
|
34 |
this.drupalRoot = new File(drupalRoot); |
|
35 |
this.sshHost = sshHost; |
|
36 |
this.sshUser = sshUser; |
|
46 | 37 |
} |
47 | 38 |
|
48 |
/** |
|
49 |
* <code>UNUSED</code> |
|
50 |
* @return |
|
51 |
*/ |
|
52 |
public UUID getClassificationUUID() { |
|
53 |
return classificationUUID; |
|
39 |
public URI getSiteUri() { |
|
40 |
return siteUri; |
|
54 | 41 |
} |
55 | 42 |
|
56 | 43 |
public String getSiteName() { |
57 | 44 |
return siteName; |
58 | 45 |
} |
59 | 46 |
|
60 |
public String getSiteLabel() { |
|
61 |
return siteLabel; |
|
62 |
} |
|
63 |
|
|
64 |
|
|
65 | 47 |
|
66 | 48 |
/** |
67 | 49 |
* |
... | ... | |
73 | 55 |
return pageHeader + " | " + getSiteName(); |
74 | 56 |
} |
75 | 57 |
|
58 |
public DrushExecuter drushExecuter() throws IOException, InterruptedException { |
|
59 |
DrushExecuter dex = new DrushExecuter(); |
|
60 |
dex.setDrupalRoot(drupalRoot); |
|
61 |
dex.setSiteURI(siteUri); |
|
62 |
dex.setSshHost(sshHost); |
|
63 |
dex.setSshUser(sshUser); |
|
64 |
return dex; |
|
65 |
} |
|
66 |
|
|
76 | 67 |
} |
Also available in: Unified diff
ref #9181 configuring DrushExecutor via the DataPortalTest.xml property files