|
@@ -1,12 +1,9 @@ |
1 |
1 |
|
package org.litesoft.initfrom.server; |
2 |
2 |
|
|
3 |
|
- |
import org.litesoft.commonfoundation.base.*; |
4 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
5 |
|
- |
|
6 |
|
- |
import java.util.*; |
7 |
|
- |
|
8 |
3 |
|
import org.litesoft.GWT.server.*; |
9 |
4 |
|
import org.litesoft.bo.views.communication.*; |
|
5 |
+ |
import org.litesoft.commonfoundation.base.*; |
|
6 |
+ |
import org.litesoft.commonfoundation.typeutils.*; |
10 |
7 |
|
import org.litesoft.configuration.*; |
11 |
8 |
|
import org.litesoft.core.util.*; |
12 |
9 |
|
import org.litesoft.logger.nonpublic.*; |
|
@@ -15,35 +12,32 @@ |
15 |
12 |
|
import org.litesoft.orsup.base.*; |
16 |
13 |
|
import org.litesoft.sql.*; |
17 |
14 |
|
|
18 |
|
- |
public class InitFrom_Servlet extends AbstractVoServerApp |
19 |
|
- |
{ |
|
15 |
+ |
import java.util.*; |
|
16 |
+ |
|
|
17 |
+ |
public class InitFrom_Servlet extends AbstractVoServerApp { |
20 |
18 |
|
private static final InitFrom_MetaDataRegistry REGISTRY = InitFrom_MetaDataRegistry.INSTANCE; |
21 |
19 |
|
|
22 |
20 |
|
@Override |
23 |
|
- |
protected String getApplicationVersion() |
24 |
|
- |
{ |
|
21 |
+ |
protected String getApplicationVersion() { |
25 |
22 |
|
return "0.90"; |
26 |
23 |
|
} |
27 |
24 |
|
|
28 |
25 |
|
// Called 1st |
29 |
26 |
|
@Override |
30 |
|
- |
protected LoggerLevel instantiateConfiguration() |
31 |
|
- |
{ |
|
27 |
+ |
protected LoggerLevel instantiateConfiguration() { |
32 |
28 |
|
new ServerConfiguration( new InitFrom_ServerConfiguration() ); // force creation & self registration of Configuration |
33 |
29 |
|
return new ConfigurationLoggerLevel(); |
34 |
30 |
|
} |
35 |
31 |
|
|
36 |
32 |
|
// Called 2nd |
37 |
33 |
|
@Override |
38 |
|
- |
protected void startUpApplication() |
39 |
|
- |
{ |
|
34 |
+ |
protected void startUpApplication() { |
40 |
35 |
|
// register( new MedicationTrackingReportServerFactory() ); |
41 |
36 |
|
|
42 |
37 |
|
DataStore zMasterDataStore = new DataStoreBaseSQL( REGISTRY ); |
43 |
38 |
|
DataStoreLocator.initialize( zMasterDataStore ); |
44 |
39 |
|
|
45 |
|
- |
if ( Configuration.getBoolean( "populateDatabase", false ) ) |
46 |
|
- |
{ |
|
40 |
+ |
if ( Configuration.getBoolean( "populateDatabase", false ) ) { |
47 |
41 |
|
zMasterDataStore.dropAllTables(); |
48 |
42 |
|
zMasterDataStore.createAllTables(); |
49 |
43 |
|
DataLoader.INSTANCE.loadData(); |
|
@@ -52,13 +46,11 @@ |
52 |
46 |
|
} |
53 |
47 |
|
|
54 |
48 |
|
@Override |
55 |
|
- |
public AppInitializationResult initialize() |
56 |
|
- |
{ |
|
49 |
+ |
public AppInitializationResult initialize() { |
57 |
50 |
|
return new AppInitializationResult( getApplicationVersion(), Configuration.getCompleteConfigMap() ); |
58 |
51 |
|
} |
59 |
52 |
|
|
60 |
|
- |
public InitFrom_Servlet() |
61 |
|
- |
{ |
|
53 |
+ |
public InitFrom_Servlet() { |
62 |
54 |
|
super( "InitFrom", null, REGISTRY ); |
63 |
55 |
|
} |
64 |
56 |
|
|
|
@@ -69,11 +61,9 @@ |
69 |
61 |
|
private Map<String, String> mIdentifierToMessages = Maps.createHashMap( IDENTIFIER_MESSAGES ); |
70 |
62 |
|
|
71 |
63 |
|
@Override |
72 |
|
- |
protected String resolve( String pIdentifier, String[] pParams ) |
73 |
|
- |
{ |
|
64 |
+ |
protected String resolve( String pIdentifier, String[] pParams ) { |
74 |
65 |
|
String zResolved = mIdentifierToMessages.get( pIdentifier ); |
75 |
|
- |
if ( zResolved == null ) |
76 |
|
- |
{ |
|
66 |
+ |
if ( zResolved == null ) { |
77 |
67 |
|
zResolved = DeCamelizer.resolve( pIdentifier ); |
78 |
68 |
|
} |
79 |
69 |
|
return ExternalizationHelper.injectParameters( zResolved, (Object[]) pParams ); |