Working with the Dynamic Template Designer > Adding or Editing Methods
  
Version 10.0.01
Adding or Editing Methods
Methods that can be used in report templates are created with the Dynamic Template Designer. These methods are listed in the Methods View panel. This list includes both system methods and user-defined methods.
User-Defined Methods
Only user-defined methods can be edited or deleted. When you select a user-defined method in the Methods View panel, at the top of the Methods View pane, you’ll see the following buttons that enable updates.
A method cannot be edited under the following circumstances:
The fields in the method are in use in a report template.
A table used in the Join clause is not relevant for the enterprise object.
Within the Method Designer window, the following buttons enable functionality that is available only for user-defined methods. Note that System Methods will have certain buttons disabled, as described in System Methods.
Validate Query - Validates valid syntax only for the query and the With clause, if used.
Save - Before saving, the query is validated. See Validate and Save a Method.
Save As - Enables a copy and save function so that you can clone and modify methods.
Cancel - Ignores any changes that have been made since the last save.
Help - Accesses the context-sensitive help for methods, with details that can assist in method creation.
System Methods
System methods shipped with Hitachi Storage Viewer cannot be edited or deleted. When you select a system method in the Methods view panel, at the top of the Methods view pane, you’ll see the following available buttons.
Within the Method Designer, the following buttons are available only for user-defined methods.
Validate Query and Save are disabled for System Methods.
Save As - Clone and modify system methods to take advantage of factory-shipped functionality.
Cancel - Dismisses the dialog window.
Help - Accesses the context-sensitive help for methods, with details that can assist in method creation.
Accessing Methods
1. In the Portal, select Tools > Templates > Method Designer.
2. To Add a Method, click Add at the top of the view panel to launch the Method Designer window.
3. To Edit a Method, double-click a method or select a method and click Edit.
4. In the Method Designer, define and edit the following method components.
Name
This user-defined name for the method, limited to 100 characters, must be unique.
Short Name
This user-defined, case-insensitive name must be unique, with the following constraints:
Limited to up to 23 characters.
Cannot begin with a number.
Cannot contain special characters or spaces.
Use this name when defining a WITH or JOIN clause. During query validation, you may see this name listed in error messages.
Short Description
This description, limited to 200 characters, is displayed in the methods view panel.
Long Description
The long description is limited to 4,000 characters. Use this description to provide essential details, such as prerequisites, which will aid anyone wanting to customize the method.
With Clause
Use the SQL WITH clause to assign a name to a subquery block so that it can be easily referenced in the query. The WITH clause must follow these rules:
WITH clause aliases must be unique across all the functions used in a report template; therefore, create an alias in the following format:
<function_name><number>

Example: BackupWindow1
Cannot contain Oracle reserved words that can alter data in the database; for example, DELETE, UPDATE, or INSERT.
Query
Define the SQL query with SELECT statements to return data from the database.
Cannot contain Oracle reserved words that can alter data in the database; for example, DELETE, UPDATE, or INSERT.
All columns in the SELECT clause must be aliased; for example,
SELECT decode(client_id,1,'121212',2,'2323',5) A
FROM apt_v_job
The function, collectString, can be used in the Method Designer to concatenate distinct values. The Oracle function, aptStringConcat with DISTINCT or UNIQUE, cannot be used to concatenate values in a method, even though the method will validate and save. When that method is used in a report template, it will fail.
Join Clause
Use the SQL JOIN clause to combine results from the Method with the results of the template. The JOIN clause must follow these rules:
The JOIN conditions should use relevant enterprise object tables only. See the Dynamic Template Designer to view the table associated with a field.
Only the equal sign (=) is supported.
The method’s field should always be defined on the left side of the equal sign (=) .
SQL functions, such as UPPER, DECODE, or LOWER cannot be used in a JOIN clause.
Certain database tables cannot be used in JOIN clauses. See Exception Tables for a Method’s Join Clause.
5. Click Validate Query at the bottom of the Method Designer window to validate the query.
Validate Query only validates the With and Query components. If an error exists, both components will be bordered in red, indicating that the validation has failed. In addition, after validation, the Fields pane will be populated with the fields (database columns) that are used in the query.
6. At the right of the Method Designer window, the Fields and Resources buttons enable the following configurations and capabilities.
Fields
When adding a Method, the Fields pane will be populated only after the query has been successfully validated.
Check the boxes to select the fields that will be available in the Dynamic Template Designer so that the method can be included in a report template.
Several entries are required for each field before the method can be successfully saved.
Label: User-supplied. This label is what will appear in the Report Template.
Field Name: Pre-defined by the Method Designer.
Short Description: User-supplied.
Long Description: User-supplied.
Resources
Enterprise Object: Select an enterprise object—Data Domain, Host, Job, or Storage Array. This selection makes a method available to only templates created for that object. It also drives the list of tokens that are available for use in a query to enable variable substitution at report run time.
Product: Select a specific vendor product (subsystem) for the enterprise object; for example, for a storage array enterprise object, EMC VNX (Celerra).
Tokens: These tokens can be used in a query to enable variable substitution at run time. Place your cursor at the insertion point in the query and double-click the token. See Tokens for Methods. The list of relevant tokens is driven by the selected Product Group.
7. Click Save. See Validate and Save a Method and User-Defined Methods for the rules that are being checked before saving the method.