1. Lynn Fredricks
  2. Announcements & News
  3. Четверг, Март 12 2020, 03:21 PM
  4.  Подписаться через email
New productivity features for the Valentina Studio Schema Editor and new QProcess in Valentina Forms lets you run external applications, execute Bash scripts, AppleScript commands and more.

Valentina Studio / Valentina Studio Pro
Valentina Studio is the free, all purpose database management and forms client tool. Valentina Studio Pro combines database management with diagramming, forms creation, reporting and database continuous integration. Available on Windows, Linux and macOS.

  • [New][Pro][Schema Editor] – Duplicate command in the contextual menu of a Table. In the dialog you can specify also [x] – RAM, [x] – Temporary flags for the duplicate. You can also specify that N records should be copied. Works for all databases: MS SQL, MySQL, PostgreSQL, SQLite, Valentina DB.
  • [New][Pro][Form Editor] – The QProcess class, to run external applications, can be used to execute Bash scripts, AppleScript commands, etc.
  • [New][Schema Editor] – improved “Generate SQL : Create” tab, adding flags [x] – RAM, [x] – Temporary for Table objects into a dialog Read more …
  • [New][Schema Editor] – cmd+F keyboard shortcut moves focus to the SEARCH-field on the top right.
  • [New][Schema Editor] – Filter based on the first column of a database
  • [Imp][Data Editor] – Open SQL Editor, Query Editor, Server Admin for active database/connection from the toolbar.
  • [Fix][SSH] – Fixed sending long packets via SSH. This makes the execution of long queries more stable.
  • [Imp][Load Dump] – Update dump loading progress more frequently.
  • [Imp][Load Dump] – Show the list of errors on the last page of the Load Dump wizard.

Notes on this update to Valentina Studio
MySQL does not expose a temporary table in SHOW TABLEs. To use it in the SQL Editor you should remember its name.
Valentina Server
Valentina Server incorporates Valentina Reports Server, Valentina Forms Server and two database servers: Valentina DB Server and Valentina SQLite Server. Available for Windows, Linux, macOS and Raspberry PI.

  • [Fix]8737 – VServer.Shutdown close all databases properly.
  • [Fix]8746 – SystemBackupCatalog property changes do not impact to “BACKUP DATABASE” statement.
  • [Imp]8741 – Use standard macOS authorization dialog in the Valentina Server preference pane. Support for Touch ID authentication to Start/Stop the server.

Valentina Database
Valentina DB is Paradigma Software advanced, object relational database and available in Valentina DB Server (a part of Valentina Server) and Valentina DB ADKs (developer components for adding runtime database support to applications).

  • [Fix]8744 – Error when doing SQL with 2 UNIONs

Valentina ADK for Xojo
Valentina Database ADK and Valentina Reports ADK are available on Windows, Linux and macOS (with Raspberry PI) for Xojo development. The Valentina ADK Client for Xojo also works with Valentina Server.

  • [Fix]8739 – VPreparedStatement gives the wrong result if one parameter has an empty string

Notes on this update to Valentina ADK for Xojo
Xojo’s empty string looks like a nullptr (inside V4RB plugin), but it must be not an SQL-NULL for bind value. If you need to bind a NULL you should call the BindNull() method or use BuildArrayOfBinds() instead of BuildArrayOfBindsFromStrings(). In other words – you can not encode SQL-null using RealString.

This update is now available from the Paradigma Software downloads site. See also the announcement on the official Paradigma Software blog announcement for Valentina 10.1..
Ссылки
  1. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:dialogs:duplicate_table
  2. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:dialogs:generate_sql
  3. https://valentina-db.com/all-downloads/current
Комментарий
There are no comments made yet.
Lynn Fredricks Ответ принят
PowerShell is a much more powerful tool in Windows and intended to replace the Command Prompt, as it delivers more power and control over the operating system. Another fantastic consequence of supporting Qprocess is that a Valentina Forms object can pass scripts to the PowerShell interpreter. The following sample that utilizes PowerShell interpreter demonstrates how to open an existing Excel file, fetch data from its first column and paste it in the text edit form control:


var powerShell = '$objExcel = New-Object -ComObject Excel.Application\n\
$WorkBook = $objExcel.Workbooks.Open("C:\\records.xlsx")\n\
$WorkSheet = $WorkBook.ActiveSheet\n\
$rows = $WorkSheet.UsedRange.Rows.Count\n\
$records = @($workSheet.Range( "A2:A"+$rows).Value2 )\n\
Write-Output $records';

var p = new QProcess;
p.start( 'PowerShell', [ '-Command', powerShell ] );
p.waitForFinished( -1 );

this.textEdit.plainText = String( p.readAllStandardOutput() );


http://www.valentina-db.com/images/valentinaforms/vs_forms_powershell.png

Possible errors from the script execution can be obtained using the QProcess.readAllStandardError method.
Ссылки
  1. https://docs.microsoft.com/en-us/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-7
  2. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:form_editor:launch_app#powershell
Комментарий
There are no comments made yet.
Lynn Fredricks Ответ принят
MacOS automation scripts allow you to communicate with other applications using JavaScript for Automation (JXA), which became equally supported under macOS X 10.10 (and later).

Here is a bit of code showing how to open up a new document in Microsoft Word:


QProcess.execute(
'/usr/bin/osascript',
[
'-l',
'JavaScript',
'-e',
`const word = Application('Microsoft Word');
word.activate();
newDocument = word.Document().make();`
]);


Opening an existing Excel file, fetching data from its first column and passing it to the form control:


var javaScript = `var excel = Application('Microsoft Excel');
var doc = excel.open('/tmp/records.xlsx');
var rowCount = excel.activeSheet.usedRange.rows().length;
var namesList = excel.activeSheet.ranges[ 'a2:a' + rowCount ].value();
namesList.join("\\n");`;

var p = new QProcess;
p.start( '/usr/bin/osascript', [ '-l', 'JavaScript', '-e', javaScript ] );
p.waitForFinished( -1 );

this.textEdit.plainText = String( p.readAllStandardOutput() );


If you are interested in other possibilities for using JavaScript for automation on macOS, check out JavaScript for Automation Cookbook.

New in Valentina Studio 10.1
Valentina Studio incorporates QProcess class into its object model, giving a way to extend the functionality of your forms and scripts with the power of other applications. QProcess class allows you to execute an external application, specify parameters, write to its standard input, read results from its standard output and more.
Ссылки
  1. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:form_editor:launch_app#javascript
Комментарий
There are no comments made yet.
Lynn Fredricks Ответ принят
MacOS automation scripts allow you to communicate with other applications supporting the IPC interface, including AppleScript, as detailed in the AppleScript Language Guide.

Opening a new document in Microsoft Word using AppleScript:


QProcess.execute(
'/usr/bin/osascript',
[
'-l',
'AppleScript',
'-e',
`tell application "Microsoft Word"
activate
make new document
end tell`
]);


The following example written in AppleScript demonstrates how to open an existing Excel file, fetch data from its first column and pass it to the form control:


var appleScript = `on convertListToString(theList, theDelimiter)
set AppleScript's text item delimiters to theDelimiter
set theString to theList as string
set AppleScript's text item delimiters to ""
return theString
end convertListToString

tell application "Microsoft Excel"
open workbook workbook file name "/tmp/records.xlsx"
tell active sheet
tell used range
set RowCount to count of rows
end tell

set namesList to value of range ("a2:a" & RowCount)
end tell
end tell

set result to convertListToString(namesList, return)

copy result to stdout`;

var p = new QProcess;
p.start( '/usr/bin/osascript', [ '-l', 'AppleScript', '-e', appleScript ] );
p.waitForFinished( -1 );

this.textEdit.plainText = String( p.readAllStandardOutput() );


Follow the link below for this script and others. Although the death of AppleScript has been predicted many times, yet it persists as an automation solution from Apple for over 27 years.

New in Valentina Studio 10.1
Valentina Studio incorporates QProcess class into its object model, giving a way to extend the functionality of your forms and scripts with the power of other applications. QProcess class allows you to execute an external application, specify parameters, write to its standard input, read results from its standard output and more.

Don't forget that both Valentina DB ADK and Valentina Reports ADK are available for Python, and Python is another language supported by Valentina CLIENT for Valentina Server.
Ссылки
  1. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:form_editor:launch_app#applescript
Комментарий
There are no comments made yet.
Lynn Fredricks Ответ принят
The Forms team is also enthusiastic about our support for Python. The following example written in Python demonstrates how to open an existing Microsoft Excel file from a Form script, fetch data from its first column and pass it to the text edit form control:

var pythonScript = `from openpyxl import load_workbook

wb = load_workbook('/tmp/records.xlsx')

for i in range( 2, wb.active.max_row ):
print( wb.active[ 'A{0}'.format(i) ].value )`;

var p = new QProcess;
p.start( '/usr/local/bin/python3', [ '-c', pythonScript ] );
p.waitForFinished( -1 );

this.textEdit.plainText = String( p.readAllStandardOutput() );


And the result...

http://www.valentina-db.com/images/valentinaforms/vsforms_import_from_excel_with_python400x330.png

New in Valentina Studio 10.1
Valentina Studio incorporates QProcess class into its object model, giving a way to extend the functionality of your forms and scripts with the power of other applications. QProcess class allows you to execute an external application, specify parameters, write to its standard input, read results from its standard output and more.

Don't forget that both Valentina DB ADK and Valentina Reports ADK are available for Python, and Python is another language supported by Valentina CLIENT for Valentina Server.
Ссылки
  1. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:form_editor:launch_app#python
Комментарий
There are no comments made yet.
Lynn Fredricks Ответ принят
You can now execute shell scripts in code within Valentina Forms, including bat and bash scripts. Bash is the GNU Project's Bourne Again SHell, a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features.

Use QProcess.execute to create a new directory via bash:
QProcess.execute( 'sh', [ '-c', 'mkdir /tmp/qprocess_dir' ] );


But with this approach, you don't receive information about errors. In order to get an error, it is necessary to use QProcess.start to launch an application and read errors with QProcess.readAllStandardError method:

var p = new QProcess;
p.start( 'sh', [ '-c', 'mkdir /tmp/qprocess_dir' ]);
p.waitForFinished( -1 );

var result = String( p.readAllStandardError() );

if( result.length > 0 )
QMessageBox.critical( 'Error', result );

On the second run, it will show a message box with text ”mkdir: /tmp/qprocess_dir: File exists” To read the output of the script QProcess.readAllStandardOutput method is used:

var p = new QProcess;
p.start( 'sh', [ '-c', 'ps ax | wc -l' ]);
p.waitForFinished( -1 );

var result = String( p.readAllStandardOutput() );
QMessageBox.information( 'Title', 'There are ' + result.trim() + ' processes running' );

As a result, a message box with a similar text will be shown:

http://www.valentina-db.com/images/valentinastudio/10/vs_forms_bash.png

New in Valentina Studio 10.1
Valentina Studio incorporates QProcess class into its JavaScript object model, giving a way to extend the functionality of your forms and scripts with the power of other applications. QProcess class allows you to execute an external application, specify parameters, write to its standard input, read results from its standard output and more.
Ссылки
  1. https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:vstudio:help:form_editor:launch_app#bash
Комментарий
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.