Skip to content

Commit ed7b02e

Browse files
authored
Merge pull request #174 from devgateway/develop
oce-0.7.0 merged develop to master
2 parents 4c35448 + e8e69a8 commit ed7b02e

146 files changed

Lines changed: 3750 additions & 1045 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

forms/pom.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<wicket.bootstrap.version>0.10.8</wicket.bootstrap.version>
3434
<zt.zip.version>1.9</zt.zip.version>
3535
<wicket.webjars.version>0.5.5</wicket.webjars.version>
36+
<closure.compiler.version>v20160822</closure.compiler.version>
3637
</properties>
3738

3839
<dependencies>
@@ -123,6 +124,13 @@
123124
<artifactId>cglib</artifactId>
124125
<version>3.1</version>
125126
</dependency>
127+
128+
<dependency>
129+
<groupId>com.google.javascript</groupId>
130+
<artifactId>closure-compiler</artifactId>
131+
<version>${closure.compiler.version}</version>
132+
</dependency>
133+
126134

127135
<dependency>
128136
<groupId>de.agilecoders.wicket.webjars</groupId>
@@ -330,17 +338,14 @@
330338
<dependency>
331339
<groupId>org.hibernate</groupId>
332340
<artifactId>hibernate-ehcache</artifactId>
333-
<version>${hibernate.core.version}</version>
334341
</dependency>
335342
<dependency>
336343
<groupId>org.hibernate</groupId>
337-
<artifactId>hibernate-entitymanager</artifactId>
338-
<version>${hibernate.core.version}</version>
344+
<artifactId>hibernate-entitymanager</artifactId>
339345
</dependency>
340346
<dependency>
341347
<groupId>org.hibernate</groupId>
342-
<artifactId>hibernate-envers</artifactId>
343-
<version>${hibernate.core.version}</version>
348+
<artifactId>hibernate-envers</artifactId>
344349
</dependency>
345350
</dependencies>
346351
</dependencyManagement>

forms/src/main/java/org/devgateway/toolkit/forms/util/MarkupCacheService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ public void clearReportsCache() {
135135

136136
// get the reports cache "reportsCache", declared in ehcache.xml
137137
Cache cache = cm.getCache("reportsCache");
138+
139+
if (cache != null) {
140+
cache.removeAll();
141+
}
138142

139-
cache.removeAll();
140143
}
141144

142145
private String createCacheKey(final String outputType, final String reportName, final String parameters) {

forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/form/FileInputBootstrapFormComponentWrapper.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.wicket.feedback.IFeedbackMessageFilter;
2929
import org.apache.wicket.markup.html.WebMarkupContainer;
3030
import org.apache.wicket.markup.html.basic.Label;
31+
import org.apache.wicket.markup.html.form.FormComponent;
3132
import org.apache.wicket.markup.html.form.FormComponentPanel;
3233
import org.apache.wicket.markup.html.form.upload.FileUpload;
3334
import org.apache.wicket.markup.html.link.Link;
@@ -437,6 +438,25 @@ protected void onSubmit(final AjaxRequestTarget target) {
437438
};
438439

439440
add(bootstrapFileInput);
441+
442+
443+
/**
444+
* due to an upgrade of FormGroup in wicket7/wicket-bootrap-0.10, the
445+
* visitor that finds inner FormComponentS, will now find two instead of
446+
* one: the FileInputBootstrapFormComponentWrapper and also the
447+
* BootstrapFileInputField. This is the RIGHT result, previously in
448+
* wicket 6.x it only got the first level of children, hence only one
449+
* FormComponent (the FileInputBootstrapFormComponentWrapper). It would then
450+
* read the label from FileInputBootstrapFormComponentWrapper and use it
451+
* for displaying the label of the FormGroup. In
452+
* wicket7/wicket-bootstrap-0.10 this will result in reading the label
453+
* of BootstrapFileInputField which is null. So you will notice no
454+
* labels for FormGroupS. We fix this by forcing the label of the
455+
* underlying fileInput element to the same model as the label used by
456+
* FileInputBootstrapFormComponentWrapper
457+
*/
458+
FormComponent<?> fileInput = (FormComponent<?>) bootstrapFileInput.get("fileInputForm").get("fileInput");
459+
fileInput.setLabel(this.getLabel());
440460

441461
// there are situation when we want to display the upload file component
442462
// only to admins

forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/form/GenericBootstrapFormComponent.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ public GenericBootstrapFormComponent(final String id, final IModel<String> label
167167

168168
tooltipLabel = new TooltipLabel("tooltipLabel", id);
169169
border.add(tooltipLabel);
170+
171+
if (!labelHidden) {
172+
field.setLabel(labelModel);
173+
}
170174
}
171175

172176
@Override
@@ -207,10 +211,6 @@ public FIELD getField() {
207211
protected void onInitialize() {
208212
super.onInitialize();
209213

210-
if (!labelHidden) {
211-
field.setLabel(labelModel);
212-
}
213-
214214
if ((field instanceof RadioGroup) || (field instanceof CheckGroup)) {
215215
getAjaxFormChoiceComponentUpdatingBehavior();
216216
} else {

forms/src/main/java/org/devgateway/toolkit/forms/wicket/components/table/TestFormFilterState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
*/
1515
public class TestFormFilterState extends JpaFilterState<TestForm> {
1616

17-
private static final long serialVersionUID = 8005371716983257722L;
18-
private String textField;
17+
private static final long serialVersionUID = 8005371716983257722L;
18+
private String textField;
1919

2020
@Override
2121
public Specification<TestForm> getSpecification() {
16.2 KB
Loading

persistence-mongodb/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<start-class>org.devgateway.toolkit.persistence.spring.PersistenceApplication</start-class>
2626
<java.version>1.8</java.version>
2727
<joda.time.version>2.7</joda.time.version>
28-
<jadira.usertype.version>3.2.0.GA</jadira.usertype.version>
28+
<jadira.usertype.version>5.0.0.GA</jadira.usertype.version>
2929
<ehcache.version>2.6.11</ehcache.version>
3030
<json.schema.validator.version>2.2.6</json.schema.validator.version>
3131
<json.patch.version>1.9</json.patch.version>

persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Address.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public String getStreetAddress() {
9090
* The streetAddress
9191
*/
9292
@JsonProperty("streetAddress")
93-
public void setStreetAddress(String streetAddress) {
93+
public void setStreetAddress(final String streetAddress) {
9494
this.streetAddress = streetAddress;
9595
}
9696

@@ -112,7 +112,7 @@ public String getLocality() {
112112
* The locality
113113
*/
114114
@JsonProperty("locality")
115-
public void setLocality(String locality) {
115+
public void setLocality(final String locality) {
116116
this.locality = locality;
117117
}
118118

@@ -134,7 +134,7 @@ public String getRegion() {
134134
* The region
135135
*/
136136
@JsonProperty("region")
137-
public void setRegion(String region) {
137+
public void setRegion(final String region) {
138138
this.region = region;
139139
}
140140

@@ -156,7 +156,7 @@ public String getPostalCode() {
156156
* The postalCode
157157
*/
158158
@JsonProperty("postalCode")
159-
public void setPostalCode(String postalCode) {
159+
public void setPostalCode(final String postalCode) {
160160
this.postalCode = postalCode;
161161
}
162162

@@ -178,7 +178,7 @@ public String getCountryName() {
178178
* The countryName
179179
*/
180180
@JsonProperty("countryName")
181-
public void setCountryName(String countryName) {
181+
public void setCountryName(final String countryName) {
182182
this.countryName = countryName;
183183
}
184184

@@ -199,7 +199,7 @@ public int hashCode() {
199199
}
200200

201201
@Override
202-
public boolean equals(Object other) {
202+
public boolean equals(final Object other) {
203203
if (other == this) {
204204
return true;
205205
}

persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Amendment.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public Date getDate() {
7878
* The date
7979
*/
8080
@JsonProperty("date")
81-
public void setDate(Date date) {
81+
public void setDate(final Date date) {
8282
this.date = date;
8383
}
8484

@@ -104,7 +104,7 @@ public List<Change> getChanges() {
104104
* The changes
105105
*/
106106
@JsonProperty("changes")
107-
public void setChanges(List<Change> changes) {
107+
public void setChanges(final List<Change> changes) {
108108
this.changes = changes;
109109
}
110110

@@ -126,7 +126,7 @@ public String getRationale() {
126126
* The rationale
127127
*/
128128
@JsonProperty("rationale")
129-
public void setRationale(String rationale) {
129+
public void setRationale(final String rationale) {
130130
this.rationale = rationale;
131131
}
132132

@@ -145,7 +145,7 @@ public int hashCode() {
145145
}
146146

147147
@Override
148-
public boolean equals(Object other) {
148+
public boolean equals(final Object other) {
149149
if (other == this) {
150150
return true;
151151
}

persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Amount.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public BigDecimal getAmount() {
6161
* The amount
6262
*/
6363
@JsonProperty("amount")
64-
public void setAmount(BigDecimal amount) {
64+
public void setAmount(final BigDecimal amount) {
6565
this.amount = amount;
6666
}
6767

@@ -83,7 +83,7 @@ public String getCurrency() {
8383
* The currency
8484
*/
8585
@JsonProperty("currency")
86-
public void setCurrency(String currency) {
86+
public void setCurrency(final String currency) {
8787
this.currency = currency;
8888
}
8989

@@ -101,7 +101,7 @@ public int hashCode() {
101101
}
102102

103103
@Override
104-
public boolean equals(Object other) {
104+
public boolean equals(final Object other) {
105105
if (other == this) {
106106
return true;
107107
}

0 commit comments

Comments
 (0)