Author Mode

As a TeamSpace user, you can customize the appearance of behavior of your forms–without writing code or using an integrated development environment (IDE)–using the widgets that display in Data Explorer in Author Mode. In Data Explorer in Author Mode, you can create and update your tables, edit Data Explorer settings, and edit the layout of Data Explorer. In Data Explorer in user mode, you can view and edit your data and verify your entity REST endpoints.
lac42
As a TeamSpace user, you can customize the appearance of behavior of your forms–without writing code or using an integrated development environment (IDE)–using the widgets that display in Data Explorer in Author Mode. In Data Explorer in Author Mode, you can create and update your tables, edit Data Explorer settings, and edit the layout of Data Explorer. In Data Explorer in user mode, you can view and edit your data and verify your entity REST endpoints.
For more information about using Data Explorer in user mode, see Data Explorer.
When you create your API in API Creator using the 
App-First
 approach to creating APIs, Data Explorer starts in a new browser window in Author Mode. When you start Data Explorer from this API in API Creator, Data Explorer starts in Author Mode. If you start Data Explorer from an API in API Creator that was created using the 
Database-First
 approach to creating APIs, Data Explorer starts in user mode.
In this article:
 
 
The following image illustrates Data Explorer in Author Mode and shows the widgets (in red boxes):
CA Technologies 
Verify the Prerequisites
Before accessing Data Explorer in Author Mode, verify the following prerequisites:
  • You have been added as a TeamSpace user using the same credentials used to access 
    CA Live API Creator
    .
  • You are an authorized user of Data Explorer in Author Mode.
  • You are not accessing Data Explorer in Author Mode using an application account, such as the Demo API.
Access Data Explorer in Author Mode
You can toggle between Author Mode and user mode using the 
Author Mode
 control at the top right of Data Explorer. The following image shows this control:
 Screen Shot 2017-12-01 at 2.50.56 PM.png 
  1. In Data Explorer (in user mode), toggle to 
    Author Mode On
    .
     
     
    The CA Live API Creator Author Login window appears.
  2. Log in to Data Explorer in Author Mode. Use the your API Creator administrator user name and password.
  3. Enter your credentials and click 
    Log in as author
    .
You are logged in to Data Explorer in Author Mode.
You can also toggle between Author Mode and user mode using keyboard commands. (Windows) Press the 
Alt + A
 keys on your keyboard. (Mac/UNIX) Press the 
Option + A
 keys on your keyboard.
Change Database Field Type Output Format
You can change how fields are displayed in the Form.
You can also update and delete fields and relationships.
Deleting a lookup field deletes the relationship. A lookup field is the relationship a child table has to a parent table.
For more information about lookup fields, see Manage Tables in Managed Databases.
  1. In Data Explorer (in Author Mode), select the entity (table or view) that contains the field that you want to change from the 
    Entities 
    drop-down. The following image shows this drop-down in Data Explorer:
    Screen Shot 2017-12-14 at 10.00.59 AM.png 
  2. In the Form, click the field settings icon to the left of the name of the field name you want to change.
    The options for the Form opens.
    The Field Details window appears. The following image shows the field settings icon and the Field Details window:
    CA Technologies 
  3. On the Field Display tab, change how the field is displayed and then save your changes.
The database field type output format is changed.
Control the Fields That Are Displayed in the Form
You can control which fields are displayed in the Form. You can display fields from the selected entity (table or view) or from a parent entity you want to join.
  1. In Data Explorer (in Author Mode), click the entity settings icon in the Form.
    The following image shows this icon:
    Screen Shot 2017-03-09 at 2.59.56 PM.png
    The Options window for the Form opens.
  2. On the Field Display tab, complete the following, and then click 
    Close
    :
    • Define which fields you want to display in the Form.
    • To join in parent tables, click the table name and select the fields from the parent entity you want to join. The following image shows as example of the fields that you can select to join in the parent entity:
      CA Technologies 
The fields are displayed in the Form.
Control When Fields Display in the Form
Change the general appearance of the colors, icons, and labels in Data Explorer using Cascading Style Sheets (CSS) skins. You can control when the fields display in the Form by defining expressions. You can also combine expressions, such as hiding a field for a specified condition or turning it red otherwise. You do this by defining multiple expressions. Data Explorer evaluates each expression individually. The right-most expressions overwrite the expression styles preceding.
You can use the following variables in evaluation expressions:
  •  
    row
    . A reference to the values of this row.
  •  
    action
    . The current logicContext verb for this row (INSERT, DELETE, UPDATE, null).
  •  
    parents
    . A reference to parent roles and their row values.
  •  
    hasRole("roleName")
    . Checks if a parent role exists.
The following procedure illustrates how to control how the Region field is displayed for Supplier:
  • Hides the Region field if you enter UK as the Country for the row.
  • Displays the color of the Region field in red if you enter New Orleans as the City for the row.
  • Otherwise, displays the color or the Region field in blue.
The Region field is visible/hidden as you step between rows or change rows. The field is visible as you enter data. In this example, if you insert a new row, the Region field is hidden if you enter the Country as UK.
Follow these steps:
 
  1. In Data Explorer (in Author Mode), in the Form, click the field settings icon to the left of the name of the field you want to define the client-side expression.
    The Field Details window appears. The following image shows the field settings icon and the Field Details window:
    CA Technologies
    The following image shows a second expression for the Region field in the Field Details window:
    CA Technologies 
  2. In the Expressions section, click the 
    +
    .
  3. The fields in the Expressions section appear.
  4. Complete the following fields:
    Evaluation
     
    The expression syntax. Specify expressions instead of using fixed length strings.
    Examples:
     
    row.employee_type.match("exempt")
    row.credit_balance > 2000
    Where 
    credit_balance
     is a field name in this entity. Expressions are evaluated as JavaScript. When passing text into exposed methods, wrap the value in quotes, for example:
    hasRole("plainTextValue")
    CSS Selector
     
    The settings leverage CSS syntax. For example, input applies styles to the current input. You can apply the expression style to all inputs on the page, precede the selector with a "/", for example, 
    /input
    . For the Form, the most common selectors for the field label text, the field input, and the element containing them are "label", "input", and ".column-container" respectively. For the Main Grid, you can use the "cell" selector.
    onTrue Styles
     
    Examples:
     
    • display:none;
      Hides the selected elements.
    • color:red
      Changes the font-color to the color red.
    • background:white;
      Changes the background color to the color white.
  5. Click 
    Save
    .
The field expression is added.
Change the Title of the Form
By default, Data Explorer defaults the title the Form to the primary key field. For those tables that do not have a primary key, Data Explorer defaults the title to the first field. You can change the title for the Form. For example, you can choose to display the title as first + last name.
Follow these steps:
 
  1. In Data Explorer (in Author Mode), click the entity settings icon in the Form.
    The Options window for the Form opens.
  2. Click the 
    Form Window
     tab.
  3. In the 
    Form Title
     field, enter the title that you want for the Form in JavaScript syntax, and then click 
    Close
    .
    Example: 
     
    table.name + ' -> ' + row.credit_amount
    , where 
    credit_amount
     is a field in this entity and  refers to the  request object. Data Explorer evaluates expressions as JavaScript. When passing text into exposed methods, wrap the value in quotes using the following syntax: 
    "Expressed String -> " + row.credit_amount
    The following parameters are exposed:
    •  
      row
       : a reference to the values of this row
    •  
      table
       : the API Creator 
      @tables
       request object.
    The following image shows an example of the syntax to enter in the form title as first + last name:
     Screen Shot 2017-12-01 at 3.30.50 PM.png 
The title of the Form is changed.
Provide Form Information
To enhance user experience and to help users explore 
CA Live API Creator
, you can provide explanatory text in the Info section of the Form in Data Explorer. The following image shows an example of the explanatory text for the Business to Business (B2B) sample:
 Screen Shot 2017-01-04 at 6.53.08 PM.png 
Follow these steps:
 
  1. In Data Explorer (in Author Mode), click the entity settings icon in the Form.
    The Options window for the Form opens.
  2. Click the 
    Entities
     tab.
  3. In the 
    Description
     field, enter the explanatory text you want to display in the Info section of the Form, and then click 
    Close
    .
    The following image shows how to enter the explanatory text on the Entities tab:
    Screen Shot 2017-12-01 at 3.42.24 PM.png 
The explanatory text displays in the Info section of the Form.
Control the Order of the Fields Displayed in the Form
You can choose which fields to display, in which order to display them in the Form, and add groupings of fields.
  1. In Data Explorer (in Author Mode), click the entity settings icon in the Form.
    The Options window for the Form opens.
  2. Click the 
    Field Order
     tab.
    The following image shows the window that opens:
    groups_011317.png 
  3. Group the form fields and then click 
    Close
    .
The Form fields are grouped.
Set the Placement of Field Label Placement in the Form
You can select the field label placement in the form. By default, field label placement is set to display to the 
left
 of the field.
For tables with long field names, set the label placement to 
top
 of the field.
Add Data to a Binary Type Field in the Form
Prerequisites:
 
  • An entity is selected in the Main Grid.
  • The binary field exists in the entity.
  • (To show an image) The API setting 
    Permit Authorization parameter in URL
     is selected.
Follow these steps:
 
  1. In Data Explorer (in
     
    Author Mode), click the ellipses icon that displays next to the field to which you want to add data, and then choose 
    Upload file
    .
  2. Browse for the file, select and upload it, and then close the window.
    The file is uploaded.
  3. To show the uploaded file as an image or sound, click the ellipses icon that displays next to the field to which you have added an image, and then choose 
    Show as image
     or 
    Show as sound
    .
    The image or sound displays.
The data is added to the binary type field.
Manage your Tables using Data Explorer
With Data Explorer in Author Mode, you can manage the content in a data source for a managed database. You can manage your tables using Data Explorer in the following ways:
  • (If your API is connected to a managed data server) Create tables and relationships and add fields.
    Fields represent the columns in your database. The term 
    field
     is used to stay within the metaphor of applications and screens, and not database terminology.
    For more information about how to create a new schema and manage the content in a data source for a managed database using Data Explorer, see Manage Tables in Managed Databases
  • Update a table name in your data source.
  • Delete a table in your data source.
You can also manage your tables using API Creator or by way of managed data REST endpoint requests.
For more information:
Prerequisite: 
(If the table is part of an existing schema) Your schema is marked as editable. For more information about how to mark your schema as editable, see Manage Existing Schemas.
Follow these steps:
 
  1. In Data Explorer (in Author Mode), select the table that you want to edit or delete from the 
    Entities 
    drop-down.
    The Main Grid refreshes.
  2. Click the entity settings icon in the Form.
    The Options window for the Form opens.
  3. On the Field Display tab, do one of the following:
    • Click 
      Delete Table
       to delete the table in your data source.
    • Click 
      Edit Table
       to change the table name in your data source.
Change Database Field Type Output Format
You can change how fields are displayed, such as setting a binary field type as a hexadecimal value or a text type to a WYSIWYG editor. You can also update and delete fields and relationships.
  1. In Data Explorer (in Author Mode), select the entity containing the field that you want to change from the 
    Entities 
    drop-down.
  2. In the Form, click the field settings icon to the left of the name of the field name you want to change.
    The options for the Form opens.
    The Field Details window appears. The following image shows the field settings icon and the Field Details window:
    CA Technologies 
  3. On the Field Display tab, change how the field is displayed and then save your changes.
The database field type output format is changed.
Control the Child Grid
You can rearrange the Child Grid using drag-n-drop, change the display name for the labels, and select the tabs to display.
In Data Explorer (in Author Mode), click the child tab settings icon in the Child Grid. The Options window opens. The following image shows this icon and the window that opens:
CA Technologies 
If there are more than five active children, you can show more items by clicking the down arrow on the last tab.
Set the Default Entity and Layout Arrangement
  1. In Data Explorer (in Author Mode), click 
    Tools
    App Settings
    .
    The General tab of the Application Settings window appears by default.
  2. Complete the following fields on this tab, and then save your changes:
    Default Entity
     
    Defines the default starting entity (table or view) when you start Data Explorer.
    Maximum Form Columns
     
    Defines the maximum number of columns that display in the Form. By default, the value is blank and up to six columns can display in the Form.
    Range:
     1-6
    Open Panels for Selected Entity
     
    Defines the default layout arrangement for the selected entity.
    Options:
     Main Grid, Form Window, and Child Grid
    Default:
     All components are selected.
The default entity (table or view) and layout arrangement is set.
Define the Look and Feel of Data Explorer
You can change the look and feel of Data Explorer by uploading a new set of CSS values. The attached 
dataexplorererskin.css
 sample skin is included. You can create a new skin and upload the new CSS file.
You define the look and feel of Data Explorer on the Application Settings, Skins tab. To view this tab, in Data Explorer (in Author Mode), go to Tools, App Settings, Skins tab. The following image shows this tab:
CA Technologies 
Refresh Data Explorer to see the new skin take effect.
Toggle Between Entities
You can toggle between entities by selecting the entity that you want to toggle between from the 
Entities
 drop-down.
Add Links to Entities
You can add links to entities in data sources that you have defined in your API. You can also define what Data Explorer components display the information, such as hiding the Child Grid or the Form area. For example, you might want to show only sales from the 
sales_rep
 table in the Form area instead of in the Child Grid, which is the default layout.
The links that you add are added to a menu on the navigation bar.
  1. In Data Explorer (in Author Mode), click 
    Tools
    App Settings
    .
    The Application Settings window opens.
  2. Click the 
    Linking
     tab.
  3. Complete the following fields and then click 
    Add Link
    :
    Add New Link
     
    The name for the link.
    Active Table
     
    The table that you want to display.
    Open Panels
     
    Defines the panes you want to display for this link.
    Options:
     Main Grid, Form, and Child Grid.
    The following image shows the Linking tab and the menu that displays on the toolbar associated to the link you are adding:
    CA Technologies 
The link is added and the table layout is defined for this link.
Return Tables to their Default State
  1. In Data Explorer (in Author Mode), click 
    Tools
    App Settings
    .
    The Application Settings window opens.
  2. Select the 
    By Table
     tab.
  3. Select a table from the 
    Delete All Table Settings
     drop-down, and then click 
    Delete Settings
    .
    If you have not saved settings for the table, the "No settings object found" message appears.
The tables are returned to their Default State.