Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request for the implemented Changes in the WoPeD Client during the "Integrationsseminar" #167

Merged
merged 88 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
04fa639
Added initial JFrame for P2T
anneke02 May 27, 2024
bb24ad5
Edited JFrame with radio buttons and added descriptions
anneke02 May 28, 2024
e41faa6
Added API key validation
anneke02 May 28, 2024
ea50494
Add focus in API key field
TimU02 May 28, 2024
2310eef
fork due to lack of write access
Marcel2511 Jun 4, 2024
d47be3c
Refactored Popup, added field for prompt
Marcel2511 Jun 4, 2024
4ee2795
added a settings option for the api key and prompt
Marcel2511 Jun 9, 2024
4006920
added api key validation
Marcel2511 Jun 9, 2024
9ae6edf
added default prompt in settings
Marcel2511 Jun 9, 2024
c4b02fe
added clause so that old/new UI doesn't show if checkAgain == false
Marcel2511 Jun 9, 2024
1d705eb
added checkbox in p2tUI "don't show again"
Marcel2511 Jun 9, 2024
0f0c449
refactored apikey validation
Marcel2511 Jun 9, 2024
72cda0e
added logic to show again button in old/new UI, added config changes …
Marcel2511 Jun 9, 2024
444322d
bixfix where prompt didnt update when changed in settings
Marcel2511 Jun 10, 2024
96331c6
Merge branch 'master' into master
Marcel2511 Jun 10, 2024
b1e2c5e
Merge pull request #1 from Marcel2511/master
Marcel2511 Jun 10, 2024
2420797
Refactor strings of P2TUI
anneke02 Jun 10, 2024
1c01d29
Make visibility of GPT settings selectable
TimU02 Jun 10, 2024
7c2271e
Merge remote-tracking branch 'origin/master'
TimU02 Jun 10, 2024
76f23d7
Fix bug
TimU02 Jun 10, 2024
01d6992
Make visibility of GPT settings selectable
TimU02 Jun 10, 2024
6d47e60
Refactor strings of P2TUI
anneke02 Jun 10, 2024
7347742
Fix bug
TimU02 Jun 10, 2024
d30b7ee
Merge branch 'master' of https://github.com/TimU02/WoPeD
zbbhelen Jun 10, 2024
ac66f0f
Fix string of messages file
anneke02 Jun 10, 2024
ae78aee
Enable old Service call from popup
TimU02 Jun 10, 2024
3d95afc
Merge remote-tracking branch 'origin/master'
TimU02 Jun 10, 2024
4a6ec73
Merge branch 'master' of https://github.com/TimU02/WoPeD
zbbhelen Jun 10, 2024
dbf61f2
added new config, so that the client remebers which version the endus…
Marcel2511 Jun 10, 2024
4e2803c
Merge branch 'master' of https://github.com/TimU02/WoPeD
zbbhelen Jun 10, 2024
1e23f67
preparations for implementation of logic in transform buttons
Marcel2511 Jun 10, 2024
0a34a42
Merge branch 'master' of https://github.com/TimU02/WoPeD
zbbhelen Jun 11, 2024
52cccde
Added Option to choose GPT Model in Settings
Marcel2511 Jun 12, 2024
eec2a1c
Added Dropdownmenu for gpt models in old / new switch panel
Marcel2511 Jun 12, 2024
da4d467
Added config for GPT Model so that the client remebers what was last …
Marcel2511 Jun 12, 2024
9c81bab
connected the client to the p2t backend
Marcel2511 Jun 12, 2024
6c25969
close popup on text-generation, added gptmodel selection to api call
Marcel2511 Jun 13, 2024
9d92449
Added logic to both old and new Call
Marcel2511 Jun 13, 2024
dd883d2
Old Service now works apart from localhost
Marcel2511 Jun 13, 2024
dbe02f0
Added API call from initial GUI
Marcel2511 Jun 13, 2024
7de3f45
Merge branch 'master' of https://github.com/TimU02/WoPeD
zbbhelen Jun 15, 2024
fa821ce
Refactor Strings of P2TUI
zbbhelen Jun 15, 2024
9cd9b59
Refactor Strings of ConfNLPToolsPanel
zbbhelen Jun 15, 2024
122e563
Revert "Refactor Strings of P2TUI"
zbbhelen Jun 15, 2024
d484abe
Revert "Refactor Strings of ConfNLPToolsPanel"
zbbhelen Jun 15, 2024
d7b5abe
add "json-simple" dependency for "ParseException" of P2TUI
zbbhelen Jun 15, 2024
c5ad7c9
Refactor Strings of P2TUI
zbbhelen Jun 15, 2024
7eb7d6b
Refactor Strings of ConfNLPToolsPanel
zbbhelen Jun 15, 2024
e90835e
Cleanup, formatting
Marcel2511 Jun 17, 2024
014df70
made sure that settings dont crash if service isn't available
Marcel2511 Jun 17, 2024
721caf1
P2TUI Unit Test
zbbhelen Jun 26, 2024
dd3f200
Remove unused mediator
anneke02 Jun 29, 2024
78a0087
Made sure that popup window closes upon generating a text
Marcel2511 Jul 1, 2024
edbdbe5
update P2TUI Unit Test
zbbhelen Jul 1, 2024
d584d46
Refactoring, Cleanup, Comments
Marcel2511 Jul 1, 2024
6ce1412
removed unused method
Marcel2511 Jul 1, 2024
e797445
translated comments, refactored compoents, removed unused components
Marcel2511 Jul 1, 2024
162e587
fixed a bug where the keyfield for the apikey aswell as the dropdownm…
Marcel2511 Jul 1, 2024
35b8de0
Added refactoring of prompt string
anneke02 Jul 2, 2024
baad942
Delete prints
anneke02 Jul 2, 2024
106fc67
Merge master
anneke02 Jul 2, 2024
2e0ee2a
Merge pull request #2 from TimU02/RefactoringAndTesting
TimU02 Jul 2, 2024
b52868e
added a fetchgptmodels button for fetching gpt models
Marcel2511 Jul 2, 2024
24e6c91
Fixed a Bug where the prompt would reset if the boolean value of the …
Marcel2511 Jul 3, 2024
5ec0db3
CleanUp + Logging
Marcel2511 Jul 3, 2024
40273b9
cleanup
zbbhelen Jul 4, 2024
8ac6196
Initiale test for P2TUI
anneke02 Jul 5, 2024
595e37e
Remove accidental character
anneke02 Jul 5, 2024
1c92598
Add tests for initializeSwitchButtonPanel
anneke02 Jul 5, 2024
ec3870a
Finalize test for initializeSwitchButtonPanel
anneke02 Jul 5, 2024
d735e13
add test for IsAPIKeyValid
zbbhelen Jul 5, 2024
f4e0f29
add Test for ValidateAPIKey
zbbhelen Jul 5, 2024
c9b4f85
Delete api key tests
anneke02 Jul 5, 2024
7c5dcc5
Add test for SingleButtonPanel
anneke02 Jul 5, 2024
9a8303b
Add test for executeAction in P2TUI
anneke02 Jul 5, 2024
7db307a
Added api key valid test method for invalid case
anneke02 Jul 5, 2024
3f0364c
Delete unused methods
TimU02 Jul 5, 2024
edcb438
Refactor test for P2TUI methods
anneke02 Jul 5, 2024
b0e8ea5
Remove unused import
anneke02 Jul 5, 2024
2890288
Refactoring
Marcel2511 Jul 5, 2024
4e34f9f
Add doc and JavaDoc to P2TUI and tests
anneke02 Jul 5, 2024
e7817bb
Add doc and JavaDoc to P2TUI and tests
anneke02 Jul 5, 2024
b25ce19
refactoring
Marcel2511 Jul 7, 2024
96d46c3
Refactor Strings
TimU02 Jul 7, 2024
a610dc8
Refactor String
TimU02 Jul 7, 2024
0db9edd
Refactor settings strings
anneke02 Jul 7, 2024
4315d24
Refactor Strings
TimU02 Jul 7, 2024
dee699c
remove unused import
zbbhelen Jul 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
<xs:element name="Configuration">
<xs:complexType>
<xs:all>
<xs:element name="gui" type="GUI"/>
<xs:element name="editor" type="Editor"/>
<xs:element name="general" type="General"/>
<xs:element name="tools" type="Tool"/>
<xs:element name="apromoreServers" type="ApromoreServers" minOccurs="0" maxOccurs="1"/>
<xs:element name="p2t" type="Process2Text"/>
<xs:element name="t2p" type="Text2Process"/>
<xs:element name="businessdashboard" type="BusinessDashboard"/>
<xs:element name="coloring" type="Coloring"/>
<xs:element name="metrics" type="Metrics"/>
<xs:element name="registration" type="Registration"/>
<xs:element name="gui" type="GUI"/>
<xs:element name="editor" type="Editor"/>
<xs:element name="general" type="General"/>
<xs:element name="tools" type="Tool"/>
<xs:element name="apromoreServers" type="ApromoreServers" minOccurs="0" maxOccurs="1"/>
<xs:element name="p2t" type="Process2Text"/>
<xs:element name="t2p" type="Text2Process"/>
<xs:element name="Gpt" type="GPTSettings"/>
<xs:element name="businessdashboard" type="BusinessDashboard"/>
<xs:element name="coloring" type="Coloring"/>
<xs:element name="metrics" type="Metrics"/>
<xs:element name="registration" type="Registration"/>
</xs:all>
</xs:complexType>
</xs:element>
Expand Down Expand Up @@ -101,22 +102,22 @@

<xs:complexType name="ApromoreServers">
<xs:sequence>
<xs:element name="apromoreServer" type="ApromoreServer" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="apromoreServer" type="ApromoreServer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="ApromoreServer">
<xs:sequence>
<xs:element name="apromoreServerID" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="apromoreServerName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreServerURL" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreServerPort" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreManagerPath" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreUserName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromorePassword" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreUseProxy" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreProxyName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreProxyPort" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreServerID" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="apromoreServerName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreServerURL" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreServerPort" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreManagerPath" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreUserName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromorePassword" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreUseProxy" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreProxyName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="apromoreProxyPort" type="xs:int" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>

Expand All @@ -136,6 +137,17 @@
<xs:element name="t2pServerURI" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="GPTSettings">
<xs:sequence>
<xs:element name="GptApiKey" type="xs:string" minOccurs="0" />
<xs:element name="GptShowAgain" type="xs:boolean" minOccurs="0" />
<xs:element name="GptPrompt" type="xs:string" minOccurs="0" />
<xs:element name="GptUseNew" type="xs:boolean" minOccurs="0" />
<xs:element name="GptModel" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="BusinessDashboard">
<xs:sequence>
<xs:element name="usebydefault" type="xs:boolean" default="false" minOccurs="0" />
Expand Down Expand Up @@ -191,20 +203,20 @@
</xs:complexType>
<xs:complexType name="Metrics">
<xs:sequence>
<xs:element name="useMetrics" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="variableDecimalPlaces" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="algorithmDecimalPlaces" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="useAlgorithmHighlighting" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="showNamesInBuilder" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="showAdvancedErrorMessages" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="useMetrics" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="variableDecimalPlaces" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="algorithmDecimalPlaces" type="xs:int" minOccurs="0" maxOccurs="1"/>
<xs:element name="useAlgorithmHighlighting" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="showNamesInBuilder" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element name="showAdvancedErrorMessages" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Registration">
<xs:sequence>
<xs:element name="emailAddress" type="xs:string" default="" minOccurs="0" maxOccurs="1"/>
<xs:element name="launchCounter" type="xs:int" default="0" minOccurs="0" maxOccurs="1"/>
<xs:element name="showOnStartup" type="xs:boolean" default="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="registered" type="xs:boolean" default="false" minOccurs="0" maxOccurs="1"/>
<xs:element name="emailAddress" type="xs:string" default="" minOccurs="0" maxOccurs="1"/>
<xs:element name="launchCounter" type="xs:int" default="0" minOccurs="0" maxOccurs="1"/>
<xs:element name="showOnStartup" type="xs:boolean" default="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="registered" type="xs:boolean" default="false" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
11 changes: 9 additions & 2 deletions WoPeD-CommonLibs/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -21,6 +21,13 @@
</properties>

<dependencies>
<dependency>
<groupId>de.dhbw.woped</groupId>
<artifactId>jgraph</artifactId>
<version>5.10.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jgraph-5.10.2.jar</systemPath>
</dependency>
<dependency>
<groupId>de.dhbw.woped</groupId>
<artifactId>jgraph</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public boolean initConfig() {
if (getConfDocument().getConfiguration().getMetrics() == null)
getConfDocument().getConfiguration().addNewMetrics();

if(getConfDocument().getConfiguration().getGpt() == null)
getConfDocument().getConfiguration().addNewGpt();

// Check if metrics configuration should be loaded
// and react accordingly
if (getConfDocument().getConfiguration().getMetrics().getUseMetrics()) {
Expand Down Expand Up @@ -1475,6 +1478,64 @@ public String getText2ProcessServerURI() {
return getConfDocument().getConfiguration().getT2P().getT2PServerURI();
} else return ConfigurationManager.getStandardConfiguration().getText2ProcessServerURI();
}
@Override
public String getGptApiKey() {
if(getConfDocument().getConfiguration().getGpt().isSetGptApiKey()){
return getConfDocument().getConfiguration().getGpt().getGptApiKey();
}else return ConfigurationManager.getStandardConfiguration().getGptApiKey();
}

@Override
public void setGptApiKey(String apiKey) {
getConfDocument().getConfiguration().getGpt().setGptApiKey(apiKey);
}

public String getGptModel(){
if(getConfDocument().getConfiguration().getGpt().isSetGptModel()){
return getConfDocument().getConfiguration().getGpt().getGptModel();
} else return ConfigurationManager.getStandardConfiguration().getGptModel();
}

public void setGptModel(String model){
getConfDocument().getConfiguration().getGpt().setGptModel(model);
}

@Override
public boolean getGptShowAgain() {
if(getConfDocument().getConfiguration().getGpt().isSetGptShowAgain()){
return getConfDocument().getConfiguration().getGpt().getGptShowAgain();
}else return ConfigurationManager.getStandardConfiguration().getGptShowAgain();
}

@Override
public void setGptShowAgain(boolean showAgain) {
getConfDocument().getConfiguration().getGpt().setGptShowAgain(showAgain);
}

@Override
public String getGptPrompt() {
if(getConfDocument().getConfiguration().getGpt().isSetGptPrompt()){
return getConfDocument().getConfiguration().getGpt().getGptPrompt();
}else return ConfigurationManager.getStandardConfiguration().getGptPrompt();
}

@Override
public void setGptPrompt(String prompt) {
getConfDocument().getConfiguration().getGpt().setGptPrompt(prompt);
}

@Override
public void setGptUseNew(boolean useNew){
getConfDocument().getConfiguration().getGpt().setGptUseNew(useNew);
}

@Override
public boolean getGptUseNew(){
if(getConfDocument().getConfiguration().getGpt().getGptUseNew()){
return getConfDocument().getConfiguration().getGpt().getGptUseNew();
} else return ConfigurationManager.getStandardConfiguration().getGptUseNew();
}


@Override
public void setText2ProcessServerURI(String uri) {
Expand Down Expand Up @@ -1605,4 +1666,6 @@ public void setYAWLExportGroups(boolean exportGroups) {
.getExporting()
.setYawlExportGroups(exportGroups);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,10 @@
<t2pServerPort>8081</t2pServerPort>
<t2pServerURI>/t2p</t2pServerURI>
</t2p>
<Gpt>
<GptApiKey>test</GptApiKey>
<GptPrompt>test</GptPrompt>
<GptUseNew>true</GptUseNew>
</Gpt>

</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ public static boolean hasNonStaticMetricsConfiguration() {
if (metricsConfiguration != null) return true;
else return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Class that provides fallback configuration settings for the general WoPeD configuration part
*
* @author Philip Allgaier
* @autor Philip Allgaier
*/
@SuppressWarnings("JavadocReference")
public class DefaultStaticConfiguration implements IGeneralConfiguration {
Expand Down Expand Up @@ -190,6 +190,32 @@ public class DefaultStaticConfiguration implements IGeneralConfiguration {

private boolean yawlExportGroups = false;

// GPT settings
private String gptApiKey = "";
private boolean gptShowAgain = true;
private String gptPrompt = "Create a clearly structured and comprehensible continuous text from the given BPMN that is understandable for an uninformed reader. The text should be easy to read in the summary and contain all important content; if there are subdivided points, these are integrated into the text with suitable sentence beginnings in order to obtain a well-structured and easy-to-read text. Under no circumstances should the output contain sub-items or paragraphs, but should cover all processes in one piece!";
private boolean gptUseNew = false;
private String gptModel = null;

public boolean isGptUseNew() {
return gptUseNew;
}

public void setGptUseNew(boolean gptUseNew) {
this.gptUseNew = gptUseNew;
}
public boolean getGptUseNew(){
return gptUseNew;
}

public void setGptModel(String gptModel) {
this.gptModel = gptModel;
}

public String getGptModel() {
return gptModel;
}

public DefaultStaticConfiguration() {
initConfig();
}
Expand Down Expand Up @@ -919,29 +945,29 @@ public ApromoreServer[] getApromoreServers() {

@Override
public void addApromoreServer(
int ID,
String name,
String url,
int port,
String path,
String user,
String pwd,
boolean useProxy,
String proxyUrl,
int proxyPort) {}
int ID,
String name,
String url,
int port,
String path,
String user,
String pwd,
boolean useProxy,
String proxyUrl,
int proxyPort) {}

@Override
public void changeApromoreServerSettings(
int ID,
String name,
String url,
int port,
String path,
String user,
String pwd,
boolean useProxy,
String proxyUrl,
int proxyPort) {}
int ID,
String name,
String url,
int port,
String path,
String user,
String pwd,
boolean useProxy,
String proxyUrl,
int proxyPort) {}

@Override
public void removeApromoreServer(int index) {}
Expand Down Expand Up @@ -1083,4 +1109,35 @@ public boolean isYAWLExportGroups() {
public void setYAWLExportGroups(boolean exportGroups) {
this.yawlExportGroups = exportGroups;
}

// GPT settings
@Override
public String getGptApiKey() {
return gptApiKey;
}

@Override
public void setGptApiKey(String apiKey) {
this.gptApiKey = apiKey;
}

@Override
public boolean getGptShowAgain() {
return gptShowAgain;
}

@Override
public void setGptShowAgain(boolean showAgain) {
this.gptShowAgain = showAgain;
}

@Override
public String getGptPrompt() {
return gptPrompt;
}

@Override
public void setGptPrompt(String prompt) {
this.gptPrompt = prompt;
}
}
Loading
Loading