OneClick Customization

Contents
casp1031
Contents
OneClick provides a flexible platform for administrators to modify aspects of the application to meet specific requirements. For example, you can modify OneClick behavior to support the unique structure of a site, an enterprise and network environment, work processes, and software deployments. Make your modifications using the OneClick UI or by coding the changes in the XML files that are provided for that purpose. 
! Do not add customizations to the files in their default location (
<$SPECROOT>
/tomcat/webapps/spectrum/WEB-INF/console/config/). The customizations in that directory are ignored. In addition, these files are overwritten when you perform 
CA Spectrum
 and OneClick upgrades.
Prerequisites for Customizing OneClick XML Files
Before you attempt to customize OneClick files, be aware of the following requirements:
  • You must be able to create and modify files on the OneClick server.
  • You must be familiar with the fundamentals of XML coding as well as the 
    CA Spectrum
     and OneClick directory structure.
  • You must know the following:
    • The file whose functionality you want to extend with your modifications.
    • The directory in the 
      <$SPECROOT>
      /custom directory structure in which to create your custom file.
Extend Factory XML Files
You can extend default XML files to accomplish OneClick customizations without overriding the entire factory default file. Customized XML files are not removed during a 
CA Spectrum
/OneClick software upgrade or reinstallation.
To extend the default OneClick XML configuration files, create a file with the same name as the default file in the appropriate custom directory. Use the XML idref attribute in the new file to refer to the default OneClick file of the same name. Code the new functionality in this file. When OneClick parses the XML files, the changes in the new file are added to the existing factory file referenced using idref.
By extending factory files, you are able to take advantage of new features and functionality available in software updates to the factory XML code while preserving your customizations.
Although you can still override a factory XML file by creating a copy of it in the 
<$SPECROOT>
/custom directory and making your changes in the copy, using the IDREF XML attribute provides the ability to inherit and extend the factory file, while maintaining customizations in streamlined files.
Override Factory Files
Override a factory configuration file by copying the original file to the appropriate custom directory, and then adding new XML code or modifying the existing XML code. OneClick reads the files in the custom directory first. If the file exists in the custom directory and does not contain an idref statement referencing the original factory file, OneClick does not read the original factory file, and the new file overrides the original factory file. 
! Do not add customizations to the files in their default location (
<$SPECROOT>
/tomcat/webapps/spectrum/WEB-INF/console/config/). The customizations in that directory are ignored. In addition, these files are overwritten when you perform 
CA Spectrum
 and OneClick upgrades.
Inherit Features in Factory XML Files
Using idref to extend XML files has applications beyond extending the factory file with the same name. You can use this technique to inherit or reuse features in any file of the same type. For example, you can create your own model types that have a customized details view defined in view-mymtypedetails-config.xml. This model type can also inherit the default device views configured in view-devicedetails-config using idref. The new custom file extends the functionality of the default file while also inheriting the views in the default file.
Example Extending Factory XML File
The example in the following figure extends the functionality of the factory default 
<$SPECROOT>
/tomcat/webapps/spectrum/WEB-INF/topo/
config/view-devicedetails-config.xml file by adding the code for the new subviews in 
<$SPECROOT>
/custom/topo/config/view-devicedetails-config.xml. The default factory file view-devicedetails-config is specified in an "idref" statement.
Extending Factory XML File
Extending Factory XML File
This section contains information about the following topics: