Online documentation - WebsydianExpress v3.0 |
The export and import of site structure elements provides a way to move parts of a site structure from one site to another.
You can use this to duplicate structures from one site to another - even in cases where the two sites are installed on different servers.
The export and import are performed from the site structure in the administration interface.
The export creates a text file containing data from the site structure - the import uses this file to generate a similar structure or to modify an existing structure according to a set of rules that is described in detail below.
Note that this process does not copy any program objects or templates, it is only the necessary site structure definitions that are being copied.
So you for instance need to copy a business process from one installation to another (e.g. from a test server to a production server), you will have to start by copying the programs and templates before copying the structure definitions using the export/import functionality.
Another important thing to note is that unless you have the same roles in the test and the production sites, the site structure will be imported - but only the roles that are defined in the production site will be assigned to the imported site elements.
The export of a part of the site structure is done by selecting the top site element of the structure you want to export - and pressing the "Export" button.
A pop-up window shows the information about the selected site element in the structure - and gives you an opportunity to specify the encoding you want to save the export file in.
You can also type a comment that describes the content of the export file - this is highly recommended as it makes it easier to ensure that the correct data is imported.
Based on your browser settings the file will either be saved automatically to a default location on your PC - or your will be prompted to either open or save the file.
You should choose to save the file.
The export file will now be available to use for the import in another site.
The file will contain information about the selected site element and the entire sub-structure scoped by the selected site element.
The following information is exported for the sub structure:
In addition to this, the export file contains information about the export itself (when it was performed, site, user etc.).
The export file also holds information about the type of the parent of the selected site element.
The import is also performed in the site structure.
The import is performed by selecting the site element that should be the parent of the imported structure and pressing "Import".
When you do so, a pop-up window that will handle the upload of the file from your PC to the web server is opened. This window will start an applet where you will be asked to select the file to import.
In most cases, you will be shown a security warning, which you must accept to perform the upload.
Press the button Import file to be shown an open file page - select the file in the page, press upload to copy the file from your PC to the web server.
After the application has uploaded the file, the pop-up window will be populated with information about the export (Time, user, site, WebsydianExpress version, and the comment you can specify when exporting).
Press the import button to perform the import.
After the import has been performed, a status page showing the result of the import attempt is shown. If errors have occurred, a reference to a message log message that scopes the messages generated by the attempt will be shown.
The parent element for the structure to be imported must have the same type as the parent of the site element you selected when performing the export.
If a wrong type of site element has been selected, the import will result in an error - the structure will not be imported.
If you have exported a frameset that is scoped by the site root - you must select the site root in the import site when you perform the import.
If you have exported a business process that is scoped by a menu - you must select a menu in the import site when you perform the import.
If you have exported a menu that is scoped by a frameset - you must select a frameset when you perform the import.
If you have exported an entire site by selecting the site root, you must also select the site root in the import site to import the structure.
The general rule is that if a record in the export file already exists in the import site, it will not be imported. This is to ensure that any manual changes that might have been made to the data in the import site won't be changed.
It might not be necessary to understand the exact rules for which records the import will create and which existing records it will reuse - but if you want to understand exactly what happens when you perform the import, the rules are described here:
The export file contains information about all the content loaders that is used by the exported site elements. These content loaders are created in the import site if they does not already exist in the import site.
The rule is: If the import site contains a content loader with the same program name as the one that is imported, the existing record is used.
If the name of the processes is not the same, an information message is written to the message log.
1.
The exported site element "MyElement" refers a Presentation "MyPresentation" for the process "MyProcess" that has the program name "MyProgram".
The import site contains a process "MyProcess" that has the program name "MyProgram".
Result: The existing process "MyProcess" is used - no information is written to the log.
2.
The exported site element "MyElement" refers a Presentation "MyPresentation" for the process "MyProcess" that has the program name "MyProgram".
The import site contains a process "MyNewProcess" that has the program name "MyProgram".
Result: The existing process "MyNewProcess" is used - information is written to the log.
3.
The exported site element "MyElement" refers a Presentation "MyPresentation" for the process "MyProcess" that has the program name "MyProgram".
The import site contains no processes with the implementation name "MyProgram".
Result: A process with the name "MyProcess" and the program name "MyProgram" is created.
The export file contains information about the presentations that are used by the exported site elements.
For each presentation, the content loader that is referred by the presentation is found (as described above, this can either be one that has just been created - or an already existing one).
If this business process already has a presentation that has the same template suffix, override name, name, and properties, the existing presentation is used - otherwise a new presentation is created.
1.
The exported presentation "MyPresentation" has no suffix, no template override name and no properties.
In the import site, the business process has a presentation "MyPresentation" with no suffix, no template override name, and no properties.
Result: The existing presentation is used.
2.
The exported presentation "MyPresentation" has no suffix, no template override name and no properties.
In the import site, the business process has a presentation "MyPresentation" with the suffix "_SUF", no template override name and no properties.
Result: A new Presentation named "MyPresentation" with no suffix, no template override name, and no properties are created. The process will now have two presentations with the name "MyPresentation" - a message is written to the log.
3.
The exported presentation "MyPresentation" has no suffix, no template override name and no properties.
In the import site, the business process has no presentations.
Result: A new Presentation named "MyPresentation" with no suffix, no template override name, and no properties are created.
The export file contains information about each alias that is referred in the exported structure.
For each alias in the export file, it is checked whether the import site contains an alias with the same alias ID. If no alias is found - a new alias is created - otherwise the existing alias is used.
If an existing alias is used - and the description of the alias is different - an informational message is written to the message log.
1.
The export file contains an alias with the ID "MyAlias" with the description "This is used to make a menu service to my process".
The import site has no Alias with the ID "MyAlias".
Result: The Alias is created in the import site.
2.
The export file contains an alias with the ID "MyAlias" with the description "This is used to make a menu service to my process".
The import site contains an alias with the ID "MyAlias" with the description "This is used to make a menu service to my process".
Result: The existing alias is used.
3.
The export file contains an alias with the ID "MyAlias" with the description "This is used to make a menu service to my process".
The import site contains an alias with the ID "MyAlias" with the description "This is used to make a menu service to my new process".
Result: The existing alias is used - an informational message is written to the message log.
The export file contains information about the frame each content loader targets.
For each of these frames, it is checked whether the import site contains a frame record with the same name - if it does, the existing frame is used; otherwise a new frame record is created.
1.
The export file contains a frame called MAIN.
The import site contains a frame called MAIN.
Result: The existing frame is used
2.
The export file contains a frame called NEWMAIN.
The import site contains no frames called NEWMAIN.
Result: A new frame called NEWMAIN is created.
In many cases you will export a substructure from one site - and import it as a new sub structure in another - in these cases all the exported site elements and the links between them will be imported.
If the marked structure is exported (MENU - My Menu is marked when export is pressed):
And then imported into a structure like this (Main Frameset selected when the import button is pressed):
Then the resulting structure will be:
But the import export also offers a way to update existing structures. This makes it possible to perform several imports of the same structure without having the remove the structure in the import site.
The exact way the import process determines whether a site element should be created and attached to the site structure is as follows:
For each site element in the export file it is checked whether a site element already exists at the same location as the one the site element should be attached at (for instance the alignment/sequence if the parent is a menu item). If there is no such site element, a new one is created and attached to the site structure.
If a site element already is in place at the specified position, it is checked whether it uses the same presentation and has the same name as the imported one. If this is the case, the existing one is used - if not, a new site element is created and attached in the specified location.
For example if the import described above already has been performed - and a new process has been added to the menu in the export site. In this case it is still possible to export the entire menu and import it in the new site.
So the export site would look like this - and the export file will contain information about the boxed part of the structure:
Before the import, the import site will look like this.
And after importing the structure it would look like this (The Main Frameset is selected again when performing the import).
The only thing that has been imported is the boxed menu item.
However, you should be aware that if information about the imported menu items has been changed after performing the first import, the second import might duplicate the existing menu items.
So if the import site for example has been changed to:
And the same structure is imported - the following structure will be the result in the import site:
The two boxed business processes has been imported - the three other business processes are the ones that already existed.
As described above, an unchanged site element that is imported twice in the same location in the site structure of the import site will only lead to the creation of one site element in the import site structure.
This is significantly different when you import the site element in another location in the import site structure - for each location you will find that a new site element is created.
So if you have the following export structure - and have exported the My Process site element.
And then has imported the site element into two different positions in the import site structure as shown below.
In this case the two My Process elements are different site elements - this means that if the roles are changed for one of these site elements - it will not have any impact on the other My Process site element.
The information about the roles that authorize each site element is also part of the export file.
No roles are created as part of the import - but if the import site has a role that has the same name as a role that authorizes a site element in the export site - this role will be assigned to the imported site element in the import site.
1.
An exported business process is authorized by the roles:
"User", "MyRole"
The import site contains the roles
"User", "Administrator", "Anonymous"
Result: When the site element is imported it will be authorized by the role "User".
2.
After the first import was done, the role "MyRole" is created in the import site - and the import performed again (without removing the imported business process).
Result: The site element that was imported in example 1 still exists - and now it is authorized by both "User" and "MyRole".
No languages are created in the import site.
For each translation of the site element texts, it is checked whether the language code has been defined in the import site. If the language exists, it is checked whether the site element already has got a translated text for this language (only relevant if an existing site element has been found - see above) - if no translation is found the translation is created.
1.
A business process has been created with the name Export process:
A translation to Danish has been made:
When this business process is exported the export file will contain information about the translation.
Result: If the import site has no languages specified, the translation will not be imported. If a language with the language code DAN is created and the import redone, the translation will be imported.