Skip to content

Commit 74dd227

Browse files
Update plugin version
1 parent e924872 commit 74dd227

File tree

12 files changed

+41
-26
lines changed

12 files changed

+41
-26
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
5. [Setup](#setup)
1414
- [Authentication](#authentication)
1515
- [Plugin Installation](#plugin-installation)
16+
- [Plugin Configuration](#plugin-configuration)
1617
6. [Running the Guidance](#running-the-guidance)
1718
7. [Next Steps](#next-steps)
1819
8. [Cleanup](#cleanup)
@@ -184,7 +185,7 @@ This guidance utilizes the `AdministratorAccess` role for deployment. For use in
184185
```
185186
186187
### Plugin Installation
187-
1. From the main page of the GitHub repository, click **[Releases](https://github.com/aws-solutions-library-samples/guidance-for-improving-application-development-productivity-with-the-sap-abap-assistant-on-aws/releases)** . From the latest listed releae, download the SAP ABAP Assistant plugin zip file (for e.g. sap-abap-assistant-V1_0_17.zip) from the **Assets** section. Save the plugin zip file in your local file system.
188+
1. From the main page of the GitHub repository, click **[Releases](https://github.com/aws-solutions-library-samples/guidance-for-improving-application-development-productivity-with-the-sap-abap-assistant-on-aws/releases)** . From the latest listed releae, download the SAP ABAP Assistant plugin zip file (for e.g. sap-abap-assistant-V1_0_18.zip) from the **Assets** section. Save the plugin zip file in your local file system.
188189
189190
2. Open Eclipse IDE and choose **Help -> Install New Software**. Choose the **Add…** button. In the next dialog window, choose **Archive…** and select the zip file that you downloaded. Choose **Add**.
190191
@@ -212,6 +213,10 @@ Before using ABAP Assistant plugin , you need to set up the plugin preferences i
212213
213214
* **AWS Profile** – Enter the name of the AWS profile `abap-assistant` that you created
214215
216+
* **Prompt for ABAP Code** – The prompt for generating ABAP code is prepopulated. If required, you can change the prompt as per your requirements.
217+
218+
* **Prompt for Docmentation** – The prompt for generating ABAP documentation is prepopulated. If required, you can change the prompt as per your requirements.
219+
215220
The following screenshot shows the SAP ABAP Assistant plugin preferences page.
216221
217222
![SAP ABAP Assistant Preferences Page](assets/images/plugin-installation/SAP_ABAP_Assistant_Preferences_Page.png)
@@ -301,7 +306,7 @@ cd ./guidance-for-improving-application-development-productivity-with-the-sap-ab
301306
### Uninstall SAP ABAP Assistant Plugin
302307
If you want to unisntall the ABAP Assitant from Eclipse, proceed with the below steps:
303308
304-
1. In Eclipse IDE, navigate to **Help -> About Eclipse IDE** and then choose **Installation Details** to list the installed softwares.
309+
1. In Eclipse IDE, choose **Help -> About Eclipse IDE** (on Windows), or **Eclipse -> About Eclipse** (on MacOS) and then choose **Installation Details** to list the installed softwares.
305310
306311
![About Eclipse option in Eclipse IDE](assets/images/cleanup/about-eclipse.png)
307312
Loading

source/com.demo.abap_assistant_feature/feature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<feature
33
id="com.demo.abap_assistant_feature"
44
label="ABAP Assistant"
5-
version="1.0.17.qualifier"
5+
version="1.0.18.qualifier"
66
provider-name="DEMO">
77

88
<description>

source/com.demo.abap_assistant_feature/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
<version>1.0.0-SNAPSHOT</version>
99
<relativePath>../com.demo.abap_assistant_releng</relativePath>
1010
</parent>
11-
<version>1.0.17-SNAPSHOT</version>
11+
<version>1.0.18-SNAPSHOT</version>
1212
</project>

source/com.demo.abap_assistant_p2/category.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<feature url="features/com.demo.abap_assistant_feature_1.0.17.qualifier.jar" id="com.demo.abap_assistant_feature" version="1.0.17.qualifier">
3+
<feature url="features/com.demo.abap_assistant_feature_1.0.18.qualifier.jar" id="com.demo.abap_assistant_feature" version="1.0.18.qualifier">
44
<category name="ABAP_Assistant_category"/>
55
</feature>
66
<category-def name="ABAP_Assistant_category" label="ABAP Assistant"/>

source/com.demo.abap_assistant_plugin/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: ABAP_Assistant_plugin
44
Bundle-SymbolicName: com.demo.abap_assistant_plugin;singleton:=true
5-
Bundle-Version: 1.0.17.qualifier
5+
Bundle-Version: 1.0.18.qualifier
66
Require-Bundle: org.eclipse.ui,
77
org.eclipse.ui.workbench.texteditor;bundle-version="3.17.100",
88
org.eclipse.jface.text;bundle-version="3.24.100",

source/com.demo.abap_assistant_plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
<version>1.0.0-SNAPSHOT</version>
1010
<relativePath>../com.demo.abap_assistant_releng</relativePath>
1111
</parent>
12-
<version>1.0.17-SNAPSHOT</version>
12+
<version>1.0.18-SNAPSHOT</version>
1313
</project>

source/com.demo.abap_assistant_plugin/src/com/demo/abap_assistant_plugin/handlers/ABAPCodeHandler.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,11 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
7979
if (selectionProvider != null) {
8080
ISelection selection = selectionProvider.getSelection();
8181
ITextSelection textSelection = (ITextSelection) selection;
82-
System.out.println("Selected text = " + textSelection.getText());
8382

8483
try {
8584

8685
String selectedText = textSelection.getText().replaceAll("\\*", "").trim();
87-
System.out.println("promptText = " + selectedText);
86+
//System.out.println("promptText = " + selectedText);
8887

8988
if (!selectedText.equalsIgnoreCase("")) {
9089

@@ -95,26 +94,23 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
9594
// Anthropic Claude 2 Models
9695
if (modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE_MODEL_ID_V2)
9796
|| modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE_MODEL_ID_V2_1)) {
98-
String prompt = "\n\nHuman: " + ABAPAssistantConstants.PROMPT_ABAP_CODE
97+
String prompt = "\n\nHuman: " + ABAPAssistantHelper.getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE)
9998
+ selectedText + "\nAssistant:";
100-
System.out.println("Prompt is as follows \n" + prompt);
10199
result = ABAPAssistantModelHelper.invokeClaude2Models(prompt, modelID);
102100
doc.replace(doc.getLength(), 0, "\n" + result + "\n");
103101
}
104102
// Anthropic Claude 3 Models
105103
else if (modelID
106104
.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE3_MODEL_ID_SONNET)
107105
|| modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE3_MODEL_ID_HAIKU)) {
108-
String prompt = ABAPAssistantConstants.PROMPT_ABAP_CODE + selectedText;
109-
System.out.println("Prompt is as follows \n" + prompt);
106+
String prompt = ABAPAssistantHelper.getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE) + selectedText;
110107
result = ABAPAssistantModelHelper.invokeClaude3Models(prompt, modelID);
111108
doc.replace(doc.getLength(), 0, "\n" + result + "\n");
112109
}
113110
// AI21 Jurassic Model
114111
else if (modelID.equalsIgnoreCase(ABAPAssistantConstants.JURASSIC_MODEL_ID_MID)
115112
|| modelID.equalsIgnoreCase(ABAPAssistantConstants.JURASSIC_MODEL_ID_ULTRA)) {
116-
String prompt = ABAPAssistantConstants.PROMPT_ABAP_CODE + selectedText;
117-
System.out.println("Prompt is as follows \n" + prompt);
113+
String prompt = ABAPAssistantHelper.getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE) + selectedText;
118114
result = ABAPAssistantModelHelper.invokeJurassicModels(prompt, modelID);
119115
doc.replace(doc.getLength(), 0, "\n" + result + "\n");
120116
}

source/com.demo.abap_assistant_plugin/src/com/demo/abap_assistant_plugin/handlers/ABAPDocumentationHandler.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
7777
if (selectionProvider != null) {
7878
ISelection selection = selectionProvider.getSelection();
7979
ITextSelection textSelection = (ITextSelection) selection;
80-
System.out.println("Selected text = " + textSelection.getText());
8180

8281
try {
8382
String selectedText = textSelection.getText().trim();;
84-
System.out.println("promptText = " + selectedText);
83+
//System.out.println("promptText = " + selectedText);
8584

8685
if (!selectedText.equalsIgnoreCase("")) {
8786

@@ -92,21 +91,21 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
9291
//Anthropic Claude 2 Models
9392
if (modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE_MODEL_ID_V2) ||
9493
modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE_MODEL_ID_V2_1)) {
95-
String prompt = "\n\nHuman: " + ABAPAssistantConstants.PROMPT_ABAP_DOC + selectedText + "\nAssistant:";
94+
String prompt = "\n\nHuman: " + ABAPAssistantHelper.getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC) + selectedText + "\nAssistant:";
9695
result = ABAPAssistantModelHelper.invokeClaude2Models(prompt, modelID);
9796
ABAPAssistantHelper.writeToConsole(result, activePage);
9897
}
9998
//Anthropic Claude 3 Models
10099
else if (modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE3_MODEL_ID_SONNET) ||
101100
modelID.equalsIgnoreCase(ABAPAssistantConstants.CLAUDE3_MODEL_ID_HAIKU)) {
102-
String prompt = ABAPAssistantConstants.PROMPT_ABAP_DOC + selectedText;
101+
String prompt = ABAPAssistantHelper.getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC) + selectedText;
103102
result = ABAPAssistantModelHelper.invokeClaude3Models(prompt, modelID);
104103
ABAPAssistantHelper.writeToConsole(result, activePage);
105104
}
106105
//AI21 Jurassic Model
107106
else if (modelID.equalsIgnoreCase(ABAPAssistantConstants.JURASSIC_MODEL_ID_MID)||
108107
modelID.equalsIgnoreCase(ABAPAssistantConstants.JURASSIC_MODEL_ID_ULTRA)) {
109-
String prompt = ABAPAssistantConstants.PROMPT_ABAP_DOC + selectedText;
108+
String prompt = ABAPAssistantHelper.getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC) + selectedText;
110109
result = ABAPAssistantModelHelper.invokeJurassicModels(prompt, modelID);
111110
ABAPAssistantHelper.writeToConsole(result, activePage);
112111
}

source/com.demo.abap_assistant_plugin/src/com/demo/abap_assistant_plugin/helpers/ABAPAssistantConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class ABAPAssistantConstants {
3333
public static final String PREFERENCES_AWS_REGION = "AWS-REGION";
3434
public static final String PREFERENCES_MODEL_ID = "MODEL-ID";
3535
public static final String PREFERENCES_AWS_PROFILE = "AWS-PROFILE";
36+
public static final String PREFERENCES_PROMPT_CODE = "PROMPT-CODE";
37+
public static final String PREFERENCES_PROMPT_DOC = "PROMPT-DOC";
3638

3739
// Eclipse preferences Default constants
3840
public static final String PREFERENCES_AWS_REGION_DEFAULT = "us-east-1";

source/com.demo.abap_assistant_plugin/src/com/demo/abap_assistant_plugin/helpers/ABAPAssistantHelper.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static String getPreferences (String prefName) throws StorageException {
4848
ISecurePreferences prefs = SecurePreferencesFactory.getDefault();
4949
String prefvalue = "";
5050
prefvalue = prefs.get(prefName, "").trim();
51-
System.out.println(prefName+" = "+prefvalue);
51+
//System.out.println(prefName+" = "+prefvalue);
5252
return prefvalue;
5353
}
5454

@@ -90,7 +90,9 @@ public static BedrockRuntimeClient getBedrockClient () throws StorageException {
9090
public static boolean checkPreferences() throws StorageException {
9191
if(getPreferences(ABAPAssistantConstants.PREFERENCES_AWS_PROFILE).equals("")
9292
|| getPreferences(ABAPAssistantConstants.PREFERENCES_AWS_REGION).equals("")
93-
|| getPreferences(ABAPAssistantConstants.PREFERENCES_MODEL_ID).equals("")) {
93+
|| getPreferences(ABAPAssistantConstants.PREFERENCES_MODEL_ID).equals("")
94+
|| getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE).equals("")
95+
|| getPreferences(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC).equals("")){
9496
return false;
9597
}
9698
return true;

source/com.demo.abap_assistant_plugin/src/com/demo/abap_assistant_plugin/preferences/ABAPAssistantPreferences.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
public class ABAPAssistantPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
3737

3838

39-
StringFieldEditor awsRegion, modelId, awsProfile = null;
39+
StringFieldEditor awsRegion, modelId, awsProfile, promptCode, promptDoc = null;
4040

4141

4242
public ABAPAssistantPreferences() {
@@ -51,12 +51,17 @@ public void init(IWorkbench workbench) {
5151

5252
@Override
5353
protected void createFieldEditors() {
54-
awsRegion = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_AWS_REGION, "AWS Region", 25, getFieldEditorParent());
54+
awsRegion = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_AWS_REGION, "AWS Region", 35, getFieldEditorParent());
5555
addField((FieldEditor)awsRegion);
56-
modelId = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_MODEL_ID, "Model ID", 25, getFieldEditorParent());
56+
modelId = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_MODEL_ID, "Model ID", 35, getFieldEditorParent());
5757
addField((FieldEditor)modelId);
58-
awsProfile = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_AWS_PROFILE, "AWS Profile", 25, getFieldEditorParent());
58+
awsProfile = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_AWS_PROFILE, "AWS Profile", 35, getFieldEditorParent());
5959
addField((FieldEditor)awsProfile);
60+
promptCode = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE, "Prompt for ABAP Code", 55, getFieldEditorParent());
61+
addField((FieldEditor)promptCode);
62+
promptDoc = new StringFieldEditor(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC, "Prompt for Documentation", 55, getFieldEditorParent());
63+
addField((FieldEditor)promptDoc);
64+
6065
}
6166

6267
@Override
@@ -66,6 +71,8 @@ public boolean performOk() {
6671
pref.put(ABAPAssistantConstants.PREFERENCES_AWS_REGION, awsRegion.getStringValue(), true);
6772
pref.put(ABAPAssistantConstants.PREFERENCES_MODEL_ID, modelId.getStringValue(), true);
6873
pref.put(ABAPAssistantConstants.PREFERENCES_AWS_PROFILE, awsProfile.getStringValue(), true);
74+
pref.put(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE, promptCode.getStringValue(), true);
75+
pref.put(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC, promptDoc.getStringValue(), true);
6976
pref.flush();
7077
} catch (StorageException e) {
7178
e.printStackTrace();
@@ -83,6 +90,8 @@ protected Control createContents(Composite parent) {
8390
awsRegion.setStringValue(prefs.get(ABAPAssistantConstants.PREFERENCES_AWS_REGION, ""));
8491
modelId.setStringValue(prefs.get(ABAPAssistantConstants.PREFERENCES_MODEL_ID, ""));
8592
awsProfile.setStringValue(prefs.get(ABAPAssistantConstants.PREFERENCES_AWS_PROFILE, ""));
93+
promptCode.setStringValue(prefs.get(ABAPAssistantConstants.PREFERENCES_PROMPT_CODE, ABAPAssistantConstants.PROMPT_ABAP_CODE));
94+
promptDoc.setStringValue(prefs.get(ABAPAssistantConstants.PREFERENCES_PROMPT_DOC, ABAPAssistantConstants.PROMPT_ABAP_DOC));
8695
} catch (StorageException e) {
8796
e.printStackTrace();
8897
}
@@ -95,6 +104,8 @@ protected void performDefaults() {
95104
awsRegion.setStringValue(ABAPAssistantConstants.PREFERENCES_AWS_REGION_DEFAULT);
96105
modelId.setStringValue(ABAPAssistantConstants.PREFERENCES_MODEL_ID_DEFAULT);
97106
awsProfile.setStringValue(ABAPAssistantConstants.PREFERENCES_AWS_PROFILE_DEFAULT);
107+
promptCode.setStringValue(ABAPAssistantConstants.PROMPT_ABAP_CODE);
108+
promptDoc.setStringValue(ABAPAssistantConstants.PROMPT_ABAP_DOC);
98109
}
99110

100111

0 commit comments

Comments
 (0)