Skip to content

Commit

Permalink
devonfw#1454 Make use of ArtifactRetriever
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonNew committed Jan 2, 2023
1 parent d37de66 commit 3c13c13
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 146 deletions.
11 changes: 11 additions & 0 deletions cobigen-cli/cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<properties>
<skip.deployment>false</skip.deployment>
<javafx.version>18</javafx.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -56,6 +57,16 @@
<artifactId>google-java-format</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public synchronized Integer doAction() throws Exception {
try {
wait(1337);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Expand Down
184 changes: 94 additions & 90 deletions cobigen/gui/pom.xml
Original file line number Diff line number Diff line change
@@ -1,94 +1,98 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>gui</artifactId>
<packaging>jar</packaging>
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>gui</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>com.devonfw.cobigen</groupId>
<artifactId>core-parent</artifactId>
<version>${revision}</version>
</parent>
<parent>
<groupId>com.devonfw.cobigen</groupId>
<artifactId>core-parent</artifactId>
<version>${revision}</version>
</parent>

<properties>
<skip.deployment>false</skip.deployment>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<java.version>11</java.version>
<javafx.version>18</javafx.version>
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
</properties>
<properties>
<skip.deployment>false</skip.deployment>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<java.version>11</java.version>
<javafx.version>18</javafx.version>
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
</properties>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<version>4.0.16-alpha</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit</artifactId>
<version>4.0.15-alpha</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>11.3.5</version>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-materialdesign-pack</artifactId>
<version>11.3.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.maven.plugin.version}</version>
<configuration>
<mainClass>com.devonfw.cobigen.gui.App</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- allow to use unnamed modules -->
<useModulePath>false</useModulePath>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<version>4.0.16-alpha</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit</artifactId>
<version>4.0.15-alpha</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>11.3.5</version>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-materialdesign-pack</artifactId>
<version>11.3.5</version>
</dependency>
<dependency>
<groupId>com.devonfw.cobigen</groupId>
<artifactId>core-artifact-retriever</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.maven.plugin.version}</version>
<configuration>
<mainClass>com.devonfw.cobigen.gui.App</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- allow to use unnamed modules -->
<useModulePath>false</useModulePath>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.devonfw.cobigen.gui.controllers.DetailsController;
import com.devonfw.cobigen.gui.controllers.HomeController;
import com.devonfw.cobigen.gui.controllers.MenuController;
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
Expand Down Expand Up @@ -104,7 +105,8 @@ public void loadDetails() throws IOException {
} else {
this.home.setVisible(false);
this.details.setVisible(true);
this.detailsController.showName(selectedItem.getName());
// TODO
this.detailsController.showName(selectedItem.getTemplateSetVersion());
}

}
Expand Down
37 changes: 0 additions & 37 deletions cobigen/gui/src/main/java/com/devonfw/cobigen/gui/TemplateSet.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.util.ResourceBundle;

import com.devonfw.cobigen.gui.Controller;
import com.devonfw.cobigen.gui.TemplateSet;
import com.devonfw.cobigen.gui.services.TemplateSetCell;
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
Expand Down Expand Up @@ -52,9 +52,18 @@ public MenuController() {

this.templateSetObservableList = FXCollections.observableArrayList();

// Add the template sets, populate observable list ( before initialize)
this.templateSetObservableList.addAll(new TemplateSet("Template Set 1"), new TemplateSet("Template Set 2"),
new TemplateSet("Template Set 3"), new TemplateSet("Template Set 4"));
// Add the template sets, populate observable list (before initialize)
// this.templateSetObservableList.addAll(new TemplateSet("Template Set 1"), new TemplateSet("Template Set 2"),
// new TemplateSet("Template Set 3"), new TemplateSet("Template Set 4"));

// Path templateSetFile = Paths.get(testdataRoot).resolve("template-set.xml");
//
// TemplateSetArtifactReader artifactReader = new TemplateSetArtifactReader();
//
// TemplateSet templateSet = artifactReader.retrieveTemplateSet(templateSetFile);
//
// List<TemplateSetTag> tagsList = new ArrayList<>();
// tagsList.addAll(templateSet.getTemplateSetConfiguration().getContextConfiguration().getTags().getTagsList());
}

/**
Expand Down Expand Up @@ -110,14 +119,14 @@ public void handle(MouseEvent event) {

String searchKeyword = newValue.toLowerCase();
// found a match in the name
if (templateSets.getName().toLowerCase().indexOf(searchKeyword) > -1) {
return true;
}
// if (templateSets.getName().toLowerCase().indexOf(searchKeyword) > -1) {
// return true;
// }
// add more if statements of this form
// if more search relevant attributes are added to the TemplateSet Class!

else
return false;
// else
return false;
});

this.searchResultsView.setItems(filteredData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.IOException;

import com.devonfw.cobigen.gui.TemplateSet;
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;

import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
Expand Down Expand Up @@ -50,7 +50,8 @@ protected void updateItem(TemplateSet templateSet, boolean empty) {
}
}

this.titleLabel.setText(templateSet.getName());
// TODO:
// this.titleLabel.setText(templateSet.getName());
// setText(templateSet.getName());
this.installButton.setOnAction(event -> {
System.out.println("INSTALLIEREN!!!");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.devonfw.cobigen.gui.services;

import com.devonfw.cobigen.gui.TemplateSet;
import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet;

import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
Expand Down
5 changes: 1 addition & 4 deletions cobigen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
<module>cobigen-core-test</module>
<module>cobigen-core-systemtest</module>
<module>core-externalprocess-api</module>
<<<<<<< HEAD
<module>gui</module>
=======
<module>core-artifact-retriever</module>
>>>>>>> template-set-deployables
<module>gui</module>
</modules>
</project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.devonfw.cobigen</groupId>
<artifactId>master-parent</artifactId>
Expand Down

0 comments on commit 3c13c13

Please sign in to comment.