System / Add-in Manager / Run V1.0 to V2.0 View Converter

Converting Newer 1.0 Views to 2.0 Format

The view converter utility converts newer 1.0 views to 2.0 views . It:

  • converts all standard 1.0 elements
  • keeps all custom view elements (HTML fields, JavaScript)
  • converts frameset files referenced from views into equivalent 2.0 layout files

You may wish to convert newer 1.0 views to 2.0 format so that you can obtain the increased performance offered by 2.0 format.

Note : The view converter does not convert older 1.0 views (XSL-based views, views without panels, MDX views, and MDX chart views). These views can run in Web Central in backward compatibility mode.

If you wish to have these types of views in 2.0 format so that you can run them in Windows, you can use the View Definition Wizard to re-create them. For information, see Re-Creating Windows Views and 1.0 Format Views in 2.0 Format.

Running the View Converter

The View Converter is accessed from System / Add-In Manager / Run V1.0 to V2.0 View Converter .

Select a domain and application. The View Converter displays all the tasks for that application.

Checking a view before converting

Before converting a view, you may wish to analyze it and see the types of changes that the converter will make. The analyze feature runs the View Converter in noWrite mode. With this mode, the converter:

  • generates a log file
  • does not write the conversion to disk
  • retains the original view
  • displays a message in the view's Comments field about converting the view (view will automatically convert, view needs manual conversion, view is already in 2.0 format, and so on)

To check one view at a time, run the Analyze view button in the view's row.

To check all views for an application, run the Analyze Views button at the top of the panel.

Converting a view

To actually make the conversion, you use the Convert Views button (at the top of the panel to convert all views at once) and the Force Conversion button (for an individual view). These buttons:

  • write all successful conversions to disk
  • back up the original views to a new name in the format originalName_bak.axvw in the original directory.
  • replace the original views with the changes
  • displays a message in the view's Comments field about converting the view (view needs manual conversion, view is already in 2.0 format, and so on)

The Convert Views button at the top of the panel attempts to convert views for all tasks in the current application. The process fails if any of the following conditions are true:

  • the view is an analysis view using MDX
  • the view uses XSL to handle rendering of the HTML
  • the view uses a nested afmTableGroup
  • the view contains macros that cannot be resolved
  • the view does not contain a panel or tab element within each afmTableGroup
  • the view includes a JavaScript file

If the group conversion fails, you can use the Force Conversion button to convert an individual view. Unlike the group conversion, a conversion of an individual view supports converting views that use JavaScript or XSL or that contain nested table-groups. The converter inserts a missing panel element based on the type of the afmTableGroup .

For views with nested table-groups, the utility converts each nested afmTableGroup into a top-level dataSource and panel. For each panel except the first, the panel’s showOnLoad attribute is set to false . If the afmTableGroup is of type=’report’ the panel fields are all links refreshing the next panel.

Checking the log file

Each analyze and convert button action produces a last-conversion-log file per user. This log file is displayed in a dialog at the end of the process, and can be seen again, without running the conversion process, by choosing the Display Last Log button at the top of the main panel. Each analyze and convert button action also updates the Comments column noting whether the task is convertible, already converted, or why it cannot be converted automatically.

Running the View Converter from the Command Line

You can run the view converter as a command-line utility. Depending on the options that you supply, the utility can convert a single file, a folder with files (i.e. application), or a complete folder tree (i.e. product).

The script, convertView.bat , located in the \schema\ab-core folder, takes several arguments. It requires the path to the view or directory that is to be converted as one input argument. The utility also takes several optional arguments:

convertView [-logVerbose] [-reportBrief] [-noWrite] [-passJS] fileOrDirectory [WEB_INF_DIR]

When the converter has finished converting a view, it writes the updated view to the original directory and backs up the original view to that directory by changing its file name using the format originalName_bak.axvw . A status report will be written to the console for each view that it tries to convert.

The path to the view or directory to be converted must be given relative to the current directory. For example, if you would like to convert all the views located below \archibus\schema\ab-products\workplace\reservations\view , you can call the command line utility using the arguments as shown below:

\apps\archibus\schema\ab-products > convertView workplace\reservations\view
or
\apps\archibus\schema\ab-products\workplace\reservations > convertView –logVerbose view

The status report contains a line for each major step in the conversion and a final status line stating whether the conversion passed or failed. By default, the full status report is written to WEB_INF\log\conversion.log and the summary line is written to the console. By using the optional argument –logVerbose the whole report can be written to the console. This is useful for failed conversions to see whether the view is a legacy view or is there is a syntax problem within the view.

The converter can be run in an analyze mode using the –noWrite flag to give a report without actually converting the views. In this case, the original view(s) will not be overwritten. The additional optional arguments are described in detail in the comments to convertView.bat .

In the image below, the first conversion passed and the second failed because the view is considered a legacy view – it has no panel element. Prior to running the converter, the bat file setPath.bat adds ab-core to the PATH so that you can run the converter from any application directory without using the absolute path to convertView.bat . command prompt showing one failed and one successful conversion

You may copy and modify the script to suit your needs if you’d like to use it in a different directory. The script contains some internal variables that will need to be modified to adapt to the directory structure where you move the script.