Transforming the search template
You can transform the classic user interface search template to the business user
interface search template. The transformSearchTemplates.sh
script enables an
administrator to transform existing search templates in the format of the classic user interface
search to search templates in the format of simplified search.
Running the shell script from the command line
- Log in to the Linux account used to perform maintenance on an Product Master installation.
- Set the current directory to $TOP/bin/migration.
- Run the following
command.
./transformSearchTemplates.sh --cmpCode=companyCode [--adminUser=adminUser]
- companyCode
- The code of the company whose templates are to be transformed (this is the same as the company you specified in the Product Master login screen).
- adminUser
- Optional: This is the name of the administrative user to whom is assigned ownership of templates
whose owner is not defined in the classic UI. If no value is provided, the default is
Admin
.
Log file usage
Log files are in the directory $TOP/logs. Before the script is run for the first time there is no log file. When the script is run for the companycmp
it generates
a log file with the name transformSearchTemplates_cmp.log.
If the script is run a second time, it uses this log file to limit
processing to just those templates for which the initial attempt to
transform failed. Before it writes the new log file, the script copies
the existing log file to a backup called transformSearchTemplates_cmp.log.bak in
the same directory. Subsequently, the script will not run if the backup
file exists, and instead it will prompt the user to archive this file
(if wanted) and then remove it. If a user creates a bookmark in the classic UI after running the transform script once, then you must rename the previously created log files for that company in order to transform the newly created bookmarks.
The lines in the log
file look like this:
+:2803:202: Template testc for user Admin copied to new UI templates
-:2805:202: Template ntestc has a name conflict for user Admin
*:6413:5602: Template excp for user user1 encountered exception
java.lang.NullPointerException: null: com.ibm.ccd.ui.search.TransformSearchTemplates.makeBlob(TransformSearchTemplates.java:863)
The
first character in the line denotes whether the transform attempt
succeeded or failed, as follows: - Plus "+"
- The template was transformed successfully.
- Minus "-"
- The template could not be transformed because a template with the same name exists in simplified UI format.
- Asterisk "*"
- The template could not be transformed because the specified exception was encountered. This probably indicates that the data for the classic UI template is incomplete or inconsistent.
Transform rules
Ensure that you are familiar with the following rules that govern the behavior of the program when the transformation is complete.- The default template option is always turned off for a transformed template.
- The transformed template is marked as shared if and only if the
new owner is a user with administrator privileges. In the classic
UI, if the template was created by an admin user the owner id is set
to
-1
, therefore the actual owner is effectively lost. By default, the owner in the transformed template is set to the user given in the command line (orAdmin
). However, if there is associated data, that data always has an identifiable owner so that owner replaces the unknown admin owner in the new template. In that case, the transformed template is shared if and only if that owner has administrator privileges. - The Save values option is turned on in the transformed template if and only if the corresponding source template has associated data. Data are saved by use of the Bookmark button in the classic UI search screen.
- The classic UI has an Included check box for each attribute. An attribute is included in the search only if that box is checked; at least one attribute must be checked or the search fails. When the data are saved using the Bookmark button, data are saved for all the attributes, whether the box is checked, and the state of the box is also saved. There is no corresponding capability in the new UI – all attributes that are displayed in the template are included in the search. During the transformation, all attributes in the data for the source template (if it has data) are included in the transformed template, whatever the state of the Included check box.
- It is sometimes necessary to create default data in the transformed template. The classic UI and new UI differ in the way they assign the default predicate operator. In the classic UI, the operator choices are presented in a drop-down list ordered alphabetically for the users locale, and the first operator in the list is the default (in en_US, it is usually "Begins with"). In the new UI, the order is defined by a list in Product Master and a particular value is chosen as default (often "Equals"). The default operator in the transformed template is the one that applies in the classic UI. That is, the operators in the source and transformed templates are literally the same.
- In the classic UI, the template and data are stored separately, whereas in the new UI the template and data are stored together. There is a common use case where this matters, for example, in the classic UI an admin user creates a (shared) template with no data, and three other users load this and then bookmark their own data; there is one template and there are three data sets. In the transformed templates, there are three templates with data, one for each user. In addition, a fourth "transformed" template is created, whose owner is the specified admin user, with empty default data.
- Order of attributes may be different in classic bookmarks than in transformed templates. Templates are attribute collections, and those are sets and not necessarily ordered.