Customizations with Add-on products

 View Only

Customizations with Add-on products 

Wed March 25, 2020 02:34 PM

Preventing lost customizations when add-on products are installed

If you have custom classes and extend the same classes which other products also are extending, then those classes will get overwritten when other products are installed and your customizations will be lost.

In order to maintain the customizations, you must define a customer.xml file in the applications\maximo\properties\product folder.

xml files in the product folder are run alphabetically. If a particular product xml file needs to be run first, then assign it an alphabetical name, such as a_XYZ.xml.

The following example shows a customer.xml file.

<?xml version="1.0" encoding="UTF-8"?>

<product>

            <name>Customer Product</name>

            <version>

                        <major>7</major>

                        <minor>1</minor>

                        <modlevel>0</modlevel>

                        <patch>0</patch>

                        <build>BUILD</build>

            </version>

            <dbmaxvarname>DBCUST</dbmaxvarname>

            <dbscripts>cust</dbscripts>

            <dbversion>V7100-12</dbversion>

            <lastdbversion>V7100-01</lastdbversion>

            <extensions>

<mbo objectname='PM' extends='psdi.app.pm.PM'>cust.pm.CustPM</mbo>

<class extends='psdi.app.pm.PMRemote'> cust.pm.CustPMRemote</class>

<mboset objectname='PM' extends='psdi.app.pm.PMSet'>cust.pm.CustPMSet</mboset>

<class extends='psdi.app.pm.PMSetRemote'> cust.pm.CustPMSetRemote</class>

<field objectname='PM' attributename='JPNUM' extends='psdi.app.pm.FldPMJpnum'> cust.pm.CustFldPMJpnum</field>

 

<service servicename=’ PM’ extends=’psdi.app. pm.PMService’> cust. pm.Cust PMService </service>

<bean presentation=’PM’ controlid=’pm_table’ extends= ‘psdi.webclient.beans.pm.PMAppBean’> psdi.webclient.beans.productA.pm.CustPMAppBean </bean>

</extensions>

 

</product>

dbmaxvarname -  Database maxvar name in maxvars table for the product. This name is created automatically the first time that the updatedb utility is run with this product xml file.

dbscripts - The directory in tools\maximo\en\cust where all script files are located.

dbversion - Current database script number. Scripts will run till this version.

lastdbversion - Last release version or first script number for this release.

depends – Name of the file on which this product depends.

extensions – This is useful when more than one product implements the same object. For example productA has a class file for object PO and productB has a class file for same object PO. Then the class file of productB should extend from class file of productA.

 

The xml files defined in product directory are run by using the Updatedb utility in the tools\maximo folder.

 

For each product description file in the product folder, updatedb first runs database scripts in tools\maximo\en\cust and then runs the extensions. If a depends tag is present, updatedb checks whether the file name specified in the depends tag exists in the product directory and is already run before this file or not. If the file exists and is already run before this file, updatedb continues running this file. Otherwise, this file is skipped and the next file is processed in alphabetical order. For example, Mobile-calibration depends on Mobile. We should run Mobile-Calibration only if Mobile is already run. So we can add a depends tag in the mobile-calibration product file.

If you want to run part of the custom script\classes before and the dependent part later, you can keep customer.xml without the depends tag to run at beginning and create another product xml with depends tag to run after other products.

Extensions can contain mboset, mbo, attributename, service name, bean class name and regular java class name.

The mboset tag specifies the mboset class name to implement for an object for a product. Similiarly the mbo tag specifies the mbo class name to implement for an object for a product. The field tag specifies the class for the object and attribute. The service tag value is the class name for the service name, and the bean tag will have the bean class name for a control id in a presentation. The class tag specifies any other class that the product implements which doesn’t belong to the mboset/mbo/service/field/bean category described earlier. If the objectname specified already exists in the any of the last product description files, updatedb opens the class file specified by the classname and extends the class file with the class name specified for the object in any of last product description files. If one of the product description files throws an error, updatedb will not proceed further. For the bean tag, updatedb will modify the presentation to set the beanclass name for the controlid. To update extended presentations in different products, the extendpresentation tag is added. Extendpresentation takes the extended application name, base application name and comma separated list of product xml files name to which the xml extension change needs to be applied.  At the end updatedb will rmic all class files specified in the mboset tag and mbo tag for all product xml files.

Statistics

0 Favorited
7 Views
0 Files
0 Shares
0 Downloads