9436
Commento: Revisione completata
|
10230
ready for #70
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 1: | Linea 1: |
#acl GruppoAdmin:admin,read,write,revert GruppoEditori:read,write,revert GruppoFcm:read,write,revert -All:read -Known:read [[Include(Fcm/Header)]] |
#acl GruppoAdmin:admin,read,write,revert GruppoOperatori:admin,read,write,revert GruppoEditori:read,write,revert GruppoFcm:read,write,revert palombo:admin,read,write,revert new.life:admin,read,write,revert paolettopn:admin,read,write,revert Known:read All:read |
Linea 4: | Linea 3: |
== HowTo6 == | <<Include(Fcm/Header)>> = Testo inglese = |
Linea 6: | Linea 6: |
=== Traduzione italiana === | LibreOffice Part 23: Base Form Enhancements with Macros |
Linea 8: | Linea 8: |
HOW-TO Scritto da Richard Bosomworth |
by Elmer Perry |
Linea 11: | Linea 10: |
LAMP - Parte 2 | For the previous four parts of this series, we have slowly built a database document using LibreOffice's Base module. We have a database with forms to enter our data, and queries and reports for extracting the data. We now have a usable document for recording our book library. However, our current design has one flaw we need to overcome. If we need to enter a new author or media type while we are in the books form, we have to close the book form and open one of the others. If we could enter new authors and media types directly from the books form, it would behave more like an application and make data entry even easier. We can accomplish this through a few short macros. The LibreOffice Basic language is very similar to other Basic languages, such as Visual Basic for Applications. To manipulate the underlying LibreOffice document, we access the Uno framework controlling the document. The Uno framework is quite complex, but I will explain, as best I can, the properties and objects we will use. The goal is not to teach you how to write LibreOffice macros, but how you can use them. Macro Security and Options |
Linea 13: | Linea 14: |
VEDI ANCHE: FCM#28 - LAMP Parte 1 |
While macros allow us to do cool things in our documents, they can also cause problems. Some people use macros to compromise other people's systems, therefore, we need to take a few minutes to talk about macro security. Whether you are running LibreOffice on Linux, Mac, or Windows, malicious code in a macro can compromise your data and possibly your entire system. |
Linea 16: | Linea 16: |
VALIDO PER: | Macro security in LibreOffice is simple. Tools > Options opens the Options dialog for LibreOffice. Under LibreOffice, select Security. Click on the Macro Security button to pop up the macro security options. You have four options. Never use the Low security option – it will run macros without asking you. I recommend the Medium security level. With this level, you are prompted whether to run the macros when you open a document containing macros. The High and Very High options require a certificate or folder you designate as trusted. While this is great, I believe nothing trumps the instincts of the user. You usually know whether you were expecting a document to contain macros. When in doubt, click No. Click OK to save your choice and OK to close the options dialog. Now, on to the fun stuff. The Macros |
Linea 18: | Linea 20: |
CATEGORIE: | We will write four macros for our database document. Three will deal with opening forms, and the last will update the list boxes for authors and media types. The general idea behind macros is to accomplish tasks that are not built into the program, or to simplify complex tasks. Our macros really accomplish both, as we will simplify the tasks of adding authors and media types and provide functionality not built into the program. Before we can begin to write our macros, we need a container to hold them. Macros are contained in a module. Modules can live in the program itself or within a document. Since our macros are specific to our database file, we will embed them in the document. Macros embedded in a document are available only when the document is loaded. Macros contained in the program are available as long as the program is running. Tools > Macros > Organize Macros > LibreOffice Basic. The LibreOffice Basic Macros dialog pops up. Select book.odb from the Macro from-list. Click the New button. A dialog pops up asking you for a name for the module. Name it FormCalls. Click OK. This brings up the LibreOffice macro editor. The macro comes with a default main subroutine. We will not use this subroutine. Highlight Sub main and End Sub and press the backspace key to delete them. Our first macro is a generalized subroutine for opening a form. A generalized subroutine is written for reuse. We will call this routine twice from other routines we write. Type this subroutine into the editor: {{{ Sub OpenAForm (FormName as String) Dim GetForm as Object GetForm = ThisDatabaseDocument.FormDocuments.GetByName(FormName) GetForm.Open End Sub }}} The first line of the subroutine is called the signature. The signature determines how the subroutine is called. A signature starts with the keyword Sub, which defines this call as a subroutine. Next, the name of the subroutine. In our case, OpenAForm is the name of the subroutine. Finally in the parenthesis, we have the arguments used when calling this subroutine. In our case, we have a variable named FormName which is a type String. In the second line of the subroutine, Dim is another keyword. Dim initializes a variable as a type, and, optionally, a value. We define a variable named GetForm as a type Object. The third line assigns a value to the variable GetForm through a chain of commands in the Uno framework. ThisDatabaseDocument refers to the currently open database document. In our case, book.odb. FormDocuments is a collection of all the forms in the document. Finally, GetByName retrieves a specific form object from the collection. Notice, we pass the variable FormName from the signature to this method. Once the call is complete, the variable GetForm is the object of the form name passed to the subroutine. The fourth line calls the Open method of the form. On the fifth line, we tell Basic this is the end of the subroutine with the command End Sub. We will call the OpenAform subroutine twice. Once to open the authors form, and once to open the media form. Add these two subroutines to your editor: {{{ Sub OpenAuthorsForm(oEv As Object) OpenAForm("Authors") End Sub |
Linea 20: | Linea 38: |
DISPOSITIVI: | Sub OpenMediaForm(oEv As Object) OpenAForm("Media") End Sub }}} The signature on these two subroutines are a little different. Since we will call them from a control within a form, we need to pass the object making the call as an argument, even though we do not use it. The argument oEv is a reference to the object making the call. We will use this to our advantage later, in the last subroutine, but here we do it because it is required. These two subroutines are pretty simple. We just make a call to OpenAForm passing the name of the form we want to open, Authors or Media. The final subroutine deals with our problem of refreshing the data in the list boxes for authors and media when we add authors or media using the two subroutines above: {{{ Sub ListRefresh(oEv as Object) oEv.source.model.Refresh End Sub }}} Once again, since we will call this subroutine from a control, we need a reference to the control making the call. However, this time we will actually use the object. This subroutine makes a method call to the underlying model of the list box and refreshes the data in the list, thus updating our list of authors or media types. Save your module and close the Basic editor. |
Linea 22: | Linea 52: |
Abbiamo la nostra nuova bella scatola LAMP, tutto bene e buono, ma avremo bisogno di mettere qualche dato all'interno, certo. Non solo questo, ma non vogliamo che altri mettano i loro dati all'interno oppure ci rubino i nostri. Un server Linux è intrinsecamente sicuro, tuttavia non fa certamente male aumentarne il livello. Configuriamo l'FTP ed un semplice Firewall. | Making Connections to Macros |
Linea 24: | Linea 54: |
Installazione FTP | At this point, our macros do nothing. We need to connect them to objects in our form to activate them when needed. First, we will connect the open form subroutines to buttons in our form, and then we will connect the ListRefresh to the list boxes. In the database pane, click on Forms. Right-click the Books form and select edit. Add two push buttons to the form, one under the Authors table and another under the Media table. Right-click the button under the Authors table and select Control to bring up the buttons properties dialog. On the General tab, change the name to AddAuthors and the Label to Add Authors. On the Events tab, click the ellipses (…) button next to Execute Action – which brings up the Assign Action dialog. Click the Macro button to bring up the Macro Selector dialog. In the tree list under Library, select book.odb > Standard > FormCalls. Select OpenAuthorsForm from the Macro Name list and click OK. Click OK to close the Assign Action dialog. Close the buttons properties dialog. Do the same with the button under the Media table, only name it AddMedia, make the label Add Media Type, and assign the macro OpenMediaForm to the Execute Action event. Finally, we need to add the refresh subroutine to our list boxes. Right-click the Authors column in the authors table and select Column. On the Events tab, click the ellipse (…) button beside “When receiving focus”. In the Assign Action button, use the Macro button to assign the ListRefresh macro to the action. This will cause the list to update data from the Authors table when you click on a list box in the column. Do the same for the Media column in the media table. Save your changes to the Books form and close it. |
Linea 26: | Linea 61: |
Utilizzeremo vsftpd. Alla CLI scriviamo: | Testing Your Changes |
Linea 28: | Linea 63: |
sudo apt-get install vsftpd | Any time we make changes to our forms, we will want to test them and make sure we got everything right, especially in cases where we have used macros. One simple typo could cause things to not work. Double-click the Books form to open it. Add a new book with an author and media type you have not added already. Click the Add Authors button to make sure it opens the form. Add some authors. Close the Authors form. Click on the authors dropdown list box and verify that the authors you added are there. Do the same test with the Add Media Type button and listbox. Final Thoughts and References |
Linea 30: | Linea 66: |
Potete trovare un modulo GUI di vsftpd per Webmin ma io preferiscoeditare il file vsftpd.conf manualmente. Per fare questo, alla riga di comando scrivete: | Again, I would like to emphasize that writing macros in LibreOffice Basic is complex. Documentation is pretty sparse, but it is out there. If you are interested in taking up the challenge, here are some references to get you started: LibreOffice Basic Guide: http://wiki.documentfoundation.org/images/d/dd/BasicGuide_OOo3.2.0.odt Andrew Pitonyak's OpenOffice Macro Information: http://www.pitonyak.org/oo.php You can find the macros used in this How-To on pastebin.com at http://pastebin.com/MU2Ztizi Next time, we will move on to another part of the LibreOffice suite and explore the Math module. |
Linea 32: | Linea 72: |
sudo nano /etc/vsftpd.conf | = Traduzione italiana = |
Linea 34: | Linea 74: |
Ho letto molti tutorial che sono felici di lavorare con accesso anonimo. Tuttavia, questa non è una cosa che mi fa stare a mio agio, quindi la disabilito sempre. A seconda delle politiche di sicurezza del vostro sistema, potreste utilizzare chroot su alcuni utenti per impedire l'accesso al di fuori dello spazio a cui è loro permesso l'accesso. I permessi sono per l'accesso FTP. Siccome utilizzo un solo account e mi connetto direttamente a /var/www, il metodo esteso che utilizzo per l'accesso è come segue: Abilitare l'accesso agli utenti locali (il mio account) in vsftpd.conf. Aggiungere l'utente (io) al gruppo www-data (per questo utilizzo Webmin). Assegnare /var/www al gruppo www-data (per questo utilizzo Webmin) e selezionare "File ereditano dal Gruppo". Impostare una cartella di destinazione del client ftp (ad es. /var/www). IMPORTANTE: Assicuratevi che "umask" non sia commentato nel file vsftpd.conf e selezionate la configurazione che preferite per l'upload. Per l'installazione di Wordpress ho trovato che 0002 è l'opzione migliore (corrisponde ai permessi 775). Le vostre necessità potrebbero essere differenti, ma le precedenti funzionano per me. Riavviate vsftpd e provate l'accesso con il vostro programma FTP. Io utilizzo Transmit, è grandioso. sudo /etc/init.d/vsftpd restart Configurazione Firewall Questo è abbastanza semplice con Webmin. Dalla scheda networking, aprite "Firewall Linux". Selezionate Blocca Tutto eccetto SSH e IDENT su interfaccia esterna. Nella prossima schermata dobbiamo aggiungere delle regole per l'accesso FTP, Webmin, Sendmail e MySQL Admin. Selezionate "Aggiungi regole" sotto la lista esistente. Selezionate "Accetta". Impostate Protocollo di Rete TCP. Impostate la porta di destinazione TCP o UDP uguale a 21. Premete "Crea". Fate lo stesso per le porte 3306 (MySQL), 25 (Sendmail), 10000 (Webmin) e 80 (Web e phpMyAdmin). Selezionate "Attiva all'avvio" e premete "Applica configurazione". È tutto. Se potete tornare in Webmin, utilizzare gli script PHP Mail e FTP ed accedere al DB con MySQL Administrator, allora siete a posto. TRUCCO: Potreste dover riavviare MySQL. Io utilizzo Webmin per vedere visto che è già aperto. PHP Mail Potreste voler dare ai visitatori la possibilità di inviarvi una mail con un semplice click dal vostro sito dinamico. PHP possiede già un'opzione per fare questo, ma necessita di un collegamento ad un agente di trasporto (MTA) per il relay. In altre parole, necessita di un programma o un servizio per mandare la mail. Possiamo utilizzare un'opzione del server chiamata (potete immaginare?), si, Sendmail. Ecco come installarla e configurarla: è davvero semplice. Per primo installiamo Sendmail. Alla CLI scriviamo: sudo apt-get install sendmail Dopo dobbiamo configurare PHP per fargli conoscere dove si trova il servizio SMTP (sendmail). Alla CLI scrivete quanto segue: sudo nano /etc/php5/apache2/php.ini Aggiungete quanto segue sotto la sezione mail function, inserendo i vostri dettagli come richiesto: [mail function] ; Setup for Linux systems sendmail_path = /usr/sbin/sendmail -t sendmail_from = <your_webadmin_mail_account@yourdomain.com> Salvate. È tutto. Il vostro script mail sarà ora felice di inviare mail. Richard Bosomworth è un appassionato professionista Ubuntu che offre strategie open source e servizi per business IT dal portale web http://toomuchgreen.eu. Quando non lavora con la tecnologia va in bicicletta vigorosamente. Per certi versi Linux è come tua moglie. È stabile e molto affidabile. Ad eccezione che soddisfa le tue fantasie. Cosa faresti se fossi davvero molto ricco? Comprerei un Mac. ==== Note alla traduzione ==== |
== Note alla traduzione == |
Linea 112: | Linea 77: |
=== Revisione === HOW-TO Scritto da Richard Bosomworth LAMP - Parte 2 VEDI ANCHE: FCM n. 28 - LAMP Parte 1 VALIDO PER: CATEGORIE: DISPOSITIVI: Abbiamo la nostra nuova bella macchina LAMP, tutto bene e buono, ma avremo bisogno di mettere qualche dato all'interno, certo. Non solo questo, ma non vogliamo che altri mettano i loro dati all'interno oppure ci rubino i nostri. Un server Linux è intrinsecamente sicuro, tuttavia non fa certamente male aumentarne il livello. Configuriamo l'FTP e un semplice Firewall. Installazione FTP Utilizzeremo vsftpd. Alla CLI scriviamo: sudo apt-get install vsftpd Potete trovare un modulo GUI di vsftpd per Webmin ma io preferisco modificare il file vsftpd.conf manualmente. Per fare questo, alla riga di comando scrivete: sudo nano /etc/vsftpd.conf Ho letto molti tutorial in cui si è tranquilli a lavorare con accesso anonimo. Tuttavia, questa non è una cosa che mi fa stare a mio agio, quindi la disabilito sempre. A seconda delle politiche di sicurezza del vostro sistema, potreste utilizzare chroot su alcuni utenti per impedire l'accesso al di fuori dello spazio a cui è loro permesso l'accesso. I permessi sono per l'accesso FTP. Siccome utilizzo un solo account e mi connetto direttamente a /var/www, il metodo esteso che utilizzo per l'accesso è come segue: Abilitare l'accesso agli utenti locali (il mio account) in vsftpd.conf. Aggiungere l'utente (io) al gruppo www-data (per questo utilizzo Webmin). Assegnare /var/www al gruppo www-data (per questo utilizzo Webmin) e selezionare "File ereditano dal Gruppo". Impostare una cartella di destinazione del client ftp (ad es. /var/www). IMPORTANTE: Assicuratevi che "umask" non sia commentato nel file vsftpd.conf e selezionate la configurazione che preferite per l'upload. Per l'installazione di WordPress ho trovato che 0002 è l'opzione migliore (corrisponde ai permessi 775). Le vostre necessità potrebbero essere differenti, ma le precedenti funzionano per me. Riavviate vsftpd e provate l'accesso con il vostro programma FTP. Io utilizzo Transmit, è grandioso. sudo /etc/init.d/vsftpd restart Configurazione Firewall Questo è abbastanza semplice con Webmin. Dalla scheda networking, aprite "Firewall Linux". Selezionate Blocca Tutto eccetto SSH e IDENT su interfaccia esterna. Nella prossima schermata dobbiamo aggiungere delle regole per l'accesso FTP, Webmin, Sendmail e MySQL Admin. Selezionate "Aggiungi regole" sotto la lista esistente. Selezionate "Accetta". Impostate Protocollo di Rete a TCP. Impostate la porta di destinazione TCP o UDP uguale a 21. Premete "Crea". Fate lo stesso per le porte 3306 (MySQL), 25 (Sendmail), 10000 (Webmin) e 80 (Web e phpMyAdmin). Selezionate "Attiva all'avvio" e premete "Applica configurazione". È tutto. Se potete tornare in Webmin, utilizzare gli script PHP Mail ed FTP e accedere al DB con MySQL Administrator, allora siete a posto. SUGGERIMENTO: Potreste dover riavviare MySQL. Io utilizzo Webmin visto che è già aperto. PHP Mail Potreste voler dare ai visitatori la possibilità di inviarvi una mail con un semplice click dal vostro sito dinamico. PHP possiede già un'opzione per fare questo, ma necessita di un collegamento ad un agente di trasporto (MTA) per l'invio. In altre parole, necessita di un programma o un servizio per mandare la mail. Possiamo utilizzare un'opzione del server chiamata (potete immaginare?), si, Sendmail. Ecco come installarla e configurarla: è davvero semplice. Per primo installiamo Sendmail. Alla CLI scriviamo: sudo apt-get install sendmail Dopo dobbiamo configurare PHP per fargli conoscere dove si trova il servizio SMTP (sendmail). Alla CLI scrivete quanto segue: sudo nano /etc/php5/apache2/php.ini Aggiungete quanto segue sotto la sezione mail function, inserendo i vostri dettagli come richiesto: [mail function] ; Setup for Linux systems sendmail_path = /usr/sbin/sendmail -t sendmail_from = <your_webadmin_mail_account@yourdomain.com> Salvate. È tutto. Il vostro script mail sarà ora felice di inviare mail. Richard Bosomworth è un appassionato professionista Ubuntu che offre strategie open source e servizi per business IT dal portale web http://toomuchgreen.eu. Quando non lavora con la tecnologia va in bicicletta vigorosamente. Per certi versi Linux è come tua moglie. È stabile e molto affidabile. Tranne il fatto che soddisfa le tue fantasie. Cosa faresti se fossi molto, molto ricco? Comprerei un Mac. ==== Note alla revisione ==== |
= Revisione = |
Linea 219: | Linea 80: |
== Note alla revisione == | |
Linea 220: | Linea 82: |
=== Errata Corrige === | = Errata Corrige = |
Linea 225: | Linea 89: |
CategoryComunita | CategoryComunitaFcm |
Testo inglese
LibreOffice Part 23: Base Form Enhancements with Macros
by Elmer Perry
For the previous four parts of this series, we have slowly built a database document using LibreOffice's Base module. We have a database with forms to enter our data, and queries and reports for extracting the data. We now have a usable document for recording our book library. However, our current design has one flaw we need to overcome. If we need to enter a new author or media type while we are in the books form, we have to close the book form and open one of the others. If we could enter new authors and media types directly from the books form, it would behave more like an application and make data entry even easier. We can accomplish this through a few short macros. The LibreOffice Basic language is very similar to other Basic languages, such as Visual Basic for Applications. To manipulate the underlying LibreOffice document, we access the Uno framework controlling the document. The Uno framework is quite complex, but I will explain, as best I can, the properties and objects we will use. The goal is not to teach you how to write LibreOffice macros, but how you can use them. Macro Security and Options
While macros allow us to do cool things in our documents, they can also cause problems. Some people use macros to compromise other people's systems, therefore, we need to take a few minutes to talk about macro security. Whether you are running LibreOffice on Linux, Mac, or Windows, malicious code in a macro can compromise your data and possibly your entire system.
Macro security in LibreOffice is simple. Tools > Options opens the Options dialog for LibreOffice. Under LibreOffice, select Security. Click on the Macro Security button to pop up the macro security options. You have four options. Never use the Low security option – it will run macros without asking you. I recommend the Medium security level. With this level, you are prompted whether to run the macros when you open a document containing macros. The High and Very High options require a certificate or folder you designate as trusted. While this is great, I believe nothing trumps the instincts of the user. You usually know whether you were expecting a document to contain macros. When in doubt, click No. Click OK to save your choice and OK to close the options dialog. Now, on to the fun stuff. The Macros
We will write four macros for our database document. Three will deal with opening forms, and the last will update the list boxes for authors and media types. The general idea behind macros is to accomplish tasks that are not built into the program, or to simplify complex tasks. Our macros really accomplish both, as we will simplify the tasks of adding authors and media types and provide functionality not built into the program. Before we can begin to write our macros, we need a container to hold them. Macros are contained in a module. Modules can live in the program itself or within a document. Since our macros are specific to our database file, we will embed them in the document. Macros embedded in a document are available only when the document is loaded. Macros contained in the program are available as long as the program is running. Tools > Macros > Organize Macros > LibreOffice Basic. The LibreOffice Basic Macros dialog pops up. Select book.odb from the Macro from-list. Click the New button. A dialog pops up asking you for a name for the module. Name it FormCalls. Click OK. This brings up the LibreOffice macro editor. The macro comes with a default main subroutine. We will not use this subroutine. Highlight Sub main and End Sub and press the backspace key to delete them. Our first macro is a generalized subroutine for opening a form. A generalized subroutine is written for reuse. We will call this routine twice from other routines we write. Type this subroutine into the editor:
Sub OpenAForm (FormName as String) Dim GetForm as Object GetForm = ThisDatabaseDocument.FormDocuments.GetByName(FormName) GetForm.Open End Sub
The first line of the subroutine is called the signature. The signature determines how the subroutine is called. A signature starts with the keyword Sub, which defines this call as a subroutine. Next, the name of the subroutine. In our case, OpenAForm is the name of the subroutine. Finally in the parenthesis, we have the arguments used when calling this subroutine. In our case, we have a variable named FormName which is a type String. In the second line of the subroutine, Dim is another keyword. Dim initializes a variable as a type, and, optionally, a value. We define a variable named GetForm as a type Object. The third line assigns a value to the variable GetForm through a chain of commands in the Uno framework. ThisDatabaseDocument refers to the currently open database document. In our case, book.odb. FormDocuments is a collection of all the forms in the document. Finally, GetByName retrieves a specific form object from the collection. Notice, we pass the variable FormName from the signature to this method. Once the call is complete, the variable GetForm is the object of the form name passed to the subroutine. The fourth line calls the Open method of the form. On the fifth line, we tell Basic this is the end of the subroutine with the command End Sub. We will call the OpenAform subroutine twice. Once to open the authors form, and once to open the media form. Add these two subroutines to your editor:
Sub OpenAuthorsForm(oEv As Object) OpenAForm("Authors") End Sub Sub OpenMediaForm(oEv As Object) OpenAForm("Media") End Sub
The signature on these two subroutines are a little different. Since we will call them from a control within a form, we need to pass the object making the call as an argument, even though we do not use it. The argument oEv is a reference to the object making the call. We will use this to our advantage later, in the last subroutine, but here we do it because it is required. These two subroutines are pretty simple. We just make a call to OpenAForm passing the name of the form we want to open, Authors or Media. The final subroutine deals with our problem of refreshing the data in the list boxes for authors and media when we add authors or media using the two subroutines above:
Sub ListRefresh(oEv as Object) oEv.source.model.Refresh End Sub
Once again, since we will call this subroutine from a control, we need a reference to the control making the call. However, this time we will actually use the object. This subroutine makes a method call to the underlying model of the list box and refreshes the data in the list, thus updating our list of authors or media types. Save your module and close the Basic editor.
Making Connections to Macros
At this point, our macros do nothing. We need to connect them to objects in our form to activate them when needed. First, we will connect the open form subroutines to buttons in our form, and then we will connect the ListRefresh to the list boxes. In the database pane, click on Forms. Right-click the Books form and select edit. Add two push buttons to the form, one under the Authors table and another under the Media table. Right-click the button under the Authors table and select Control to bring up the buttons properties dialog. On the General tab, change the name to AddAuthors and the Label to Add Authors. On the Events tab, click the ellipses (…) button next to Execute Action – which brings up the Assign Action dialog. Click the Macro button to bring up the Macro Selector dialog. In the tree list under Library, select book.odb > Standard > FormCalls. Select OpenAuthorsForm from the Macro Name list and click OK. Click OK to close the Assign Action dialog. Close the buttons properties dialog. Do the same with the button under the Media table, only name it AddMedia, make the label Add Media Type, and assign the macro OpenMediaForm to the Execute Action event. Finally, we need to add the refresh subroutine to our list boxes. Right-click the Authors column in the authors table and select Column. On the Events tab, click the ellipse (…) button beside “When receiving focus”. In the Assign Action button, use the Macro button to assign the ListRefresh macro to the action. This will cause the list to update data from the Authors table when you click on a list box in the column. Do the same for the Media column in the media table. Save your changes to the Books form and close it.
Testing Your Changes
Any time we make changes to our forms, we will want to test them and make sure we got everything right, especially in cases where we have used macros. One simple typo could cause things to not work. Double-click the Books form to open it. Add a new book with an author and media type you have not added already. Click the Add Authors button to make sure it opens the form. Add some authors. Close the Authors form. Click on the authors dropdown list box and verify that the authors you added are there. Do the same test with the Add Media Type button and listbox. Final Thoughts and References
Again, I would like to emphasize that writing macros in LibreOffice Basic is complex. Documentation is pretty sparse, but it is out there. If you are interested in taking up the challenge, here are some references to get you started: LibreOffice Basic Guide: http://wiki.documentfoundation.org/images/d/dd/BasicGuide_OOo3.2.0.odt Andrew Pitonyak's OpenOffice Macro Information: http://www.pitonyak.org/oo.php You can find the macros used in this How-To on pastebin.com at http://pastebin.com/MU2Ztizi Next time, we will move on to another part of the LibreOffice suite and explore the Math module.
Traduzione italiana
Note alla traduzione
Revisione
Note alla revisione