Skip to content

Commit 6191208

Browse files
Latest qa-parent and Config
1 parent 8d4724d commit 6191208

File tree

18 files changed

+111
-39
lines changed

18 files changed

+111
-39
lines changed

Diff for: app-bom/src/main/resources/bordertech-app.properties

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
## Environment
2-
bordertech.config.environment=MOCK
2+
bordertech.config.environment=${BT_APP_ENV}
3+
## Default to MOCK (Usually CORE implementation)
4+
BT_APP_ENV=MOCK
5+
6+
bordertech.config.parameters.useSystemProperties=true
7+
bordertech.config.parameters.useEnvProperties=true

Diff for: app-lde/example_local_app.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
##bordertech.lde.port.default=8082
33

44
## MOCK Environment
5-
##bordertech.config.environment=MOCK
5+
##BT_APP_ENV=MOCK
66

Diff for: app-lde/src/main/java/com/sample/app/server/lde/DemoLauncherProxy.java

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
@SuppressWarnings("HideUtilityClassConstructor")
99
public final class DemoLauncherProxy {
1010

11+
/**
12+
* Launch LDE Server.
13+
*
14+
* @param args the main arguments
15+
*/
1116
public static void main(final String[] args) {
1217
LdeLauncher.launchServer();
1318
}

Diff for: app-lde/src/main/resources/bordertech-app.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
bordertech.lde.port.default=8082
33

44
## MOCK Environment
5-
bordertech.config.environment=MOCK
5+
BT_APP_ENV=MOCK
66

77
## TODO Fix CONFIG to dump parameters
88
bordertech.config.parameters.dump.console=true

Diff for: pom.xml

+3-16
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@
55
<parent>
66
<groupId>com.github.bordertech.common</groupId>
77
<artifactId>qa-parent</artifactId>
8-
<version>1.0.15</version>
8+
<version>1.0.16</version>
99
</parent>
1010

1111
<packaging>pom</packaging>
1212

1313
<properties>
1414
<bt.qa.skip>false</bt.qa.skip>
15-
<!-- OWASP -->
16-
<dependency-check.skip>true</dependency-check.skip>
1715
<!-- Report Vulnerabilities. -->
1816
<failBuildOnCVSS>11</failBuildOnCVSS>
1917
<!-- Update every 168 hours (7 days) -->
2018
<cveValidForHours>168</cveValidForHours>
21-
<!-- Enforcer -->
22-
<enforcer.skip>false</enforcer.skip>
2319
</properties>
2420

2521
<name>sample-app-parent</name>
@@ -29,16 +25,7 @@
2925
<version>0.0.1-SNAPSHOT</version>
3026

3127
<profiles>
32-
<!-- Quick build profile with testing and QA turned off -->
33-
<profile>
34-
<id>quick-build</id>
35-
<properties>
36-
<skipTests>true</skipTests>
37-
<bt.qa.skip>true</bt.qa.skip>
38-
<dependency-check.skip>true</dependency-check.skip>
39-
<enforcer.skip>true</enforcer.skip>
40-
</properties>
41-
</profile>
28+
<!-- Run smoke tests -->
4229
<profile>
4330
<id>smoke</id>
4431
<properties>
@@ -211,7 +198,7 @@
211198
<dependency>
212199
<groupId>com.github.bordertech.config</groupId>
213200
<artifactId>config</artifactId>
214-
<version>1.0.5</version>
201+
<version>1.0.6</version>
215202
</dependency>
216203

217204
<!-- Jersey Client REST Implementation -->

Diff for: rest-client-model-impl/src/main/java/com/sample/app/rest/client/v1/helper/DefaultApi.java

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*/
88
public class DefaultApi extends ClientServicesApi {
99

10+
/**
11+
* Default constructor.
12+
*/
1013
public DefaultApi() {
1114
super(new DefaultApiClient());
1215
}

Diff for: rest-server-impl/src/main/java/com/sample/app/rest/server/v1/ClientServicesResourceImpl.java

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class ClientServicesResourceImpl implements ClientServicesResource {
3030

3131
private final ClientServices backing = Didums.getService(ClientServices.class);
3232

33+
@Override
3334
public RetrieveTablesResponse retrieveTables()
3435
throws RestBusinessException {
3536
try {
@@ -40,6 +41,7 @@ public RetrieveTablesResponse retrieveTables()
4041
}
4142
}
4243

44+
@Override
4345
public RetrieveCodesResponse retrieveCodes(final String table)
4446
throws RestBusinessException {
4547
try {
@@ -50,6 +52,7 @@ public RetrieveCodesResponse retrieveCodes(final String table)
5052
}
5153
}
5254

55+
@Override
5356
public SearchClientsResponse searchClients(final String search)
5457
throws RestBusinessException {
5558
try {
@@ -60,6 +63,7 @@ public SearchClientsResponse searchClients(final String search)
6063
}
6164
}
6265

66+
@Override
6367
public ClientDetailResponse retrieveClient(final String clientId)
6468
throws RestBusinessException {
6569
try {
@@ -70,6 +74,7 @@ public ClientDetailResponse retrieveClient(final String clientId)
7074
}
7175
}
7276

77+
@Override
7378
public ClientDetailResponse createClient(final ClientDetail detail)
7479
throws RestBusinessException {
7580
try {
@@ -80,6 +85,7 @@ public ClientDetailResponse createClient(final ClientDetail detail)
8085
}
8186
}
8287

88+
@Override
8389
public ClientDetailResponse updateClient(final String clientId, final ClientDetail detail)
8490
throws RestBusinessException {
8591
// Check IDs
@@ -94,6 +100,7 @@ public ClientDetailResponse updateClient(final String clientId, final ClientDeta
94100
}
95101
}
96102

103+
@Override
97104
public Response deleteClient(final String clientId)
98105
throws RestBusinessException {
99106
try {
@@ -104,6 +111,7 @@ public Response deleteClient(final String clientId)
104111
}
105112
}
106113

114+
@Override
107115
public RetrieveClientDocumentsResponse retrieveClientDocuments(final String clientId)
108116
throws RestBusinessException {
109117
try {
@@ -114,6 +122,7 @@ public RetrieveClientDocumentsResponse retrieveClientDocuments(final String clie
114122
}
115123
}
116124

125+
@Override
117126
public DocumentContentResponse retrieveDocument(final String documentId)
118127
throws RestBusinessException {
119128
try {

Diff for: web-bom/src/main/resources/bordertech-app.properties

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11

22
## Environment
3-
## Mock - Default to MOCK Environment for SAMPLE
4-
bordertech.config.environment=MOCK
3+
bordertech.config.environment=${BT_WEB_ENV}
4+
sample.rest.uri=${BT_APP_REST_URI}
5+
## Default to MOCK (Usually REST Client implementation)
6+
BT_WEB_ENV=MOCK
57

68
## Local REST Server - Can be used to call an instance of the REST Server running
7-
##bordertech.config.environment=LOCAL
9+
##BT_WEB_ENV=LOCAL
810
## Can override this method if want to change default end point
9-
##sample.rest.uri=http://localhost:8082/lde/api
11+
##BT_APP_REST_URI=http://localhost:8082/lde/api
12+
13+
bordertech.config.parameters.useSystemProperties=true
14+
bordertech.config.parameters.useEnvProperties=true

Diff for: web-lde/src/main/java/com/sample/app/client/lde/DemoLauncherProxy.java

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
@SuppressWarnings("HideUtilityClassConstructor")
99
public final class DemoLauncherProxy {
1010

11+
/**
12+
* Launch LDE Server.
13+
*
14+
* @param args the main arguments
15+
*/
1116
public static void main(final String[] args) {
1217
LdeLauncher.launchServer();
1318
}

Diff for: web-lde/src/main/resources/bordertech-app.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
bordertech.lde.port.default=8081
88

99
## MOCK Environment
10-
##bordertech.config.environment=MOCK
10+
BT_WEB_ENV=MOCK
1111

1212
## TODO Fix CONFIG to dump parameters
1313
bordertech.config.parameters.dump.console=true

Diff for: web-ui/src/main/java/com/sample/app/ui/common/AddressPanel.java

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
*/
1717
public class AddressPanel extends WPanel {
1818

19+
/**
20+
* Construct panel.
21+
*/
1922
public AddressPanel() {
2023

2124
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_FLAT);

Diff for: web-ui/src/main/java/com/sample/app/ui/servlet/AppServletListener.java

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
@WebListener
1212
public class AppServletListener extends AbstractComboServletListener {
1313

14+
/**
15+
* Default constructor.
16+
*/
1417
public AppServletListener() {
1518
super(new TaskContextListener(), new CachingProviderListener());
1619
}

Diff for: web-ui/src/main/java/com/sample/app/ui/util/LookupTableImpl.java

+26-6
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ public class LookupTableImpl implements LookupTable {
2323

2424
private static final String WITH_NULL_OPTION = "WITH-NULL";
2525
private static final String NO_NULL_OPTION = "NO-NULL";
26-
27-
/**
28-
* Cache name.
29-
*/
3026
private static final String CACHE_NAME = "client-lookuptable";
31-
3227
private static final ClientServices CLIENT_SERVICES = ClientServicesHelperFactory.getInstance();
33-
3428
private static final String CACHE_DELIM = "#";
3529

3630
@Override
@@ -119,6 +113,9 @@ private synchronized Cache<String, List> getCache() {
119113
return cache;
120114
}
121115

116+
/**
117+
* Table option details.
118+
*/
122119
public static class TableDetails implements Serializable {
123120

124121
private final boolean withNull;
@@ -129,32 +126,55 @@ public static class TableDetails implements Serializable {
129126

130127
private static final String NULL_DESCRIPTION = "";
131128

129+
/**
130+
* @param table the table name
131+
*/
132132
public TableDetails(final String table) {
133133
this(table, false);
134134
}
135135

136+
/**
137+
*
138+
* @param table the table name
139+
* @param withNull true if include null option
140+
*/
136141
public TableDetails(final String table, final boolean withNull) {
137142
this.table = table;
138143
this.withNull = withNull;
139144
}
140145

146+
/**
147+
* @return true if include null
148+
*/
141149
public boolean isWithNull() {
142150
return withNull;
143151
}
144152

153+
/**
154+
* @return the table name
155+
*/
145156
public String getTable() {
146157
return table;
147158
}
148159

160+
/**
161+
* @return the table key
162+
*/
149163
public String getKey() {
150164
String flag = isWithNull() ? WITH_NULL_OPTION : NO_NULL_OPTION;
151165
return table + flag;
152166
}
153167

168+
/**
169+
* @return the null code option
170+
*/
154171
public String getNullCode() {
155172
return isWithNull() ? NULL_CODE : null;
156173
}
157174

175+
/**
176+
* @return the null code description
177+
*/
158178
public String getNullDescription() {
159179
return isWithNull() ? NULL_DESCRIPTION : null;
160180
}

Diff for: web-ui/src/main/java/com/sample/app/ui/view/AbstractClientView.java

+6
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,19 @@ public T getDetail() {
7777
return (T) getContent().getBean();
7878
}
7979

80+
/**
81+
* @param viewMode the mode of the view
82+
*/
8083
public void setViewMode(final ViewMode viewMode) {
8184
getOrCreateComponentModel().viewMode = viewMode;
8285
if (viewMode == ViewMode.READONLY) {
8386
doMakeReadOnly(getContent());
8487
}
8588
}
8689

90+
/**
91+
* @return the mode of the view
92+
*/
8793
public ViewMode getViewMode() {
8894
return getComponentModel().viewMode;
8995
}

Diff for: web-ui/src/main/java/com/sample/app/ui/view/DocumentView.java

+10
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,24 @@ public enum ViewType {
120120
private final String desc;
121121
private final char accessKey;
122122

123+
/**
124+
* @return the URL
125+
*/
123126
public String getUrl() {
124127
return url;
125128
}
126129

130+
/**
131+
* @return the description
132+
*/
127133
public String getDesc() {
128134
return desc;
129135
}
130136

137+
/**
138+
*
139+
* @return the access key;
140+
*/
131141
public char getAcccessKey() {
132142
return accessKey;
133143
}

Diff for: web-ui/src/main/java/com/sample/app/ui/view/SearchView.java

+5-9
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,14 @@
3838
*/
3939
public class SearchView extends WSection implements MessageContainer {
4040

41-
/**
42-
* The logger instance for this class.
43-
*/
4441
private static final Log LOG = LogFactory.getLog(SearchView.class);
4542

4643
private static final ClientServices CLIENT_SERVICES = ClientServicesHelperFactory.getInstance();
4744

48-
/**
49-
* Main controller.
50-
*/
5145
private final ClientApp app;
5246

5347
private final WTextField txtSearch = new WTextField();
5448

55-
/**
56-
* Messages for this view.
57-
*/
5849
private final WMessages messages = new ClientWMessages();
5950

6051
private final WMenu menu = new WMenu();
@@ -206,6 +197,11 @@ public void execute(final ActionEvent event) {
206197
table.setVisible(false);
207198
}
208199

200+
/**
201+
* Refresh the client summary details.
202+
*
203+
* @param summary the client details.
204+
*/
209205
public void refreshClientSummary(final ClientDetail summary) {
210206
List<ClientDetail> clients = (List<ClientDetail>) table.getBean();
211207
int idx = clients.indexOf(summary);

0 commit comments

Comments
 (0)