Glom als Entwickler benutzen
When you create a new document, Glom will be in the Developer user level. You can also change to the Developer user level after opening an existing document, with the User Level menu. Glom will only allow this if the administrator has allowed it.
- 4.1. Tabellen hinzufügen
- 4.2. Bearbeiten von Feldern
- 4.3. Erzeugung von Layouts
- 4.4. Erstellen von Beziehungen
- 4.5. Benutzer-Administration
- 4.6. Übersetzungen
- 4.7. Anfertigen von Berichten
4.1. Tabellen hinzufügen
You can see the list of existing tables by choosing Tables from the Navigate menu. You will also see this window after connecting to a database server, after creating a new document. To create a new table, click the Add button and enter the name for the new table. Glom will suggest a human-readable title for this table. Operators will see this title instead of the actual table name. You can also mark a tables as hidden from Operators. For instance, Operators should see "Invoice Lines" as related records from the "Invoices" table, but they should never be able to navigate directly to the "Invoice Lines" table.
You can also specify one table as the default table. This table will be shown whenever an operator opens an existing document, without asking him to select a table from the list.
You can also use this window to rename an existing table.
Click the Open button to look at the selected table.
4.2. Bearbeiten von Feldern
Choose Fields from the Developer menu. This shows the list of fields in the table. New tables automatically have a primary key field, but you can change this field if necessary.
Click the Add button to add a new field, then enter the name of the new field. Glom will guess an appropriate human-readable title for this field, but you can edit this. Operators will see this title instead of the actual field name.
To specify more field details, select the field and click the Details button.
- 4.2.1. Primärschlüssel
- 4.2.2. Feldtypen
- 4.2.3. Calculated Fields
4.2.1. Primärschlüssel
Each table must have one, and only one, Primary Key. The value in this field will be unique, meaning that each value in this field will appear in only one record in the table. For instance, each record in a "Customers" table would have a "Customer ID". This value will be used to refer to that customer from other tables, such as "Projects" and "Invoices" records. See the Creating Relationships section to see how you can relate tables together.
4.2.2. Feldtypen
Glom offers a few simple field types:
Nummer
Text
Datum
Zeit
Boolean - either true or false
Bild
4.2.3. Calculated Fields
Field values can be calculated in terms of other fields, using the Python programming language. This calculation should be the implementation of a python function, which should return a value. The return value will be used as the value of the field. This value will be recalculated every time one of the source fields changes. TODO: This only works for default values at the moment, and you can not use field values in the calculation yet.
You can also use calculations to specify a default value for fields, by selecting the Default Value tab in the Field Details window, clicking on the Calculate Value check box, and then entering a Python calculation. You can test this calculation in the Edit window.
4.3. Erzeugung von Layouts
Jede Tabelle hat eine Listenansicht und eine Detailansicht. Als Vorgabe zeigen diese alle Felder in einer Tabelle an, in der Reihenfolge, wie sie angelegt wurden. Sie können dieses Layout ändern, indem Sie Layout aus dem Menü Entwickler wählen.
4.3.1. Anordnen der Listenansicht
Für die Listenansicht können Sie die Reihenfolge der angezeigten Spalten angeben, sowie ob einige Felder verborgen werden sollen.
4.3.2. Festlegen der Anordnung der Detailansicht
Für die Detailansicht können Sie Gruppen von Feldern anlegen und diese mit einem Titel versehen. Sie können Felder in diesen Gruppen platzieren und die Abfolge der Felder in diesen Gruppen angeben. Sie können auch die Reihenfolge dieser Gruppen festlegen. Sie könnten beispielsweise in einer Tabelle namens »Kontakte« eine Gruppe »Name« anlegen und die Felder »Titel«, »Vorname« und »Nachname« in diese Gruppe einfügen. Für die »Adresse«-Felder könnten Sie dann wiederum andere Gruppen verwenden.
4.4. Erstellen von Beziehungen
Tables in the Database are often related together. For instance, an "Invoices" table might have a "Customer ID" field. A value in this field would specify a record in the "Customers" table with the same value. Glom can show extra information, such as the customer name, from that related record. Or it can show a list of several related records - for instance, several related "Invoice Lines" that are related to a record in the "Invoice" record.
To create relationships, choose Relationships from the Developer menu. This will show the list of existing relationships. Click the Add button to create a new relationship, and enter a name for it. You should then choose a field in the current table, and a field in another table to which it should be related. This relationship will find any records in the other table for which the values in both fields are equal.
You can use the relationship in the following places.
To show a related field on the List or Details view.
To show a list of related records on the Details view.
To lookup a value from a field in a related record. For instance, to copy the current price of a "Product" into the "Price" field of an "Invoice Line" record.
To calculate a field value.
4.5. Benutzer-Administration
To define the Operators who can use your database, and to specify what access they have to the various tables, choose Users from the Developer menu.
4.6. Übersetzungen
Glom's user interface (and this document) is translated into several languages, as you should see already if you are using your computer with a non-English user interface. In addition, Glom automatically shows and understands numbers and dates according to the current user's local conventions. For instance, a user in the USA might enter a price as 1.99 and a date as 1/13/2008, but a German user of the same database will later see that as 1,99 and 13.1.2008.
However, the Glom system that you create also contains text that must be translated if it will be used by people who speak different languages. For instance, you must provide translations for the titles of your tables, fields, and reports. All of these text items can be seen in a list when you choose Translations from the Developer menu. In this window you can specify the language that you used for the original text, and enter translations for each text item for additional languages. When the Glom system is opened by a user of that language then these text items will be shown in the user interface.
Experienced translators may be more familiar with the .po file format, or you might wish to use the many tools that work with the .po file format. By using the Export button you can create a .po file to use in a separate tool or to send to a translator. You can then import the resulting translation by using the Import button.
4.7. Anfertigen von Berichten
4.7.1. Hinzufügen oder Bearbeiten von Berichten
Glom can produce reports to show specific fields for sets of records, sorted and grouped. For instance, a shop might need a report listing all products sold in one month, grouped by product type, and sorted by price inside each group. Each table has its own reports, which are available to the operator from the Reports menu.
To define a report, or to change the definition of an existing report, choose Reports from the Developer menu.
Notice that each report has an ID as well as a human-readable name. This allows your report to have a translated title when used on a computer that uses a different language.
4.7.2. Bearbeiten eines Berichts
Ein Glom-Bericht gliedert sich in drei Bereiche:
The Header, which appears at the start of the report
The Main area, in which the records and summary lines are shown, with the actual data from the database.
The Footer, which appears at the end of the report.
Inside an area, such as the Main part, you may add report Parts, such as fields, text, or images. These will usually appear in a row on the printed report, with one row for each record. In the simple case, this will look much like Glom's list view. You can add parts to your report by selecting them from the Available Parts list and then clicking the Add button. The part will then be added to the Parts list, in the selected area.
To specify details for the parts, such as the text or image to display, or to choose the field to display, select the part in the Parts list and click the Edit button. You may also specify field formatting by clicking the Formatting button, just as you would when defining a details or list layout.
Some parts may contain other parts and have extra properties to control how they present their child parts. For instance, the Group By part groups records together by a field. For instance, a products report might group a list of products by product type. You can even add a second sub-grouping inside the main Group By part, by selecting your top-level Group By part in the Parts list while adding a new Group By part from the Available Parts list. For instance, you might group your products by manufacturer, inside each product type group.
To specify the field by which the records should be grouped, select your Group By part in the Parts list and click the Edit button. You can then choose the field by which the records should be grouped, and select the fields by which these records should be sorted within the group. You may also specify some additional fields to be displayed in the group's title row. For instance, you might want to group products by a manufacturer ID, but also show the manufacturer name.
The Vertical Group part may contain other items. For instance, it allows you to arrange fields below each other instead of just one after the other in the horizontal row. This is useful for grouping related fields such as address lines, or just to squeeze more information into the records's row on the report.
When you have finished, click the Close button to save the report's definition. Your report can then be chosen from the Reports menu. See the Printing Reports section for more details.