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

Saving and reopening the state of a client frame #3

Open
tompabompa opened this issue Nov 9, 2022 · 15 comments
Open

Saving and reopening the state of a client frame #3

tompabompa opened this issue Nov 9, 2022 · 15 comments
Labels
enhancement New feature or request

Comments

@tompabompa
Copy link

Is this a reasonable wish? I love having the opportunity to do REST calls inside my IDE, but the effort of setting up the calls every time I start up NetBeans makes it rather difficult using this plugin long term so far. Otherwise, I really like the functionality.

@javierllorente
Copy link
Owner

URL and params are saved if you don't close the tab.

@tompabompa
Copy link
Author

I'm running NetBeans 15 on Ubuntu Linux, and my defined REST tabs are not reopened the next time I start the IDE.
Furthermore, running different projects at different times increases the need of defining different tabs or - even better - groups of tabs to reload to match the current needs.
Is it perhaps possible to connect REST windows to Project groups? That would really be convenient.
Just some humble opinions.

@javierllorente
Copy link
Owner

I'm running NetBeans 15 on Ubuntu Linux, and my defined REST tabs are not reopened the next time I start the IDE.

Could you please attach the IDE log?

Is it perhaps possible to connect REST windows to Project groups? That would really be convenient.

Nice suggestion. I have to investigate it.

@Chris2011
Copy link
Contributor

I'm willing to implement a history. My idea is to add opened tabs with configuration as a new Maintab in services "REST" or smth similar "History of REST Clients" and each connection will be a new node. If you double click on it, it will open a new tab with all the saved stuff that you already sent. Just sending, not also doing the send, you need to trigger the send automatically.

This is just an idea, I think it fits best with the services tab with a new node. It would be better to have a save button to not do it automatically, just when you click on save. Maybe we can create a discussion for this (if the section will be enabled) to discuss more :)

@javierllorente
Copy link
Owner

This would leave an inconsistency. SQL queries are opened as tabs - they aren't displayed in Services.
BTW, There is already the "Web Services" entry under Services. It is not the same, but similar.
On the other hand, having a node in services for REST requests would make it more organised, instead of having scattered tabs. The REST request tabs would be detached from the project, right?

@javierllorente javierllorente added the enhancement New feature or request label Jan 11, 2023
@Chris2011
Copy link
Contributor

Maybe I have expressed myself in a misleading way. Of course every connction should open a new tab, this is just fine. I just want to save every tab as a separate node in services. And if you double click on it or right click -> open it should open it as a new tab. So the current tab will be opened and is visible as the current behaviour. You can think of it just like the webservices or the tables inside the service section.

The tabs are independent from the project as it is now. We can also add a function like "Add this connection to a project" So that you have your made requests as nodes under a project. But problem here is, that there is no general API for projects, we need to add each project type manually. And if NetBeans or any other Plugin adds a new project type, we need to add this too.

@javierllorente
Copy link
Owner

Instead of having, let's say history as you type in the URL bar, we would have it as a Service node. Very convenient. Especially if the user can make groups to organise queries.

I would also leave tabs independent from the project as it is now.

@Chris2011
Copy link
Contributor

Exactly. The service nodes are just the history of what I had open as tabs. Nothing more.

@studio42gmbh
Copy link

Another potential idea would be to have a file type (https://netbeans.apache.org/tutorial/main/tutorials/nbm-filetype/) with a json contained that can be either viewed as source or used as rest request a bit analogous to for example visual Swing components. I would love to use this plugin but without ability to store state per project it does not provide me with the value i would need to do preconfigured calls. Currently i use RESTED in Firefox (https://addons.mozilla.org/en-US/firefox/addon/rested/).
Anyways thanks for your efforts! :)

@javierllorente
Copy link
Owner

@studio42gmbh Thanks for your idea. I think it's related to issue #8. The JSON format could be Postman's or we could define our own.

@studio42gmbh
Copy link

@studio42gmbh Thanks for your idea. I think it's related to issue #8. The JSON format could be Postman's or we could define our own.

I found a nice file creating a part of the postman within the rested code: https://github.com/RESTEDClient/RESTED/blob/master/src/utils/export.js
I think thats a good starting point for the JSON format.
Also here is the RESTED internal request format: https://github.com/RESTEDClient/RESTED/blob/master/src/propTypes/request.js
Would be cool if you could extend it would love to use NB integrated instead of RESTED in Firefox.

If you want some ideas to an extended file integration - I did one some time ago with a custom tab etc.: https://github.com/studio42gmbh/dlnetbeans/blob/main/src/main/java/de/s42/dl/netbeans/editing/DLEditorPanel.java

Cheers
Ben

@Chris2011
Copy link
Contributor

@studio42gmbh please don't mix ideas for different cases. This ticket here is just for saving the session and has nothing todo with a JSON to export. It should be related to #8 what @javierllorente mentioned. And yes we should stick with just one formt and not create our own. We should use the tools that we want and if someone uses NB fine, if someone uses Postman also fine, but we should make it possible to ship it between those too. I don't know the format of chrome or firefox, hopefully the same.

@studio42gmbh
Copy link

@Chris2011 the topic is connected on how to approach the need for having past queries made available to the user.
One way is state and history - which is good.
But instead of having the current window with only 1 history (which might contain many queries of different calls and projects) i was thinking of making the storing of queries file based so you can have multiple canned queries.
Thats why i think it is also related to this ticket and is by that not only a export, but a persistence mechanism.
I am fine to put that even in another ticket (and its not #8 as this is about importing and exporting ...) but i think thats on @javierllorente as he owns the repo :)

Cheers all
Ben

@Chris2011
Copy link
Contributor

It will be a persistance state and you will find all of them in the services tab under a new node. This is in my mind and just my idea beacuse this services tab is made more or less for external stuff. So also it will be file based, because the nodes will come from a file with the data. Maybe it can be the same format of postman then we will hit 2 things with one but thats a bigger task.

@studio42gmbh
Copy link

@Chris2011 ok that sound nice :) - i wouldnt bother with the postman format there i guess - gives you more freedom on storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants