Skip to content

Commit e038284

Browse files
committed
fixed tests after log4j update
1 parent 9c4deec commit e038284

File tree

22 files changed

+140
-46
lines changed

22 files changed

+140
-46
lines changed

logicaldoc-cmis/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
</dependency>
126126
<dependency>
127127
<groupId>org.apache.logging.log4j</groupId>
128-
<artifactId>log4j-slf4j-impl</artifactId>
128+
<artifactId>log4j-slf4j2-impl</artifactId>
129129
<scope>provided</scope>
130130
</dependency>
131131

logicaldoc-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</dependency>
4141
<dependency>
4242
<groupId>org.apache.logging.log4j</groupId>
43-
<artifactId>log4j-slf4j-impl</artifactId>
43+
<artifactId>log4j-slf4j2-impl</artifactId>
4444
<scope>provided</scope>
4545
</dependency>
4646
<dependency>

logicaldoc-gui/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
</dependency>
9595
<dependency>
9696
<groupId>org.apache.logging.log4j</groupId>
97-
<artifactId>log4j-slf4j-impl</artifactId>
97+
<artifactId>log4j-slf4j2-impl</artifactId>
9898
</dependency>
9999
<dependency>
100100
<groupId>commons-codec</groupId>

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/model/GUITraining.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class GUITraining implements Serializable {
2828
/**
2929
* Indicates if there is a currently running training process
3030
*/
31-
private boolean training = true;
31+
private boolean training = false;
3232

3333
private GUISampler sampler;
3434

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/model/ModelDS.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.logicaldoc.gui.frontend.client.ai.model;
22

33
import com.smartgwt.client.data.DataSource;
4+
import com.smartgwt.client.data.fields.DataSourceBooleanField;
45
import com.smartgwt.client.data.fields.DataSourceDateTimeField;
56
import com.smartgwt.client.data.fields.DataSourceTextField;
67

@@ -14,10 +15,6 @@
1415
public class ModelDS extends DataSource {
1516

1617
public ModelDS() {
17-
init("data/ai.xml?object=model");
18-
}
19-
20-
private void init(String url) {
2118
setRecordXPath("/list/model");
2219

2320
DataSourceTextField id = new DataSourceTextField("id");
@@ -30,8 +27,9 @@ private void init(String url) {
3027
DataSourceTextField description = new DataSourceTextField("description");
3128
DataSourceTextField typeField = new DataSourceTextField("type");
3229
DataSourceDateTimeField trained = new DataSourceDateTimeField("trained");
30+
DataSourceBooleanField training = new DataSourceBooleanField("training");
3331

34-
setFields(id, name, label, trained, description, typeField);
32+
setFields(id, name, label, training, trained, description, typeField);
3533
setClientOnly(true);
3634

3735
setDataURL("data/ai.xml?object=model");

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/model/ModelTraining.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ private void refresh() {
4444
if (Boolean.TRUE.equals(container.contains(form)))
4545
container.removeChild(form);
4646

47-
ToggleItem enabled = ItemFactory.newToggleItem(ENABLED, "enableschedule", model.getTraining().isEnabled());
48-
enabled.addChangedHandler(changedHandler);
47+
ToggleItem enableSchedule = ItemFactory.newToggleItem(ENABLED, "enableschedule", model.getTraining().isEnabled());
48+
enableSchedule.setWrapTitle(false);
49+
enableSchedule.addChangedHandler(changedHandler);
4950

5051
TextItem cron = ItemFactory.newCronExpressionItem("cron", "schedule", model.getTraining().getCron(),
5152
changedHandler);
@@ -65,10 +66,10 @@ private void refresh() {
6566
sampler.addChangedHandler(changedHandler);
6667

6768
form = new DynamicForm();
68-
form.setNumCols(4);
69+
form.setNumCols(1);
6970
form.setWidth(1);
7071
form.setTitleOrientation(TitleOrientation.TOP);
71-
form.setItems(enabled, cron, epochs, sampler);
72+
form.setItems(enableSchedule, cron, epochs, sampler);
7273

7374
container.setWidth100();
7475
container.setMembersMargin(3);

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/model/ModelsPanel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public void onDraw() {
7979
ListGridField name = new ListGridField("name", I18N.message("name"));
8080
name.setCanFilter(true);
8181
name.setCanSort(true);
82+
name.setMinWidth(110);
8283
name.setAutoFit(AutoFitWidthApproach.BOTH);
8384

8485
ListGridField label = new ListGridField(LABEL, I18N.message(LABEL), 200);
@@ -94,7 +95,7 @@ public void onDraw() {
9495

9596
DateListGridField trained = new DateListGridField("trained", I18N.message("lasttrained"));
9697

97-
ListGridField training = new RunningListGridField();
98+
ListGridField training = new RunningListGridField("training");
9899

99100
list = new RefreshableListGrid();
100101
list.setEmptyMessage(I18N.message("notitemstoshow"));
@@ -242,7 +243,7 @@ public void updateRecord(GUIModel model) {
242243
rec.setAttribute("name", model.getName());
243244
rec.setAttribute(LABEL, model.getLabel() != null ? model.getLabel() : model.getName());
244245
rec.setAttribute(DESCRIPTION, model.getDescription());
245-
rec.setAttribute(TRAINING, model.getTraining().isEnabled());
246+
rec.setAttribute(TRAINING, model.getTraining().isTraining());
246247
list.refreshRow(list.getRecordIndex(rec));
247248

248249
}

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/sampler/GUISampler.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public class GUISampler implements Serializable {
3838

3939
private List<GUIExtensibleObject> source = new ArrayList<>();
4040

41-
private String categoryAttribute = null;
41+
private String category;
42+
43+
private String features;
4244

4345
private String automation;
4446

@@ -127,8 +129,8 @@ public List<GUIExtensibleObject> getSource() {
127129
return source;
128130
}
129131

130-
public String getCategoryAttribute() {
131-
return categoryAttribute;
132+
public String getCategory() {
133+
return category;
132134
}
133135

134136
public String getAutomation() {
@@ -167,8 +169,8 @@ public void setSource(List<GUIExtensibleObject> source) {
167169
this.source = source;
168170
}
169171

170-
public void setCategoryAttribute(String categoryAttribute) {
171-
this.categoryAttribute = categoryAttribute;
172+
public void setCategory(String category) {
173+
this.category = category;
172174
}
173175

174176
public void setAutomation(String automation) {
@@ -182,4 +184,12 @@ public String getType() {
182184
public void setType(String type) {
183185
this.type = type;
184186
}
187+
188+
public String getFeatures() {
189+
return features;
190+
}
191+
192+
public void setFeatures(String features) {
193+
this.features = features;
194+
}
185195
}

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/sampler/SamplerProperties.java

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void refresh() {
8484
container.removeChild(form);
8585

8686
form = new DynamicForm();
87-
form.setNumCols(4);
87+
form.setNumCols(2);
8888
form.setTitleOrientation(TitleOrientation.TOP);
8989

9090
TextItem name = ItemFactory.newSimpleTextItem(NAME, sampler.getName());
@@ -98,6 +98,7 @@ private void refresh() {
9898
delimiter.addChangedHandler(changedHandler);
9999
delimiter.setWidth(30);
100100
delimiter.setLength(2);
101+
delimiter.setStartRow(true);
101102
delimiter.setVisibleWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, CSV));
102103
delimiter.setRequiredWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, CSV));
103104

@@ -110,13 +111,13 @@ private void refresh() {
110111
TextAreaItem description = ItemFactory.newTextAreaItem("description", sampler.getDescription());
111112
description.addChangedHandler(changedHandler);
112113
description.setColSpan(4);
113-
description.setWidth("*");
114+
description.setWidth(400);
114115

115116
TextAreaItem automation = ItemFactory.newTextAreaItemForAutomation("automation", sampler.getAutomation(),
116117
changedHandler, false);
117118
automation.addChangedHandler(changedHandler);
118119
automation.setColSpan(4);
119-
automation.setWidth("*");
120+
automation.setWidth(400);
120121
automation.setVisibleWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, METADATA));
121122

122123
SelectItem type = ItemFactory.newSelectItem(TYPE);
@@ -145,13 +146,20 @@ private void refresh() {
145146
documentSelector
146147
.setVisibleWhen(new AdvancedCriteria(TYPE, OperatorId.NOT_IN_SET, new String[] { METADATA, "chain" }));
147148

148-
TextItem categoryAttribute = ItemFactory.newTextItem("categoryattribute", sampler.getCategoryAttribute());
149-
categoryAttribute.addChangedHandler(changedHandler);
150-
categoryAttribute.setRequiredWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, METADATA));
151-
categoryAttribute.setVisibleWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, METADATA));
149+
TextItem category = ItemFactory.newTextItem("category", sampler.getCategory());
150+
category.addChangedHandler(changedHandler);
151+
category.setVisibleWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, METADATA));
152152

153-
form.setItems(id, typeValue, type, name, label, delimiter, quote, folderSelector, documentSelector,
154-
categoryAttribute, automation, description);
153+
TextItem features = ItemFactory.newTextItem("features", sampler.getFeatures());
154+
features.addChangedHandler(changedHandler);
155+
features.setColSpan(4);
156+
features.setWidth(400);
157+
features.setHint(I18N.message("valuescommaseparated"));
158+
features.setShowHintInField(true);
159+
features.setVisibleWhen(new AdvancedCriteria(TYPE, OperatorId.EQUALS, METADATA));
160+
161+
form.setItems(id, typeValue, type, name, label, delimiter, quote, folderSelector, documentSelector, category,
162+
features, automation, description);
155163

156164
container.setMembersMargin(3);
157165
container.addMember(form);
@@ -279,6 +287,9 @@ boolean validate() {
279287
sampler.setType(form.getValueAsString(TYPE));
280288
sampler.setFolder(folderSelector.getFolder());
281289
sampler.setDocument(documentSelector.getDocument());
290+
sampler.setCategory(form.getValueAsString("category"));
291+
sampler.setFeatures(form.getValueAsString("features"));
292+
sampler.setAutomation(form.getValueAsString("automation"));
282293

283294
if ("chain".equals(sampler.getType()) && chain.getRecordList().isEmpty()) {
284295
GuiLog.error("samplerchainempty");

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/ai/sampler/SamplersPanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public void onDraw() {
7070
ListGridField name = new ListGridField("name", I18N.message("name"));
7171
name.setCanFilter(true);
7272
name.setCanSort(true);
73+
name.setMinWidth(110);
7374
name.setAutoFit(AutoFitWidthApproach.BOTH);
7475

7576
ListGridField label = new ListGridField(LABEL, I18N.message(LABEL), 200);

0 commit comments

Comments
 (0)