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

Interface to Browse the Domino Server Databases #40

Closed
JoelProminic opened this issue Sep 6, 2023 · 31 comments
Closed

Interface to Browse the Domino Server Databases #40

JoelProminic opened this issue Sep 6, 2023 · 31 comments
Assignees
Labels
bug Something isn't working

Comments

@JoelProminic
Copy link
Contributor

We would like to add an interface that will provide a better way for the user to browse the databases in the Domino Directory.

This should provide options to view the databases as a list or by icons.

@dpastov and I will provide an agent based on the DbDirectory API

TODO: fill in more details

@JoelProminic JoelProminic added the bug Something isn't working label Sep 6, 2023
@JoelProminic JoelProminic added this to the Super.Human.Portal v0.1.9 milestone Sep 6, 2023
@JoelProminic
Copy link
Contributor Author

JoelProminic commented Sep 27, 2023

@dpastov sent an example of the API. I won't include the original example here since it is for a Prominic server.

For this UI, the user will need to enter a server name that the Domino server has access to. This should default to the local server.

I'll need to create a new Java agent that uses @dpastov's code, which will take the server name as a parameter. UPDATE: To clarify, I expect this agent to be in SuperHumanPortal.nsf. It will only have access to other servers that the Server Admin has access to. For standalone SuperHumanImporter cases, I would generally expect the user to only have access to the same server.

The data will look something like this:

[
  {
    "title": "Base Level Example",
    "filePath": "BaseLevel.nsf",
    "replica": "...",
    "size": 6029312
  },
  {
    "title": "Multi-Level Example",
    "filePath": "A55XXX/nested/MultiLevelExample.nsf",
    "replica": "...",
    "size": 3921412096
  },
  ...

We will then want to organize these entries into an interface resembling a file browser. @JustinProminic suggested that we show the last two levels of nesting only using an interface similar to what we recently worked on for (SH-Meeting-Minutes](https://github.com/prominic/SH-Meeting-Minutes/issues/10) (Private). Note that there is not a lot of information to display for the databases currently, so we may wan to consider a more compact interface.

And then from this interface, the user will be able to select a database and automatically create a Database Bookmark in Custom Bookmarks. We'll need to show a simple form that will allow the user to select a category.

@piotrzarzycki21
Copy link
Contributor

-- Bookmarks
-- Browse My Server

@JoelProminic
Copy link
Contributor Author

Here is the LotusScript code used by @dpastov's agent:

Option Public
Option Declare

Sub Initialize
	On Error GoTo errh
	
	Dim session As NotesSession
	Dim dbDir As NotesDbDirectory
	Dim db As NotesDatabase
	Dim jsonNav As NotesJSONNavigator
	Dim jsonObj As NotesJSONObject
	
	Set session = New notessession
	Set dbDir = New NotesDbDirectory("")
	
	Set jsonNav = session.Createjsonnavigator("[]")
	
	' Loop through all databases on the server
	Set db = dbDir.GetFirstDatabase(DATABASE)
	While Not db Is Nothing
		Set jsonObj = jsonNav.appendObject()
		
		Call jsonObj.Appendelement(db.Title, "title")
		Call jsonObj.Appendelement(db.FilePath, "filePath")
		Call jsonObj.Appendelement(db.Replicaid, "replica")
		Call jsonObj.Appendelement(db.Size, "size")
		
		' Get the next database
		Set db = dbDir.GetNextDatabase
	Wend
	
	' Print or use the JSON string as needed
	Print "Status: 200"
	Print "Content-Type: application/json"
	Print jsonNav.stringify

	Exit sub
errh:
	Print "Status: 500"
	Print "Content-Type: text/html"
	Print "<h1>Server Error</h1><p>" & Error$ & " (" & CStr(erl) & ")</p>"
End Sub

I should be able to quickly do some thing similar for Java.

@JustinProminic confirmed that we want to enable this lookup for the local sever only at this point. We could consider adding a parameter to lookup other servers later.

@JoelProminic
Copy link
Contributor Author

JoelProminic commented Oct 17, 2023

A key feature for this interface will be integration with the custom bookmarks:

  • Show which databases already have bookmarks. I will add a property to indicate this
  • Quickly create bookmarks for the databases, populating the server and database automatically. The label can also be populated with the title.
  • Quickly delete bookmarks, with a confirmation prompt. To support this, I will need to include a key for the bookmark document (which may also server as the flag to indicate that there is an existing bookmark.
    • Note that a database can have multiple associated bookmarks, with different views and/or labels. We'll need to think about how to handle this case.
    • UPDATE: After discussing the multiple associated bookmark issue, the Delete action is a lower priority for now
  • UPDATE: we also need a way to open the displayed database in the Notes Client/Nomad from the database browsing interface. I could generate the link JSON for this.

I'll need to add a view to lookup bookmarks based on the server and database name.

@JoelProminic
Copy link
Contributor Author

The new GUI for this should be displayed under the Bookmarks menu: Bookmarks > Browse My Server. This entry should always exist, so that the user can add more databases later. When the user opens the database, they should see a an interfaces showing the databases from the JSON agent, organized using the tab interface we have been working on for SH-Meeting-Minutes.

@JoelProminic
Copy link
Contributor Author

JoelProminic commented Oct 24, 2023

Thinking about this further, I think it makes more sense to reuse the link format for the JSON:

  • Populate Name with the database title
  • add "hasBookmark" and "replicaID"
  • Optionally add "bookmarkCount" and "bookmarks"
          {
            "name": "Oil Services Products",
            "type": "database",
            "url": "notes://demo.STARTcloud.com/Customer/Products.nsf"
            "nomadURL": "...TODO..."
            "server": "demo.STARTcloud.com/STARTcloud",
            "database": "Customer/Products.nsf",
            "view":"",
            "replicaID":"...",
            "hasBookmarks":true,
            "bookmarkCount":1,
            "bookmarks:[
                ... possible future feature ...
            ]
          }

@JoelProminic
Copy link
Contributor Author

We made a mockup for this interface during the meeting:
image

@JoelProminic
Copy link
Contributor Author

I spent some time on the agent today, but I'm running into some unexpected errors on the imported agent. I'll continue investigating this, and hopefully I'll have something ready tomorrow. (FYI, there is another urgent task that may distract me from this).

@piotrzarzycki21
Copy link
Contributor

Thinking about this further, I think it makes more sense to reuse the link format for the JSON:

  • Populate Name with the database title
  • add "hasBookmark" and "replicaID"
  • Optionally add "bookmarkCount" and "bookmarks"
          {
            "name": "Oil Services Products",
            "type": "database",
            "url": "notes://demo.STARTcloud.com/Customer/Products.nsf"
            "nomadURL": "...TODO..."
            "server": "demo.STARTcloud.com/STARTcloud",
            "database": "Customer/Products.nsf",
            "view":"",
            "replicaID":"...",
            "hasBookmarks":true,
            "bookmarkCount":1,
            "bookmarks:[
                ... possible future feature ...
            ]
          }

@JoelProminic Quick question - your agent will return above items and I don't actually bother what Dmytro API returns, because you simply call it and I'll get above array of objects ?

piotrzarzycki21 added a commit that referenced this issue Oct 27, 2023
- Initial parsing logic for TopMenu (reference #40)
@JoelProminic
Copy link
Contributor Author

Right, the agent I'm working on will use the format from this comment rather than the format from Dmytro's agent. I chose this format to match the format for links/bookmarks.

My agent is almost done, but I ran into trouble with DXL Importer in my tests. I was busy yesterday with another task, but I'll try to make time to debug my agent today.

@JoelProminic
Copy link
Contributor Author

@piotrzarzycki21, I pushed an initial version of the agent so that you had something to get started. You will only need to deploy the agents with this database (later updates will include a database update). Incomplete components:

FYI, I'm still getting DXL Importer errors on the Super.Human.Installer servers. If you start getting agent errors after the update, then revert to the last database copy I sent you and let me know. I didn't make any changes to the DXL importer scripts recently, so I don't know why I'm getting problems.

@piotrzarzycki21
Copy link
Contributor

@JoelProminic after deploying your agents I'm getting following on application startup:

"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html lang=\"en\">\n<head>\n<title>Server Login</title>\n<script language=\"JavaScript\" type=\"text/javascript\">\n<!-- \nfunction doError(){return true;};window.onerror=doError;\n// -->\n</script>\n</head>\n<body text=\"#000000\" onLoad=\"document.forms[0].username.focus(); document.forms[0].username.select();\" bgcolor=\"#FFFFFFFF\">\n\n<form method=\"post\" action=\"/names.nsf?Login\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#FFFFCC\">\n<tr><td width=\"100\">&nbsp;</td><td><h1>Server Login</h1>Please type your user name and password<br>\n</td><td width=\"100\">&nbsp;</td></tr>\n\n<tr><td height=\"20\" colspan=\"3\">&nbsp;</td></tr>\n\n<tr><td width=\"100\" align=\"right\"><label for=\"user-id\">&nbsp;User name:&nbsp;&nbsp;</label></td><td>\n<input type=\"text\" size=\"20\" maxlength=\"256\" name=\"username\" id=\"user-id\"></td><td>&nbsp;</td></tr>\n\n<tr><td width=\"100\" align=\"right\"><label for=\"pw-id\">Password:&nbsp;&nbsp;</label></td><td>\n<input type=\"password\" size=\"20\" maxlength=\"256\" name=\"password\" id=\"pw-id\" autocomplete=\"off\">\n<input type=\"hidden\" name=\"redirectto\" value=\"/SuperHumanPortal.nsf/ConfigRead?OpenAgent\"></td><td>&nbsp;</td></tr>\n\n<tr><td height=\"20\" colspan=\"3\">&nbsp;</td></tr>\n\n<tr><td width=\"100\">&nbsp;</td><td>\n<input type=\"submit\" value=\"Log In\"></td><td>&nbsp;</td></tr>\n\n<tr><td height=\"20\" colspan=\"3\">&nbsp;</td></tr>\n</table>\n</form>\n</body>\n</html>\n"

VM1423:1 Uncaught SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at model.proxy.login.ProxyLogin.model_proxy_login_ProxyLogin_onGeneralConfigurationLoaded (ProxyLogin.js:227:43)
    at org.apache.royale.events.EventDispatcher.fireListeners (EventDispatcher.js:113:23)
    at goog.events.EventTarget.dispatchEventInternal_ (eventtarget.js:381:26)
    at org.apache.royale.events.EventDispatcher.dispatchEvent (EventDispatcher.js:88:37)
    at org.apache.royale.core.ElementWrapper.dispatchEvent (ElementWrapper.js:223:76)
    at org.apache.royale.net.HTTPService.progressHandler (HTTPService.js:198:10)

piotrzarzycki21 added a commit that referenced this issue Oct 30, 2023
- Add initial version of parsing data from backend (reference #40)
piotrzarzycki21 added a commit that referenced this issue Oct 30, 2023
piotrzarzycki21 added a commit that referenced this issue Oct 30, 2023
piotrzarzycki21 added a commit that referenced this issue Oct 30, 2023
- Fix width of TopMenu (reference #40)
piotrzarzycki21 added a commit that referenced this issue Oct 31, 2023
piotrzarzycki21 added a commit that referenced this issue Oct 31, 2023
- Working Copy to Clipboard buttons (reference #40)
@JoelProminic
Copy link
Contributor Author

Sorry, I missed your update earlier. This looks like the same error I am getting when importing the agents. I don't know what has changed to cause this - I only see changes to the src code and the agentProperties configuration, and I confirmed that the old agents are failing as well.

@piotrzarzycki21
Copy link
Contributor

Question is what could help you debug that stuff ? After deploying your agents released Super Human Portal stopped working as well.

piotrzarzycki21 added a commit that referenced this issue Nov 7, 2023
piotrzarzycki21 added a commit that referenced this issue Nov 7, 2023
piotrzarzycki21 added a commit that referenced this issue Nov 7, 2023
@piotrzarzycki21
Copy link
Contributor

Some notes from the meeting today:

  • Scroll is not working for sidebar control. We discussed whether it would make sense to have separate scroll bars for the two columns

  • Sorting

    • Folders should be displayed at the top
    • Otherwise, the entries should be sorted alphabetically
  • Make it more clear which entries are folders.

    • Add an icon?
    • Add a "/" after the label?
  • What to display before a database is selected

    • summary of features for this interface
    • alternative iterface for displaying the databases/folders in this directory
  • Change how current selection is displayed at top of browse bar

    • Try prefixing with "Selection: "
  • We would like the action buttons for the database to be in more prominent location. Currently, they feel lost at the bottom with the Copy to Clipboard buttons

    • Updating order: Open in Client | Open in Nomad | Add Bookmark
  • Copy to Clipboard

    • change to icon
    • move closer to text - we use more horizontal space for this interface compared to the bookmarks interface.
  • Future feature: Hide default templates, or the templates in general (.ntf)

  • Refresh button. This will probably be rarely used, but we would like to have it if needed.

Apart of Future feature - all issues has been addressed.

@JoelProminic
Copy link
Contributor Author

JoelProminic commented Nov 7, 2023

We reviewed the file browser interface with Doug today, and he requested some changes.

  • Use pure black text for the folders - the current grey text doesn't have enough contrast
  • [ x] Add keybindings for the Next and Previous buttons to the left and right arrow keys. -> Add keybindings for the Next and Previous buttons to the left and right arrow keys. #47
  • Change the hamburger icon to a right or left arrow, to indicate expand or collapse. Hamburger menus usually indicate a dropdown
  • If a level of nesting is hidden in the sidebar, show a thin column with arrows or ... to indicate a hidden columns. Here is how it looks in macOS Finder:

image

piotrzarzycki21 added a commit that referenced this issue Nov 8, 2023
piotrzarzycki21 added a commit that referenced this issue Nov 8, 2023
piotrzarzycki21 added a commit that referenced this issue Nov 8, 2023
piotrzarzycki21 added a commit that referenced this issue Nov 8, 2023
piotrzarzycki21 added a commit that referenced this issue Nov 8, 2023
@piotrzarzycki21
Copy link
Contributor

@JoelProminic I have made couple of improvements before today's call. I did also fix issue where clicking on "Menu" in breadcrump didn't refresh properly menu items. I did not fix yet issue which you have discovered during call with deeply nested elements, but my changes may influence that scenario - something which I need to check.

@piotrzarzycki21
Copy link
Contributor

piotrzarzycki21 commented Nov 8, 2023

@piotrzarzycki21
Copy link
Contributor

I have splited remaining bugs/enhancements to separate issues #47 and #48. I'm closing this one.

@JoelProminic
Copy link
Contributor Author

I'm reopening this issue so that I remember to implement the agent-side logic for hasBookmarks.

@JoelProminic
Copy link
Contributor Author

Test Found bookmarks Notes
Create a bookmark from the Browse My Server interface Yes
Create a bookmark manually that matches a database Yes
No bookmarks for database No I compared my updated JSON to the full output of the old agent version, and did not see any mismatches until I started adding bookmarks
Multiple matching bookmarks Yes
Case mismatch Yes
Server includes /ORG Yes
Server does not include /ORG Yes The Browse My Server Add button includes the organization, but a manually entered database may not (and it is not required).
Leading character on server name` No
Trailing character on database name No
Leading and trailing whitespace on server Yes
Leading and trailing whitespace on database Yes

For the whitespace cases, I made a small update to the link code to trim the database string when building the Notes and Nomad URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants