1. Benjamin Ducke
  2. Valentina Studio
  3. Четверг, Август 15 2024, 09:35 AM
  4.  Подписаться через email
Dear All,

I am new to Valentina Studio, and I am scratching my head over how to achieve a simple thing:

Launch Valentina Studio from the command line, so that it will automatically open a database contained in a VSP project file and run the "startup" script for that database.

I have been trying to achieve this with the sample database "car_catalog_python.vsp", which ships with Valentina Studio. I have tried the CLI options mentioned in the documentation, but no luck. Since Valentina Studio also issues no error messages (either to the console or the GUI), I have no clue what I might be doing wrong.

My goal is to find a way for deploying databases for a target group that knows nothing about Valentina, SQL or client/server DBMS technology. These people will be completely overwhelmed with Valentina Studio, its functions and terminology. Ideally, it should be possible to hide all that complexity from them, by just launching Valentina Studio with the database they need, and they should never have to interact with Valentina Studio itself (a "headless mode", so to speak).

Can somebody help? What might be the best way to achieve my goal with Valentina technology?

Thanks for any help with this!

Benjamin
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Benjamin,

Is the startup script simply SQL, or does it involve more complex logic?
After executing the script, should Valentina Studio remain open or be closed?

At the moment, it's possible to run a form from the CLI. A form has a 'created' slot that is executed after the form is created, where you could potentially add such a script.

Pure SQL can be executed more easily without a project, but all connection parameters must be specified in the command line. The app will remain running after execution.
Комментарий
There are no comments made yet.
Benjamin Ducke Ответ принят
Hi Sergey,

I would like to start Valentina Studio in such a way that it automatically loads a database, and then displays the initial (main) database form.

As I understand it, having a (Python or JavaScript) called "startup" in the database project is a standard entry point for auto-start actions in Valentina Studio. But this will work only after Valentino Studio has been started, a database project file (.vsp) has been manually opened, and the user manually clicks on "Execute". That would already be too much for some of the users that I have in mind.

So the automated sequence that I am looking for would be:

1. Valentina Studio (VS) starts up.
2. VS automatically opens a database project file (e.g. "myproject.vsp";)
3. The "startup" script within "myproject.vsp" is automatically launched.
4. The initial form specified in "startup" is displayed and people can begin using the database via the form.

I would like to be able to simply write a Batch/Shell script to take care of step 1, supplying the path to "myproject.vsp" as a Valentina CLI option. Everything else should be taken care of by Valentina Studio.

Ideally, this sequence would only display the initial form to the user and would also automatically shut down Valentina Studio if the initial form is closed. Handling Valentina Studio and navigating to a database using it is too involved a procedure for some of the people in my deployment target group. Also, once Valentina Studio is running, users will have access to tabular representations of the data, the SQL command line, etc. That is going to confuse them totally in the best cast and will allow them to do some real damage to the data in the worst case.

Maybe what I am looking for can only be achieved via the ADK?

Best,

Benjamin
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
There is a parameter to run a form from the CLI, so the startup script option is not applied:
vstudio
-project 'path'
-execute_form 'form_name'

Have you tried it?
Ссылки
  1. https://valentina-db.com/docs/dokuwiki/v14/doku.php?id=valentina:products:vstudio:help:form_editor:form_editor_-_command_line_interface_help
Комментарий
There are no comments made yet.
Benjamin Ducke Ответ принят
Wow! That actually works, and it does exactly what I need it to do.

It runs a form as an entry point into the database, and it never actually opens the
Visual Studio editor.

Thanks so much for the hint! I was not able to find that bit of info in the online help.

Btw. The "startup" script does get executed, as well, if I use the "-execute_form" option.
E.g. if you try this with the "car_list" form in the "car_catalog_python.vsp" sample database,
then you will notice that two "car_list" forms pop up: One invoked by the CLI, and another by "startup".
However, that won't be a problem in a real-world deployment scenario, where "startup" would then be
either empty or used to perform some other action.

Thanks and best,

Benjamin
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories