Creating a custom UDM  
 
 
 
  1
4
   
  Adding a node
 

Click on the node below, to which you would like to add another and then click on the Add node button. A wizard in the inner right frame will take you through a series of steps to create a child node.

   
  Step 1: Essential node attributes
 

You can give the node a name unique in the UDM. The name is case sensitive and spaces and special characters are not allowed.

   
 

The parent node name is the name of node for which you are creating the child and it will be automatically filled in.

   
 

zeroCode automatically generates the ID for every node in a sequence and that is shown, too.

   
 

Node content propagation is the manner in which you want the content for/from this node to be propagated on the page and back to the data source. The options are:

 
  1. Read Data - this option generates HTML that displays retrieved data.
  2. Edit data - this option allows values to be retrieved from the data source and edited values put back.
  3. Add new Data - this option will allow both the addition of new data as well editing values.
 

If you want to retrieve the value of a node y in a data tree rooted at x, the UDM tree will compute the path from x to y. You can now use this path to drive the search process. The UDM tree will also cache these search paths, so it doesn't have to recompute them each time.

   
 

Vector node: A vector node is one that retrieves or updates more than one instance of data, i.e. it retrieves or updates a list of multiple values. This is in contrast to a non-vector node, which can only have one instance of associated data values. For example, if the node employee is marked as a vector node, it means that there may be one or more occurrences of Persons associated with employee. Each such instance has its own copy of an ID, name and gender data elements. A vector node may have other vector nodes as children or descendants. This means that, in each occurrence of the parent aggregate, there can be one or more occurrences of the entire aggregate represented by a child. As an example, we could create a UDM that includes a vector node named departmentList, for example, representing all the departments in a company. Each department could have one manager and a vector of the employees in that department as children. Further, we could add multiple addresses for each employee, producing data output that could look like this:

   
 
       
       
         
         
         
         
         
       
         
         
         
 

Note that a leaf node cannot be designated a vector node; by definition, a vector node retrieves multiple rows of multiple columns of data.

   
 

The TreeRetriever algorithm is such that the sorting and limiting function of the vector node is deferred until the recursion unwinds to the parent. When the retriever reaches a vector node, all the content for that node's attribute children as well as its sort key path (if any) is retrieved. But the non-attribute children of the vector node are not retrieved at this point. When the recursion unwinds to the vector node's parent, the vector node's content is sorted, limited to its pageful to show on the screen and then its non-attribute children are retrieved. Since the limiting function is deferred, you can use the vector functions in siblings of the vector node.

   
 

Dataport: This option allows you to fetch data either from the auto-generated database objects or from any of a set of utility objects (server side objects e.g. current date and time etc.) by providing the data port to access. The dataport has the following options:

   
 

1) Database: The source from which you can retrieve, delete, insert or update data.

   
 

2) Utility Objects: These are server side objects. For e.g. helps in fetching server date 

   
 

3) Integer Sequence: Generates a sequence for the number fields.

   
 

4) Date decoder : It facilitates retrieval of the server date and decomposes it into year, month, date,  day of the month, day of the week, day of the year, hour, minute, second, millisecond.

   
 

5) Expression: It includes the datatypes integer, date & time and string. It helps in retrieving a record using an expression. However, if the dataport type is expression it is not possible to create a vector node.

   
 

Choose the name of the dataport. Any objects you may have added into the lib directory in your site will be shown at a later stage in the wizard, if you chose the Utility objects as the option.

   
 

Choose your options and click Next to get to the second step of the wizard.

   
  Step 2: Node type
   
 

The new node's name is the name you keyed in at the first step.

   
 

The parent node name is the node below which you are creating your node.

   
 

Modification mode shows the type of "content propagation", i.e. the manner in which data is impacted. For example, if you chose "display only" in the first step, that's what will show up here.

   
 

The value for the option "Node is a vector node" needs to be a "Yes" if you choose to retrieve multiple rows of data. Otherwise, the value for this option needs to be a "No".

   
 

The object store class name is the fully qualified Java object library that retrieves data from the data source. Choosing the database as your data port in the previous step will show the name of the Java object that zeroCode generated earlier to access a given table.

   
 

Data type is a drop-down list box that has all the table names from the database. Select the name of the table on which you want to perform insert/update/display. zeroCode supports datatypes like money, US Phone numbers, US Zip code, Date_Only, Time_Only etc. as extended datatypes. In particular, if a node id is used in a where clause, and that node is of a specific datatype, then the node's extended datatype determines the SQL generated for comparing it with other nodes.

   
 

If you have chosen the node as a vector node then you need to enable the "Pagination" option and select the maximum elements (records) to be displayed on a page.

   
 

Choose your options and click Next to get to the third step of the wizard.

   
  Step 3: Database parameters for retrieval
   
 

The new node's "type" (object/table name) is shown from your previous choice. Here, you will notice that the name shown is the name of the Java object that retrieves the data from your data source.

   
 

Choose terms for data retrieval. The Content to retrieve helps you retrieve content from your data source based on the following options:

 
  • You can select/display the standard list of matching record(s) that exist(s) in the database.
  • You can choose to retrieve only a record count.
  • You can also choose to retrieve an aggregate term like the largest, smallest, sum or average value of relevant values of the chosen node.
 

Apart from these aggregate terms, all the foreign-key references from your data object will also be listed, with options to equate them with session variables or variables passed to the UDM.

   
 

Choose your options and click Next to get to the fourth step of the wizard.

   
  Step 4: Additional database parameters
   
  Your new node's name is displayed.
   
 

In this step, you can add two additional partial "where" clauses that affect the retrieval of data for this node. The combos list all the possible columns that you could use in the "where" clause. You can choose to use any of them with conditions like <, <=, =, >, >=, !=, begins with, ends with, contains etc. and finish the clause with appropriate values in the right side of the clause.

   
 

The object store class name is the fully qualified Java object library that retrieves data from the data source. Choosing the database as your data port in the previous step will show the name of the Java object that zeroCode generated earlier to access a given table.

   
 

Click "Save" and the child node is created For an "insert only" type, follow the same sequence in steps 1 and 2. Note that, if the node's is of type "insert only", you will not be taken through steps 3 and 4, since you cannot add additional constraints to an insert function.

   
 

If you do not choose appropriate tables for a child node of a node that already retrieves data from the database, you will get an error that "There is no path between parent and child". If you try to insert and update non-related tables, also, you will get an error that you "Cannot have read-write nodes with non-related tables".

   
  You can also test for non-null table columns while adding a new node.
   
 
   
  1
4