====== Conversions ====== GCstar can be used with other softwares. It requires collection conversions. Export allows you to use your collection in another software. While Import do the opposite, so you could use a collection generated with another software with GCstar. ===== Introduction ===== Plugins are described in the same order as the one they should have in **Export** and **Import** menus (sub-menus of **File**). If one of them is not present, user may know why thanks to **Dependencies** item in help menu **?**). It will open such a window: {{en:dependencies.png|Plugins dependencies}} Items in the list are **Perl components** which are used by import and export plugins. Plugin using a non-installed component won't be available. Within previous example, Tellico import plugin could not be used (and would not be present in **Import** menu) because of missing Archive::Zip component. Once the Perl component has been installed (way to do that depends on operating system), there is no need to reinstall GCstar. Closing and launching the application will be enough to make the plugin available. Some plugins are specific to some kind of collections or will behave differently with different ones. ===== Export collections ===== In **File** menu, there is an **Export** submenu. It contains some items. Each one being for a different export method. ==== CSV export ==== This first one creates a CSV file. In such a file, there is one line for each collection member. The information are separated by a user selected character (or string). The first option is to include or not the columns names in the output file. It can be useful to have them if you wish to open the file with a spreadsheet program. You can also select the delimiter. And if it occurs in values, it will be replaced with something that can be configured to avoid confusions. Fields to export must also be selected. And of course, order matters. Another option is available to copy pictures in a sub directory and having relative pathnames in generated file. ==== HTML export ==== This is used to generate a HTML page containing all items from current collection with their pictures. When creating such a page, a directory is also created to stock all pictures. If this page has to be consulted from anywhere else (as from a web server), user needs to copy also this directory. Its name is displayed in a dialog box once exportation has been performed. Some templates are provided. They let user create different kind of pages with different features and styles. The templates available depend on the current collection type. Some options can be customized for this export. They are in dialog box displayed when it is activated. You can select if some Javascript will be used or not. If activated, you will have some dynamic stuff. Once you have exported a collection to html it is possible to print the output using a number of external programs. The simplest is to load the html into a browser and print from the browser. It is also possible to manipulate the html output to create other kinds of printouts. The program html2ps, a part of the ubuntu collections, can output files with headers and all sorts of useful information. To create a booklet of a collection, you can use a2ps to create a booklet that can be printed to a duplex-capable printer, or using gv, you can print first the front sides and then the back sides of the duplexed sheets. First "Export" the collection using one of the html templates. To carry out the next step you have to have a PDF virtual printer defined in cups. To print a booklet to the virtual PDF printer, you use html2ps to create the booklet: a2ps -=book -PVirtual_Printer gcstar-dvd-booklet.html where Virtual_Printer is the name of the PDF printer and gcstar-dvd-booklet.html is the name of the file that you supplied to the "Export" command from within gcstar. Virtual_Printer is the name of the PDF printer I have setup in cups. Depending on the way I have setup html2ps, the output is more or less informative. By setting the following as $HOME/.html2psrc: @page { margin-left: 1.5cm; margin-right: 1.5cm; margin-top: 2cm; margin-bottom: 2cm; } @html2ps { header { left: $T; right: "Page $N"; alternate: 1; } footer { right: $D; alternate: 1; } } I have created a page format for "letter" size paper with minimal margins (anything less prevents the headers and footers from appearing) and including the useful information of the Collection name on each page, plus the page number and the date on each page. The Collection name and page as well as the date alternate between odd and even pages to give the illusion of professionalism. Now my wife can browse the movies on paper and mark the ones that are of interest. Then she can access the database on her laptop and lookup the cast, genre and other details. A note about html2ps: it does not obey all html document conventions. It does not grok CSS style-sheets, and it does not obey
[HEADER]
[/HEADER]
[ITEM]
[/ITEM]
[FOOTER]
[/FOOTER]
In **HEADER** section should be present all things that will be on top of the file only once. It could include the main tags opening, the DTD definition and so on.
The **ITEM** part contains everything related to one collection item. So it will be repeated as many times as necessary.
Finally, the **FOOTER** section is for final stuff.
In the ITEM section, some special things can be used. Something like **${name}** will be replaced with corresponding field from the collection member. The available fields depend on the collection type.
All coma separated values or values lists can be used in a loop. The syntax is this one:
[LOOP field]
[/LOOP]
**field** being one of previous ones (without **${** and **}** ). All the text included in this section will be repeated as many times as needed. Each time the loop iterates, it will replace **$$** with current value. Here is an example for a movie collection. If you provide this in your template:
[LOOP actors]
$$
[/LOOP]
And you have a movie with actor list being "John, Edna, Paul". The generated file will contain:
[SPLIT value=field sep=char]
[/SPLIT]
**field** can be each ones within the item information (not only the comma separated ones). **char** is the character that will be used as a separator. In text included in this section, special values can be used: **$0**, **$1**,... They correspond to each part of the original field.
To have an example, we consider this template:
[SPLIT value=director sep= ]
$1
$2
[/SPLIT]
Separtor used is white space. If in a movie, director is "John Doe", the file will contain these information: