Sei sulla pagina 1di 3

Structurer Pro

Importing & Exporting

Introduction
Structure Pro makes possible to import and export its internal database. This feature allows you to
share and backup your structure templates and contents for files and folders. To know more about
the process, be sure to read the next section. If youre interested in editing the exported file, read
section 2 in this document.

1.How to Import and Export your Structurer Pro database


1.1 Exporting
Exporting your database is easy. First, navigate to the File menu, and choose Export Database.
You will be presented to the following interface:

As a standard MacOS X save panel, navigate to the desired location where you want your file saved
and give it a name. Structurer will always generate a XML file, so there is no need to include the
file extension if you prefer.
As in the picture, you will also have the option to choose what to export. Mark the first checkbox if
you want your structure templates exported, and mark the second checkbox to export also the file
and folder contents database. The file will be generated accordingly and you are ready to share,
edit, or backup it.

1.2 Importing
In a similar way, you can import files by choosing Import Database in the File menu. A window
that allows you to choose which file to import will appear. Navigate to the desired file and press
the Import button.
Thats all you need to do. Structurer will take care of the rest. If it encounters already existent
database entry with the same name, nothing will be overwritten. Structurer will append a number
to the name of the new entry.

2.Editing the Exported File


As the exporting file is plain XML, editing it is easy if you need to do so. In this case, you will want
to know how the file is composed.

2.1 Basic File Structure


The generated file is tree-based. Everything needs to be wrapped in an outer database element.
Inside this element, both structure and content are included. These are optional, but you want to
have at least one of them to have a functional file.
<?xml version="1.0" encoding="utf-8"?>
<database>
!
<structure>
!
!
...
!
</structure>
!
<content>
!
!
...
!
</content>
</database>

2.2 The Element structure


This element represents a structure template. Inside it, there must be two other elements: name
and value. name specifies the name of the structure, while value contains the structure itself.
<structure>
!
<name>Basic Site</name>
!
<value>index.html
about.html
css/style.css</value>
</structure>

Note that after the start of value, everything is like what is contained in a string. When there are
newlines, simply type a newline and continue with the text. If you indent what is after the newline,
the generated result may not result in a desired effect.
<value>index.html
about.html
css/style.css
</value>

Generates:

2.3 The Element content


This element may contain four child elements: name, value, shortcut and type. name and value act
exactly as in the previous structure element. The shortcut element contains what you might have
already guessed, the shortcut for that content entry. The type is a bit special. It needs to contain a
single integer value, as presented in the following table:

Integer

Meaning

Causes value to contain:

Custom Text

The custom desired text

File Contents

The path to the file

Folder Contents

The path to the folder

URL

The desired URL

Example 1: Custom text, named Reset, shortcut rst


<content>
!
<name>Reset</name>
!
<shortcut>rst</shortcut>
!
<type>0</type>
!
<value>* { margin:0; padding: 0; }</value>
</content>

Example 2: URL, named CodeIgniter, shortcut ci


<content>
!
<name>CodeIgniter</name>
!
<type>3</type>
!
<value>http://codeigniter.com/download.php</value>
!
<shortcut>ci</shortcut>
</content>

As you could see from the last two examples, the order in which elements internal to content or
structure are presented doesnt matter.

Potrebbero piacerti anche