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