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