Skip to content

Commit 3c13c13

Browse files
committed
devonfw#1454 Make use of ArtifactRetriever
1 parent d37de66 commit 3c13c13

File tree

10 files changed

+132
-146
lines changed

10 files changed

+132
-146
lines changed

cobigen-cli/cli/pom.xml

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<properties>
1515
<skip.deployment>false</skip.deployment>
16+
<javafx.version>18</javafx.version>
1617
</properties>
1718

1819
<dependencies>
@@ -56,6 +57,16 @@
5657
<artifactId>google-java-format</artifactId>
5758
<version>1.10.0</version>
5859
</dependency>
60+
<dependency>
61+
<groupId>org.openjfx</groupId>
62+
<artifactId>javafx-controls</artifactId>
63+
<version>${javafx.version}</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.openjfx</groupId>
67+
<artifactId>javafx-fxml</artifactId>
68+
<version>${javafx.version}</version>
69+
</dependency>
5970
</dependencies>
6071

6172
<build>

cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/ManageCommand.java

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public synchronized Integer doAction() throws Exception {
3131
try {
3232
wait(1337);
3333
} catch (InterruptedException e) {
34-
// TODO Auto-generated catch block
3534
e.printStackTrace();
3635
}
3736

cobigen/gui/pom.xml

+94-90
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,98 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<artifactId>gui</artifactId>
5-
<packaging>jar</packaging>
1+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2+
<modelVersion>4.0.0</modelVersion>
3+
<artifactId>gui</artifactId>
4+
<packaging>jar</packaging>
65

7-
<parent>
8-
<groupId>com.devonfw.cobigen</groupId>
9-
<artifactId>core-parent</artifactId>
10-
<version>${revision}</version>
11-
</parent>
6+
<parent>
7+
<groupId>com.devonfw.cobigen</groupId>
8+
<artifactId>core-parent</artifactId>
9+
<version>${revision}</version>
10+
</parent>
1211

13-
<properties>
14-
<skip.deployment>false</skip.deployment>
15-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<maven.compiler.release>11</maven.compiler.release>
17-
<java.version>11</java.version>
18-
<javafx.version>18</javafx.version>
19-
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
20-
</properties>
12+
<properties>
13+
<skip.deployment>false</skip.deployment>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<maven.compiler.release>11</maven.compiler.release>
16+
<java.version>11</java.version>
17+
<javafx.version>18</javafx.version>
18+
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
19+
</properties>
2120

22-
<dependencies>
23-
<dependency>
24-
<groupId>org.openjfx</groupId>
25-
<artifactId>javafx-controls</artifactId>
26-
<version>${javafx.version}</version>
27-
</dependency>
28-
<dependency>
29-
<groupId>org.openjfx</groupId>
30-
<artifactId>javafx-fxml</artifactId>
31-
<version>${javafx.version}</version>
32-
</dependency>
33-
<dependency>
34-
<groupId>junit</groupId>
35-
<artifactId>junit</artifactId>
36-
<version>4.13.1</version>
37-
</dependency>
38-
<dependency>
39-
<groupId>org.testfx</groupId>
40-
<artifactId>testfx-core</artifactId>
41-
<version>4.0.16-alpha</version>
42-
<scope>test</scope>
43-
</dependency>
44-
<dependency>
45-
<groupId>org.testfx</groupId>
46-
<artifactId>testfx-junit</artifactId>
47-
<version>4.0.15-alpha</version>
48-
<scope>test</scope>
49-
</dependency>
50-
<dependency>
51-
<groupId>org.assertj</groupId>
52-
<artifactId>assertj-core</artifactId>
53-
<version>3.13.2</version>
54-
<scope>test</scope>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.kordamp.ikonli</groupId>
58-
<artifactId>ikonli-javafx</artifactId>
59-
<version>11.3.5</version>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.kordamp.ikonli</groupId>
63-
<artifactId>ikonli-materialdesign-pack</artifactId>
64-
<version>11.3.5</version>
65-
</dependency>
66-
</dependencies>
67-
<build>
68-
<plugins>
69-
<plugin>
70-
<groupId>org.apache.maven.plugins</groupId>
71-
<artifactId>maven-compiler-plugin</artifactId>
72-
<configuration>
73-
<release>${maven.compiler.release}</release>
74-
</configuration>
75-
</plugin>
76-
<plugin>
77-
<groupId>org.openjfx</groupId>
78-
<artifactId>javafx-maven-plugin</artifactId>
79-
<version>${javafx.maven.plugin.version}</version>
80-
<configuration>
81-
<mainClass>com.devonfw.cobigen.gui.App</mainClass>
82-
</configuration>
83-
</plugin>
84-
<plugin>
85-
<groupId>org.apache.maven.plugins</groupId>
86-
<artifactId>maven-surefire-plugin</artifactId>
87-
<configuration>
88-
<!-- allow to use unnamed modules -->
89-
<useModulePath>false</useModulePath>
90-
</configuration>
91-
</plugin>
92-
</plugins>
93-
</build>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.openjfx</groupId>
24+
<artifactId>javafx-controls</artifactId>
25+
<version>${javafx.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.openjfx</groupId>
29+
<artifactId>javafx-fxml</artifactId>
30+
<version>${javafx.version}</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>junit</groupId>
34+
<artifactId>junit</artifactId>
35+
<version>4.13.1</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.testfx</groupId>
39+
<artifactId>testfx-core</artifactId>
40+
<version>4.0.16-alpha</version>
41+
<scope>test</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.testfx</groupId>
45+
<artifactId>testfx-junit</artifactId>
46+
<version>4.0.15-alpha</version>
47+
<scope>test</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.assertj</groupId>
51+
<artifactId>assertj-core</artifactId>
52+
<version>3.13.2</version>
53+
<scope>test</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.kordamp.ikonli</groupId>
57+
<artifactId>ikonli-javafx</artifactId>
58+
<version>11.3.5</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.kordamp.ikonli</groupId>
62+
<artifactId>ikonli-materialdesign-pack</artifactId>
63+
<version>11.3.5</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>com.devonfw.cobigen</groupId>
67+
<artifactId>core-artifact-retriever</artifactId>
68+
<version>${revision}</version>
69+
</dependency>
70+
</dependencies>
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-compiler-plugin</artifactId>
76+
<configuration>
77+
<release>${maven.compiler.release}</release>
78+
</configuration>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.openjfx</groupId>
82+
<artifactId>javafx-maven-plugin</artifactId>
83+
<version>${javafx.maven.plugin.version}</version>
84+
<configuration>
85+
<mainClass>com.devonfw.cobigen.gui.App</mainClass>
86+
</configuration>
87+
</plugin>
88+
<plugin>
89+
<groupId>org.apache.maven.plugins</groupId>
90+
<artifactId>maven-surefire-plugin</artifactId>
91+
<configuration>
92+
<!-- allow to use unnamed modules -->
93+
<useModulePath>false</useModulePath>
94+
</configuration>
95+
</plugin>
96+
</plugins>
97+
</build>
9498
</project>

cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.devonfw.cobigen.gui.controllers.DetailsController;
88
import com.devonfw.cobigen.gui.controllers.HomeController;
99
import com.devonfw.cobigen.gui.controllers.MenuController;
10+
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;
1011

1112
import javafx.event.ActionEvent;
1213
import javafx.fxml.FXML;
@@ -104,7 +105,8 @@ public void loadDetails() throws IOException {
104105
} else {
105106
this.home.setVisible(false);
106107
this.details.setVisible(true);
107-
this.detailsController.showName(selectedItem.getName());
108+
// TODO
109+
this.detailsController.showName(selectedItem.getTemplateSetVersion());
108110
}
109111

110112
}

cobigen/gui/src/main/java/com/devonfw/cobigen/gui/TemplateSet.java

-37
This file was deleted.

cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java

+18-9
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import java.util.ResourceBundle;
66

77
import com.devonfw.cobigen.gui.Controller;
8-
import com.devonfw.cobigen.gui.TemplateSet;
98
import com.devonfw.cobigen.gui.services.TemplateSetCell;
9+
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;
1010

1111
import javafx.collections.FXCollections;
1212
import javafx.collections.ObservableList;
@@ -52,9 +52,18 @@ public MenuController() {
5252

5353
this.templateSetObservableList = FXCollections.observableArrayList();
5454

55-
// Add the template sets, populate observable list ( before initialize)
56-
this.templateSetObservableList.addAll(new TemplateSet("Template Set 1"), new TemplateSet("Template Set 2"),
57-
new TemplateSet("Template Set 3"), new TemplateSet("Template Set 4"));
55+
// Add the template sets, populate observable list (before initialize)
56+
// this.templateSetObservableList.addAll(new TemplateSet("Template Set 1"), new TemplateSet("Template Set 2"),
57+
// new TemplateSet("Template Set 3"), new TemplateSet("Template Set 4"));
58+
59+
// Path templateSetFile = Paths.get(testdataRoot).resolve("template-set.xml");
60+
//
61+
// TemplateSetArtifactReader artifactReader = new TemplateSetArtifactReader();
62+
//
63+
// TemplateSet templateSet = artifactReader.retrieveTemplateSet(templateSetFile);
64+
//
65+
// List<TemplateSetTag> tagsList = new ArrayList<>();
66+
// tagsList.addAll(templateSet.getTemplateSetConfiguration().getContextConfiguration().getTags().getTagsList());
5867
}
5968

6069
/**
@@ -110,14 +119,14 @@ public void handle(MouseEvent event) {
110119

111120
String searchKeyword = newValue.toLowerCase();
112121
// found a match in the name
113-
if (templateSets.getName().toLowerCase().indexOf(searchKeyword) > -1) {
114-
return true;
115-
}
122+
// if (templateSets.getName().toLowerCase().indexOf(searchKeyword) > -1) {
123+
// return true;
124+
// }
116125
// add more if statements of this form
117126
// if more search relevant attributes are added to the TemplateSet Class!
118127

119-
else
120-
return false;
128+
// else
129+
return false;
121130
});
122131

123132
this.searchResultsView.setItems(filteredData);

cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.io.IOException;
44

5-
import com.devonfw.cobigen.gui.TemplateSet;
5+
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;
66

77
import javafx.fxml.FXML;
88
import javafx.fxml.FXMLLoader;
@@ -50,7 +50,8 @@ protected void updateItem(TemplateSet templateSet, boolean empty) {
5050
}
5151
}
5252

53-
this.titleLabel.setText(templateSet.getName());
53+
// TODO:
54+
// this.titleLabel.setText(templateSet.getName());
5455
// setText(templateSet.getName());
5556
this.installButton.setOnAction(event -> {
5657
System.out.println("INSTALLIEREN!!!");

cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.devonfw.cobigen.gui.services;
22

3-
import com.devonfw.cobigen.gui.TemplateSet;
3+
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;
44

55
import javafx.scene.control.ListCell;
66
import javafx.scene.control.ListView;

cobigen/pom.xml

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
<module>cobigen-core-test</module>
1818
<module>cobigen-core-systemtest</module>
1919
<module>core-externalprocess-api</module>
20-
<<<<<<< HEAD
21-
<module>gui</module>
22-
=======
2320
<module>core-artifact-retriever</module>
24-
>>>>>>> template-set-deployables
21+
<module>gui</module>
2522
</modules>
2623
</project>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.devonfw.cobigen</groupId>
55
<artifactId>master-parent</artifactId>

0 commit comments

Comments
 (0)