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

[Domino Visual Editor] Java Agent Support #1018

Open
JoelProminic opened this issue Apr 1, 2022 · 15 comments
Open

[Domino Visual Editor] Java Agent Support #1018

JoelProminic opened this issue Apr 1, 2022 · 15 comments
Assignees
Labels
domino HCL Domino Support editor Improvements or Bugs for Editor feature request

Comments

@JoelProminic
Copy link
Contributor

JoelProminic commented Apr 1, 2022

We would like to add support for Java Agents in Domino Visual Editor. The user will need to be able to edit the Java files normally, with language server support. The Java files will need to be compiled into the nsfodp project.

We will want to make it easy to have shared Java code in Script Libraries (#1019). If we don't make this part of the original implementation, we should make sure to add Script Library support soon after agents are available as a feature.

UPDATE: Branch: features/issue_1018_agent_support

@feather812002
Copy link
Collaborator

I check this into details, I found we must need the Java Agent.ja file in the /odp/Code/Agents/ folder.
The Java agent file format is special, so follow is my design .

  1. I inherit the Moonshine-IDE Basic Text Editor , add some method property, create a new Domino Java Code Editor.
  2. The Domino Java Code Editor will load source file from odp/Code/Java, when it save , it will create or update the corresponding Java agent file in the /odp/Code/Agents/
  3. I already have some similar code or login in the DXLImporter, so I think this is a feasible and easy plan .

@JoelProminic
Copy link
Contributor Author

I created a test database to test plain Java agents.
TestAgents_NormalJavaOnly.nsf.zip

For future updates (i.e. Script Libraries) I can update the database at:
blazeds.testprominic.com
A55D78/MoonshineTests/TestAgents.nsf

The agents are:

Agent Notes
NormalJava_DefaultClass JavaAgent.java
NormalJava_CustomClass Different class name
NormalJava_Package Does not ulse the default package
NormalJava_MultipleClasses Multiple classes. One class is in a package.

Each agent will print a message matching the name to the Java Debug Console.

@feather812002
Copy link
Collaborator

I got new some require from Justin on last Friday :
Have an interface in Moonshine that reflects the Domino Designer for a basic Java and LotusScript agent like what you see in these screenshots, We should have a way in Moonshine IDE to easily click and edit Java, LotusScript and ideally Formula agents from the NSFODP structure. and it very close model to the way Domino Designer displays this information.

I work around this in today , I got some Java agent and Lotus Script agent export.
For Java Agent :

  • Imported Java Agent , it can't be edit source code, and I already done this with DxlImporter before so many years ago.
  • Open source Java agent , the source code include in the dxl file and it also save as independent java file in other place ,
    I already got some source agent dxl from Flex.nsf and UNIFIED database.
    For LotusScript Agent:
  • I still get some LS agent dxl from above database.this should not be a problem.

For Formula Agent:
I not found a valid formula agent from UNITIF and FLEX database, so @JoelProminic
Can you find a existed NSF database contain some fomrula agent for my test ?
I no one database meet this point ,I will create a new nsf database to do this .

@feather812002
Copy link
Collaborator

LotusScript editor UI:
image
Java Agent Editor UI -1:
image

Jave Agent Editor UI -2:
image

Formula Agent Editor UI:
image

So, the Java agent have more complex UI on the create , it can create any class file with tree structure on the first.

And then convert to the editor UI.

The Formula Agent editor UI more easy , I already done some similar UI in the Object options UI.

@feather812002
Copy link
Collaborator

<?xml version='1.0' encoding='utf-8'?>
<agent name='formula' xmlns='http://www.lotus.com/dxl' version='12.0' maintenanceversion='1.0'
 replicaid='C2258AB7003FBBBE' hide='v3' publicaccess='false' designerversion='8.5.3'>
<noteinfo noteid='1ee' unid='40372132649EFAA0C2258AD7005A0E69' sequence='3'>
<created><datetime dst='true'>20240305T192339,29+03</datetime></created>
<modified><datetime dst='true'>20240313T140946,65+03</datetime></modified>
<revised><datetime dst='true'>20240313T140946,64+03</datetime></revised>
<lastaccessed><datetime dst='true'>20240313T140946,64+03</datetime></lastaccessed>
<addedtofile><datetime dst='true'>20240305T192340,79+03</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Demo Admin/O=DEMO</name></updatedby>
<wassignedby><name>CN=Demo Admin/O=DEMO</name></wassignedby>
<designchange><datetime dst='true'>20240313T140945,85+03</datetime></designchange>
<trigger type='actionsmenu'/>
<documentset type='selected'><search type='multiplewords' all='true'><word
>Title</word><word>subject</word></search></documentset><code event='action'>
<simpleaction action='runformula'><formula>@Text("test");
SELECT @All</formula></simpleaction></code>
<rundata processeddocs='0' exitcode='0'>
<agentmodified><datetime dst='true'>20240313T140946,48+03</datetime></agentmodified></rundata></agent>

Document selection xml:

<documentset type='selected'><search type='multiplewords' all='true'><word
>Title</word><word>subject</word></search></documentset>

@feather812002
Copy link
Collaborator

Formula agent document selection is simple search
image
image

So, do you should add this at now ?
Or just ignore it ?

@JoelProminic
Copy link
Contributor Author

I haven't used the document selection filter for Formula agents, so let's use the default for now and come back to this later. I'd like to get basic examples working for the other agent types before we go too deep into one type.

@feather812002
Copy link
Collaborator

image

LotusScript Designer IDE prompt list

@feather812002
Copy link
Collaborator

LotusScript agent example:

<?xml version='1.0' encoding='utf-8'?>
<agent name='llllllll' xmlns='http://www.lotus.com/dxl' version='12.0' maintenanceversion='1.0'
 replicaid='C2258AB7003FBBBE' hide='v3' publicaccess='false' designerversion='8.5.3'>
<noteinfo noteid='1e2' unid='6BA3A55CCAF78C3DC2258AD70059C60D' sequence='13'>
<created><datetime dst='true'>20240305T192034,05+03</datetime></created>
<modified><datetime dst='true'>20240314T153459,24+03</datetime></modified>
<revised><datetime dst='true'>20240314T153459,23+03</datetime></revised>
<lastaccessed><datetime dst='true'>20240314T153459,23+03</datetime></lastaccessed>
<addedtofile><datetime dst='true'>20240305T192034,08+03</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Demo Admin/O=DEMO</name></updatedby>
<wassignedby><name>CN=Demo Admin/O=DEMO</name></wassignedby>
<designchange><datetime dst='true'>20240314T153459,23+03</datetime></designchange>
<trigger type='actionsmenu'/>
<documentset type='selected'/><code event='options'><lotusscript>%REM
	Agent llllllll
	Created Mar 5, 2024 by Demo Admin/DEMO
	Description: Comments for Agent
%END REM
Option Public
Option Declare


</lotusscript></code><code event='declarations'><lotusscript>'this Decliaration
Dim s As Long

</lotusscript></code><code event='initialize'><lotusscript>Sub Initialize
	'llll
	Dim session As NotesSession
	Dim doc As NotesDocument
End Sub

</lotusscript></code><code event='terminate'><lotusscript>Sub Terminate
	'this is terminate
	Dim doc As NotesDocument
End Sub</lotusscript></code>
<rundata processeddocs='0' exitcode='0'>
<agentmodified><datetime dst='true'>20240314T153458,66+03</datetime></agentmodified></rundata></agent>

@feather812002
Copy link
Collaborator

image
agent property setting

Java Agent property UI
image

@JoelProminic
Copy link
Contributor Author

I also use the Security tab frequently:
image

In particular, I need to change the Runtime Security Level in order to run some agents.

I haven't used the "Default access" section. The user list here will probably need to be populated by the user in the initial version, but we may be able to populate it based on the target server with a solution based on #1240.

Java Agents also support Document Selection, but only when the Target is "All selected documents". See the notes above for this feature in Formula agents:
image

feather812002 added a commit to Moonshine-IDE/MockupVisualEditor that referenced this issue Mar 28, 2024
@JoelProminic
Copy link
Contributor Author

image

For the "Run on" property, Designer shows these options:

  • Local
  • -Any Server-
  • Other - this opens another popup with a list of server. I'm not sure if they are servers I have accessed, or servers where I have connections/cross-ceritifcate documents.
  • A list of servers, similar to what I see in the Other popup

For our implementation, have "Other" show a new text input where the server can be entered freely.

Once we implement #1240, we can use the server list defined in Moonshine, but I think we would still want the text-input option.

@feather812002
Copy link
Collaborator

Lotus Script agent example

<?xml version='1.0' encoding='utf-8'?>
<agent name='(llllllll)' alias='(alisa)' xmlns='http://www.lotus.com/dxl'
 version='12.0' maintenanceversion='1.0' replicaid='C2258AB7003FBBBE' hide='v3'
 showinsearch='true' runaswebuser='true' publicaccess='false' designerversion='8.5.3'
 comment='comment' profile='true' storehighlights='true'>
<noteinfo noteid='1e2' unid='6BA3A55CCAF78C3DC2258AD70059C60D' sequence='17'>
<created><datetime dst='true'>20240305T192034,05+03</datetime></created>
<modified><datetime dst='true'>20240401T160412,75+03</datetime></modified>
<revised><datetime dst='true'>20240401T160412,74+03</datetime></revised>
<lastaccessed><datetime dst='true'>20240401T160412,74+03</datetime></lastaccessed>
<addedtofile><datetime dst='true'>20240305T192034,08+03</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Demo Admin/O=DEMO</name></updatedby>
<wassignedby><name>CN=Demo Admin/O=DEMO</name></wassignedby>
<designchange><datetime dst='true'>20240401T160412,74+03</datetime></designchange>
<trigger type='agentlist'/>
<documentset type='all'/><code event='options'><lotusscript>%REM
	Agent llllllll
	Created Mar 5, 2024 by Demo Admin/DEMO
	Description: Comments for Agent
%END REM
Option Public
Option Declare


</lotusscript></code><code event='declarations'><lotusscript>'this Decliaration
Dim s As Long

</lotusscript></code><code event='initialize'><lotusscript>Sub Initialize
	'llll
	Dim session As NotesSession
	Dim doc As NotesDocument
End Sub

</lotusscript></code><code event='terminate'><lotusscript>Sub Terminate
	'this is terminate
	Dim doc As NotesDocument
End Sub</lotusscript></code>
<rundata processeddocs='0' exitcode='0'>
<agentmodified><datetime dst='true'>20240401T160411,94+03</datetime></agentmodified></rundata></agent>

@JoelProminic
Copy link
Contributor Author

Scheduling options:

"More than once per day"
image

"Daily"
image

"Weekly"
image

"Monthly"
image

"Never"
Disable schedule button

@JoelProminic
Copy link
Contributor Author

@feather812002 reported two Trigger options that had additional settings. He is already working on these:

image
image

feather812002 added a commit to Moonshine-IDE/MockupVisualEditor that referenced this issue Apr 11, 2024
feather812002 added a commit to Moonshine-IDE/MockupVisualEditor that referenced this issue Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domino HCL Domino Support editor Improvements or Bugs for Editor feature request
Projects
Moonshine-IDE - Bug Fixing
  
Awaiting triage
Development

No branches or pull requests

2 participants