Studio Manager JSPAPI User Guide (2)

85
JSP API Guide: Studio Manager 5 Date 21-November-2012 Document Version 1.0 Product Version V11.7

Transcript of Studio Manager JSPAPI User Guide (2)

JSP API Guide:Studio Manager 5

Date 21-November-2012

Document Version 1.0

Product Version V11.7

Document History

Version

Date Author Summary

1.0 21-Nov-2012

Bob Pitt Initial document creation

Table of Contents

JSP API GUIDE:..............................................................1DOCUMENT HISTORY............................................................2TABLE OF CONTENTS...........................................................3OVERVIEW....................................................................4SETUP.......................................................................4API REFERENCE...............................................................5COMMON CONSTANTS AND METHODS................................................5WIDGETAPI..................................................................10TOOLBARAPI.................................................................13ENTITYLISTAPI..............................................................21JOURNALAPI.................................................................30TABBEDWIDGETAPI............................................................33HTMLAPI....................................................................34HTMLTEMPLATEAPI............................................................35QUERYBUILDERAPI............................................................41APPENDIX A: REFERENCE CHAINS..............................................43APPENDIX B: TOOLBAR CONTROLS..............................................44APPENDIX C: LABELS AND ICONS..............................................49APPENDIX D: HTML TEMPLATES................................................51APPENDIX E: SAMPLE WIDGET – MY CANDIDATES.................................58APPENDIX F: SAMPLE WIDGET – JOB ORDER QUEUE...............................62Appendix G: Sample Widget – My Projects...................................65

Overview

There are two methods for creating widgets: XML and JSP. This document will focus on creating JSP widgets. The JSP API classesallow java programmers to create widgets of many types from simple to complex with a minimal amount of coding. In addition, they have the flexibility to manipulate data and its appearance, as well as build in custom queries and conditions.

There are currently eight APIs:

WidgetAPI: This provides an interface to change widget properties and behaviour.

ToolbarAPI: This provides the means to create a widget toolbar to run workflow and filter the data.

EntityListAPI: This builds the most common widget type, which is a managed list of entities.

JournalAPI: This allows the developer to display an entity or user’s journal.

TabbedWidgetAPI: This provides the means to create a singlepane that houses multiple widgets using a tabbed interface.

HtmlAPI: This provides the ability to display any HTML in awidget.

HtmlTemplateAPI: This API provides the means to create an html-based widget by merging Adapt data into an html template.

QueryBuilderAPI: This provides the ability to run custom queries.

SetupThe general studios, widgets and label using XML setup is required.

Note For more information on Studio Manager setup, refer tothe Engine Documentation\ Common Adapt Configuration\

Studio Manager\ StudioManager_Setup_UserGuide.

This do will focus on the setup of JSP-specific widgets. There are two location types: Base and Custom. Base widgets are delivered as part of a base system. Custom widgets are created for specific clients. The JSP files must be located within the /WebApp structure in order to execute.

Here are the required locations for the two widget types:

Base: /WebApp/template/asm_base

Custom: /WebApp/template/view_templates/<domain name>/asm_custom

Within each folder is the following file/folder structure:

In the root: The main JSP files images: contains the images specific to the widgets js: contains the javascript files. *NOTE: The following js

files must be used, as they are loaded via the studio manager framework and automatically included in each generated widget:

o For asm_base: base.jso For asm_custom: custom.js.

templates: contains the xls templates for Excel exports.

Other folders can also be created and referenced as needed by theJSP files.

API Reference

Common Constants and Methods

The following constants and methods are available in all APIs:

Constants:

PAST_N_DAYS: Duration type for getDateRange(): Get the range from <n> days ago through today.

NEXT_N_DAYS: Duration type for getDateRange(): Get the range from today to <n> days from today.

THIS_WEEK: Duration type for getDateRange(): Get the current week from Sunday to Saturday.

THIS_MONTH: Duration type for getDateRange(): Get the current month.

THIS_YEAR: Duration type for getDateRange(): Get the current year.

DF_DATE: Return format for getDateRange(): Return a 2-element array of Strings representing short dates (exact format depends on the user's locale).

DF_TIME: Return format for getDateRange(): Return a 2-element array of Strings representing short times (exact format depends on the user's locale).

DF_DATETIME: Return format for getDateRange(): Return a 2-element array of Strings representing short date and time (exact format depends on the user's locale).

SETTINGS_LEVEL_DOMAIN: Custom settings will be at domain level.

SETTINGS_LEVEL_PROFILE: Custom settings will be at profile level.

SETTINGS_LEVEL_USER: Custom settings will be at user level.

Methods:

public QueryBuilderAPI getQueryBuilder() throws Exceptiono Creates an instance of a QueryBuilderAPI object with

a connection to the domain.o Parameters: none.

public UserI me()o Returns the current user’s UserI object.o Parameters: none.

public long myID()o Returns the current user’s ID.o Parameters: none.

public DomainI myDomain()o Returns the DomainI object for the current user’s

domain.o Parameters: none.

public Locale myLocale()o Returns the current user’s locale.o Parameters: none.

public TimeZone myTimeZone()o Returns the current user’s time zone, as set in

Adapt.o Parameters: none.

public int myTimeZoneOffset()o Returns the current user’s time zone offset, in

hours, relative to UTC.o Parameters: none.

public long getUserID(String loginName) throws Exception

o Returns the ID of the user with the specified login name.

o Parameters: loginName: The login name of the user whose ID

is to be retrieved.

public String getUserName(String loginName) throws Exception

o Returns the name of the user with the specified login name.

o Parameters: loginName: The login name of the user whose

name is to be retrieved.

public String getUserInitials(String loginName) throws Exception

o Returns the initials of the user with the specified login name.

o Parameters: loginName: The login name of the user whose

initials are to be retrieved.

public String today([boolean fLocal])o Get the date string for the current date and time.

The format is determined by the user's locale.o Parameters:

fLocal (optional): When set to true, the user's local date is returned. If set to false or notprovided, the server (UTC) date is returned.

public String now([boolean fLocal])

o Get the date/time string for the current date and time. The format is determined by the user's locale.

o Parameters: fLocal (optional): When set to true, the user's

local time is returned. If set to false or notprovided, the server (UTC) date is returned.

public String[] getDateRange(int durationtype, int format) throws Exception

o This version of the method gets the date range for the current week, month or year as a 2-element arrayof String objects. Please note that the dates are automatically adjusted based on the user's time zoneoffset.

o Parameters: durationtype: This indicates the duration of the

date range. Possible values are: THIS_WEEK THIS_MONTH THIS_YEAR

format: This indicates the format of the return value. Possible values are:

DF_DATE DF_TIME DF_DATETIME

public String[] getDateRange(int durationtype, int format, int duration) throws Exception

o This version of the method gets the date range for the previous or next number of days from today. Please note that the dates are automatically adjusted based on the user's time zone offset.

o Parameters: durationtype: Set this to the duration of the

date range. Possible values are:

PAST_N_DAYS NEXT_N_DAYS

format: This indicates the format of the return value. Possible values are:

DF_DATE DF_TIME DF_DATETIME

duration: Indicates the number of days prior to or from today.

public long getConfigurationID(String configName, char configType) throws Exception

o Get the configuration ID of an Adapt configuration artefact.o Parameters:

configName: The configuration name of the artefact (use full path for codes and document categories, ie "Skills/Java").

configType: The type of configuration. Possible values are:

CTYPE_VIEW CTYPE_BO CTYPE_MENU CTYPE_CODE CTYPE_ROLE CTYPE_PROPERTY CTYPE_ATTRIBUTE CTYPE_NOCC CTYPE_DOCCAT CTYPE_STUDIO CTYPE_WIDGET

public String getLabel(String key [, char workflowType]) throws Exception

o Get the label of an Adapt configuration or studio artefact.

o Parameters: key: The is the configuration name of the item

whose label you want to retrieve. The type is automatically determined by the format if the workflowType parameter is not provided. Please see Appendix C: Labels and Icons for details.

workflowType (optional): The workflow type. Possible values are:

CTYPE_STUDIO (meaning a custom label, not a studio name)

CTYPE_WIDGET CTYPE_VIEW CTYPE_BO CTYPE_MENU CTYPE_JAVASCRIPT CTYPE_STUDIO CTYPE_WIDGET CTYPE_CODE CTYPE_ATTRIBUTE CTYPE_DOCCAT CTYPE_NOCC

public String getStudioSetting(String key) throws Exception

o Get a studio setting. Note: The value will alwaysbe returned as a String, so it's up to the developerto convert it to the desired type.

o Parameters: key: The setting’s key identifier

public void setCustomSettingsLevel(int level) throws Exception

o Set the custom settings level, which dictates the scope of the settings.

o Parameters:

level: The level of the settings. This can be one of the following:

SETTINGS_LEVEL_DOMAIN (default) SETTINGS_LEVEL_PROFILE SETTINGS_LEVEL_USER

public void addCustomSetting(String key, String value) throws Exception

public void addCustomSetting(String key, int value) throws Exception

public void addCustomSetting(String key, long value) throws Exception

public void addCustomSetting(String key, boolean value) throws Exception

o Add a custom studio setting. This setting can laterbe retrieved using the getStudioSetting() method. The scope of the setting is determined by the level set using the setCustomSettingsLevel() method.

o Parameters: key: The setting’s key identifier value: The setting’s value. This can be a

String, int, long or boolean value.

private void setCustomSettingValue(String key, Object value) throws Exception

o Sets a custom setting’s value. Both the cache and the database are updated.

o Parameters: key: The setting’s key identifier. value: The setting’s value. This object can be

a String, Integer, Long or Boolean object.

WidgetAPI

This class provides an interface to access some of the common underlying widget properties and methods, regardless of the widget type.

Constants:There are no constants exclusive to WidgetAPI.

Methods:

public WidgetAPI(HttpServletRequest request, HttpServletResponse response) throws StudioAPIException

o Standard constructor. This method is typically not used. The underlying WidgetAPI object should be obtained from each specific API using its getWidget() method.

o Parameters: request: The HttpServletRequest object

available in the JSP environment. response: The HttpServletResponse object

available in the JSP environment.

public void handleError(StudioAPIException e) throws StudioAPIException

o This method triggers the exception handle within theunderlying widget, which then eventually renders an error widget. This method is only required to trigger custom exceptions. The API classes utilizedthis method implicitly.

o Parameters: e: The StudioAPIException object.

public long dataOwnerID()

o Returns the ID of the widget's data owner, which is primarily used when viewing shared studios when the user viewing the widget is not the owner of the widget’s data.

o Parameters: none.

public String widgetTagID()o Returns the widget’s tag id. This is the html tag

that contains the widget and is the parent node for the widget controls and contents.

o Parameters: none.

public long widgetID()o Return the widget’s ID. This is its unique

identifier as stored in the database.o Parameters: none.

public long studioID()o Returns the ID of the studio where this widget is

currently loaded.o Parameters: none.

public String path()o Returns the widget’s path as a relative URL. *NOTE

that this does NOT include the filename.o Parameters: none.

public long contextID()o Returns the context ID, which is the ID of the

entity this widget is associated with, if any.o Parameters: none.

public String getParameter(String key)o Returns a widget parameter value as a String object.o Parameters:

key: The parameter key.

public long getParameterAsLong(String key)

o Returns a widget parameter value as a long value.o Parameters:

key: The parameter key.

public String getParameterAsDate(String key)o Returns a widget parameter value as a date-formatted

String object. The date string is return in SHORT format, ie 6-5-2012, formatted in accordance with the user’s current locale.

o Parameters: key: The parameter key.

public void setMultiSelectProcessor(String multiSelectProcessor)

o Set the javascript function to use for multi-select operations.

o Parameters: multiSelectProcessor: The javascript function to

call when a workflow is run against multiple selections. This function must exist in base.js or custom.js.

Adding these parameter constants to your function declaration will allow it to receive any necessary parameters:

_CONTEXTID_: This will receive the context ID (the associated entity) of the widget.

_WIDGETTAGID_: This will receive the widget's tag ID, which is it's parent <div> element's ID.

_SELECTIONS_: This will receive an array of long values which represent the entity IDs of the selected items.

ToolbarAPI

The toolbar API allows you to create a toolbar for your widget that can run workflow and apply filters to the data within the widget’s primary data component. The following components are currently available:

Spacer Label Buttons:

o Javascripto Hyperlinko Adapt workflow:

View BO Menu Query

o Adapt Documento Widgeto Widget refresh

Check box Radio button group Custom Menu Select Control (single or multiple-selection) Date Field Text Field Search Field Custom control (html)

Please see Appendix B: Toolbar Controls for examples.

Constants:

ALIGN_LEFT: Aligns components to the left. ALIGN_RIGHT: Aligns components to the right. ICON_NONE: Prevents a button from loading a default

icon, causing it to be a text button.

Methods:

public ToolbarAPI(HttpServletRequest request, HttpServletResponse response) throws StudioAPIException

o This is the standard constructor. However, it typically isn’t used, as the ToolbarAPI object is typically retrieved from the primary API, such as EntityListAPI.

o Parameters: request: The current HttpServletRequest object. response: The current HttpServletResponse

object.

public void setAlign(byte align)o Set the current toolbar alignment. All subsequently

added controls will use this alignment until it is set again.

o Parameters: align: Possible values are:

ALIGN_LEFT (default) ALIGN_RIGHT

public void setRow(int row)o Set the current row. All subsequently added

controls will display on this row until it is set again.

o Parameters: row: The row number. Prior to this method

call, the row number will be 1.

public void addSpacer([int size]) throws StudioAPIException

o Adds a spacer of the specified sizeo Parameters:

size (optional): The size/width of the spacer in pixels. Default is 10px.

public void addLabel(String label) throws StudioAPIException

o Adds a simple label onto the toolbar.o Parameters:

label: The text. Please see Appendix C: Labels and Icons for label formatting details.

public void addCheckbox(String key, String operator, String value) throws StudioAPIException

o Adds a check box to the toolbar.o Parameters:

key: The identifier of the check box control. This is typically a PROPERTY.ATTRIBUTE pair, which will allow the widget to automatically filter on its value. Also, when a PROPERTY.ATTRIBUTE pair is specified, the labelis automatically retrieved.

operator: The operator used to compare the value. Possible values are standard SQL comparison operators, such as:

= > < <= >= <> IN NOT IN LIKE

value: The value to compare to the current check box's value to determine a TRUE value.

public void addJavascriptButton(String jsFunctionDecl, String icon, String caption) throws StudioAPIException

o Add a button that calls a javascript functiono Parameters:

jsFunctionDecl: The javascript function declaration

icon: The button's icon. This should be a relative path to an image or ICON_NONE for textbuttons.

caption: The button caption (hover text for textbuttons). Please see Appendix C: Labels and Icons for label formatting details.

public void addHyperlinkButton(String url, String icon, String caption) throws StudioAPIException

o Add a button that launches a hyperlink. url: The url to launch icon: The button's icon. This should be a

relative path to an image or ICON_NONE for textbuttons.

caption: The button caption (hover text for textbuttons). Please see Appendix C: Labels and Icons for label formatting details.

public void addRefreshButton() throws StudioAPIExceptiono Add a button that refreshes the widget (uses a

default icon and caption)

public void addRefreshButton(String icon, String caption)throws StudioAPIException

o Add a button that refreshes the widget and provide acustom icon and caption

o Parameters: icon: The button's icon. This should be a

relative path to an image or ICON_NONE for textbuttons.

caption: The button caption (hover text for text buttons). Please see Appendix C: Labels and Icons for label formatting details.

public void addWorkflowButton(String configName, char workflowType [, String icon][, String caption]) throws StudioAPIException

o Add a button that launches an Adapt workflow. If not supplied, the icon and/or caption are automatically retrieved from the workflow configuration.

o Parameters: configName: The Adapt workflow configuration

name workflowType: The adapt workflow type. Possible

values are: CTYPE_BO CTYPE_VIEW CTYPE_QUERY CTYPE_DOCUMENT

icon (optional): The button's icon. This should be a relative path to an image or ICON_NONE fortext buttons. Or, if workflowType is CTYPE_DOCUMENT, then you can wrap the document extension in $ to display that document type’s icon, ie $XLSX$ or $DOCX$.

caption (optional): The button caption (hover text for text buttons). Please see Appendix C: Labels and Icons for label formatting details.

public void addRadioButton(String key, String operator, String value [, String caption]) throws StudioAPIException

o Add a radio button to a radio group (a new radio group is automatically created if it doesn't exist).

The caption is automatically retrieved, assuming thekey is an Adapt PROPERTY.ATTRIBUTE pair.

o Parameters: key: The identifier of the radio group. Each

time this method is called, a new radio button will be added to this group. This is typicallya PROPERTY.ATTRIBUTE pair, which will allow thewidget to automatically filter on its value. Also, when a PROPERTY.ATTRIBUTE pair is specified, the label is automatically retrieved.

operator: The operator used to compare the value. Possible values are standard SQL comparison operators, such as:

= > < <= >= <> IN NOT IN LIKE

value: The value to compare to the current value to in order to determine which radio button is selected.

caption (optional): The radio button. Please see Appendix C: Labels and Icons for label formatting details.

public void addSelect(String key [, boolean fMulti][, String caption][, boolean fDataRequired]) throws StudioAPIException

o Add a single-selection SELECT controlo Parameters:

key: The SELECT control identifier.

fMulti (optional): Default value is false. Set to true to create a multi-select control. Set to false for a standard single select control.

caption (optional): The select control’s caption. This is only displayed in multi-select controls. Please see Appendix C: Labels and Icons for label formatting details

fDataRequired (optional): Default value is false. Determines whether or not a blank values yield entity results. If set to true, no results are displayed if the value is blank. Otherwise, itacts like a standard filter.

public void addSelectItem(String key, String value, String caption) throws StudioAPIException

o Add an option item to a SELECT control (a new single-selection select control is automatically created if it doesn't exist).

o Parameters: key: The SELECT control identifier. This

should correspond to an existing SELECT control. If it doesn’t, a new single-select control is created.

value: The value of this SELECT option item caption: The display value of this SELECT

option item. Please see Appendix C: Labels and Icons for label formatting details.

public void addAdaptMenu(String configName [, String icon][, String caption]) throws StudioAPIException

o Add a button that displays an Adapt menu.o Parameters:

configName: The Adapt menu configuration name. icon (optional): The button's icon. This should be

a relative path to an image or ICON_NONE for text buttons.

caption (optional): The button's hover text, or the caption if ICON_NONE is specified as the icon. Please see Appendix C: Labels and Icons for label formatting details

public void addCustomMenu(String key, String icon, Stringcaption) throws StudioAPIException

o Add a custom drop down menu. Items are added using the addCustomMenuItem() method.

o Parameters: key: A key identifier for this menu icon: The button icon caption: The button caption (hover text unless

ICON_NONE is specified as the icon). Please see Appendix C: Labels and Icons for label formatting details.

public void addCustomMenuItem(String key, char runType , String workflow [, String icon][, String caption]) throwsStudioAPIException

o Add a menu item to an existing custom drop down menuo Parameters:

key: The identifier of the custom menu to add this item to

runType: The type of workflow. Possible valuesare:<br>

CTYPE_JAVASCRIPT CTYPE_URL CTYPE_BO CTYPE_VIEW CTYPE_QUERY

workflow: The workflow to run, ie a BO, View, javascript, etc

icon (optional): The menu button icon. If not provided, the workflow’s icon will be displayed, if available.

caption(optional): The menu button caption. If not provided, the worfklow’s label will be displayed, if available. Please see Appendix C: Labels and Icons for label formatting details

public void addDateField(String key) throws StudioAPIException

o Add a date field with a navigation bar and a calendar button.

o Parameters: key: The date field’s identifier.

public void addTextField(String key [,int width]) throws StudioAPIException

o Adds a generic text field. The value is stored as awidget parameter with its key identifier.

o Parameters: key: The text field’s key identifier. width (optional): The text field’s width in pixels

(default is 100px).

public void addSearchField(String key [, int width][, boolean fDataRequired]) throws StudioAPIException

o Add a free text search field. This field can searchdocuments (see addSearchFieldCategory()) and/or attribute (see addSearchFieldAttribute()). * Pleasenote that searching both documents and attributes with one field has performance implications.

o Parameters: key: The search field’s key identifier. width (optional): The search field’s width in

pixels (default is 100px).

fDataRequired (optional): Determines whether or not a blank values yields search results, essentially the difference between acting like a true search field or acting like a filter:

true: An empty field causes the query notto run at all, yielding 0 results.

false: An empty field causes the free text condition to be eliminated from the query, thus not affecting the results.

public void addSearchCategory(String key, String docCategoryPath [, int target]) throws StudioAPIException

o Adds a document class to a search field.o Parameters:

key: The key identifier. This must match an existing search field.

docCategoryPath: The configuration path of the document category, ie “Resume/Original Resume”.

target (optional): The document within the category to search. Possible values are:

TARGET_NONE: All documents in the category are searched. This is the default.

TARGET_DOC_DEFAULT: Only the default document is searched.

public void addSearchAttribute(String key, String propertyAttribute [, String referenceChain])

o Adds an attribute to a search field.o Parameters:

key: The key identifier. This must match an existing search field.

propertyAttribute: An attribute in the format PROPERTY.ATTRIBUTE.

referenceChain (optional): This is only required forcross-reference attributes. Please see

Appendix A: Reference Chains for more information about formatting this parameter.

public void addHTMLControl(String html) throws StudioAPIException

o Add a block of html to create a custom control or label.

o Parameters: html: The block of html that renders the

control or label.

public void disableRefresh(String key) throws StudioAPIException

o Disable the automatic widget refresh for a specifiedcomponent's when its value is changed. This method is useful when multiple components must contain datain order to trigger a new query. For example, a location search would require both proximity and post code fields to be filled in before rerunning the query.

The following component types utilize this feature:

Check boxes Radio buttons Select controls (single and multiple) Date fields Text fields Search fields

o Parameters: key: The widget parameter key. This key must

correspond with an existing toolbar component.

EntityListAPI

The EntityListAPI class is a widget data type object that provides the means for building a list of entities.

Constants:

SELECTION_TYPE_NONE: Disables row selection. SELECTION_TYPE_SINGLE: Allows a single row to be

selected at a time (radio buttons). SELECTION_TYPE_MULTI: Allows multiple row selections

(check boxes). TOOLBAR_POSITION_TOP: Positions the toolbar over the

list. TOOLBAR_POSITION_BOTTOM: Positions the toolbar below the

list. COLUMN_PRIMARY: Used by some methods to indicate the

primary context ID of a row rather than an individual column.

Methods:

public EntityListAPI(HttpServletRequest request, HttpServletResponse response) throws StudioAPIException

o Standard Constructoro Parameters:

request: The HttpServletRequest object available in the JSP environment.

response: The HttpServletResponse object available in the JSP environment.

public WidgetAPI getWidget()o Retrieves the underlying WidgetAPI objecto Parameters: none.

public ToolbarAPI getToolbar()

o Retrieves the underlying ToolbarAPI objecto Parameters: none.

public void removeToolbar() throws StudioAPIExceptiono Removes the toolbar from the widget. If this method

is not called and no items are added to the toolbar,a blank toolbar will still appear.

o Parameters: none.

public void setToolbarPosition(byte position) throws StudioAPIException

o Position the toolbar above or below the list. By default, the toolbar is above the list.

o Parameters: position: Can be one of the following constants:

TOOLBAR_POSITION_TOP TOOLBAR_POSITION_BOTTOM

public void setSelectionType(byte selectionType)o Set the list’s selection type.o Parameters:

selectionType: Can be one of the following: SELECTION_TYPE_NONE SELECTION_TYPE_SINGLE SELECTION_TYPE_MULTI

public void setPrimaryReference(String primaryReference)o Set the primary property/attribute pair for the

query builder, ie CAND_GEN.REFERENCE.o Parameters:

primaryReference: An adapt attribute in the format PROPERTY.ATTRIBUTE.

public void addColumn(String key, String width [, String referenceChain]) throws StudioAPIException

o Add a column to the list.o Parameters:

key: Typically an Adapt PROPERTY.ATTRIBUTE pair, although a non-Adapt column name may be added. If this is the case, no data will be retrieved for this column, but it will be available to add data to after the query (see getData() and setData()).

If an alias is required, add it prior to the PROPERTY a separate with a $, ie CANDIDATE$PERSON_GEN.FULLNAME. This may be necessary when accessing the same PROPERTY.ATTRIBUTE for more than 1 column, for example: CANDIDATE$PERSON_GEN.FULLNAME and CONTACT$PERSON_GEN.FULLNAME.

width: The column width percentage (include the% sign, ie "25%"). You can also specify the width in pixels, ie 150px. When using percentages, it is up to the developer not to exceed 100%.

referenceChain (optional): This parameter is neededfor columns that are not in the primary property. For more information, please see Appendix A: Reference Chains.

public void addCreatedDateColumn(String key, String width, String referenceAttribute) throws StudioAPIException

o Add a column that displays an entity's created dateo Parameters:

key: An alias for this column. Do NOT use the PROPERTY.ATTRIBUTE notation.

width: The width of the column. referenceAttribute: A PROPERTY.ATTRIBUTE pair that

provides the reference to the entity whose

created date this represents. Please note thatthis is not a full reference chain. ENTITY_TABLE.CREATEDDATE will automatically be added to form the full reference chain.

public String getCreatedDate(String key)o Get the created date column name given the column

key. This method can be used in condition queries to access the created date of entities referenced inthe columns.

o Parameters: key: The key of the column whose created date

you want to reference. String: The formatted name of the created date

column.

public void addScoreColumn(String key, String width) throws StudioAPIException

o Add a score column (must be associated with a searchfield control).

o Parameters: key: An alias for the column. This must match

the name of a search field control. width: The width of the column.

public void linkProperty(String property, String viaAttribute) throws StudioAPIException

o Link in a property table. This is necessary when another table is used to link Adapt properties. Forexample, in order to display the client for a job listing, you would link in the X_JOB_CLIENT propertyvia JOB. Then you could use REFERENCE:X_JOB_CLIENT.CLIENT when adding the clientcolumn.

o Parameters: property: The configuration name of the Adapt

property. viaAttribute: The primary reference attribute of

the property (usually "REFERENCE").

public void setColumnHeader(String key, String header) throws StudioAPIException

o Set the header of a column (overriding any default).o Parameters:

key: The column key. header: The new header. Please see Appendix C:

Labels and Icons for label formatting details.

public void setEditFunction(String key, String editFunction) throws StudioAPIException

o Set the list's drop function and accepted drag names.

o Parameters: key: The column key. This must match the key

for an existing column. editFunction: The javascript function to call

when the data within the cell has been changed.The function must exist in base.js or custom.js.

public void setDraggable(String key, String dragName) throws StudioAPIException

o Set a column to be draggable.o Parameters:

key: The column key. dragName: A string identifier to couple the

drag operation with a drop target, ie "CANDIDATE". Only drop targets with this

matching drag name will accept and process the drop operation.

public void setDropFunction(String dropFunction [, StringacceptedDragNames]) throws StudioAPIException

o Set the javascript function to run when an item is dropped onto a row of the list.

o Parameters: dropFunction: The javascript function to execute

when a valid drag object is dropped onto this list. This function must exist in base.js or custom.js. Adding these parameter constants to your function declaration will allow it to receive any necessary parameters:

_DRAGNAME_: This will receive the drag name of the object being dropped. This gives the developer the opportunity to handle invalid drag objects with custom code.

_DRAGID_: This will receive the context ID of the drag object (ie, the entity ID).

_DROPID_: This will receive the context ID of the drop object (ie, the entity ID).

_SRCWIDGET_: This will receive widget tagID of the widget from which the item is being dragged.

_DESTWIDGET_: This will receive widget tag ID of the widget on which the item is being dropped.

acceptedDragNames: A comma separated list of names that indicate what items this list will accept to be dropped onto it. When drag names are specified, the studio framework will automatically ignore any drag items that do notmatch.

public void addDragName(String dragName) throws StudioAPIException

o Add a name to the accepted drag names listo Parameters:

dragName: The name to add.

public void setMultiSelectProcessor(String multiSelectProcessor)

o Set the javascript function to use for multi-select operations.

o Parameters: multiSelectProcessor: The javascript function to

call when a workflow is run against multiple selections. This function must exist in base.js or custom.js.

Adding these parameter constants to your function declaration will allow it to receive any necessary parameters:

_CONTEXTID_: This will receive the context ID (the associated entity) of the widget.

_WIDGETTAGID_: This will receive the widget's tag ID, which is its parent <div>element's ID.

_SELECTIONS_: This will receive an array of long values which represent the entity IDs of the selected items.

public void setAsLink(String key [, char runType][, String workflow][, int target][, String caption][, Stringicon]) throws StudioAPIException

o Set a column as a link. If none of the optional parameters are provided, it is set as an entity link.

o Parameters:

key: The column key. This must be an existing column. Alternatively, it can be set to COLUMN_PRIMARY, which means to use the context ID of the row’s entity as opposed to an individual column’s entity ID.

runType (optional): The type of workflow to run. Possible values are:

CTYPE_ENTITY (default) CTYPE_WIDGET CTYPE_PREVIEW CTYPE_PREVIEW_TOPMOST CTYPE_JAVASCRIPT CTYPE_URL CTYPE_DOCUMENT CTYPE_DOCCAT CTYPE_BO CTYPE_VIEW CTYPE_QUERY CTYPE_MENU

workflow (optional): The workflow configuration name, such as the view name, BO name, widget name, etc. If runType is specified, then this parameter must be specified as well.

target (optional): This is currently used when the runType is CTYPE_WIDGET. It describes how the widget should be launched. Possible values are:

TARGET_NESTED (default): The widgets loadin-line, meaning below the corresponding row in a tree style.

TARGET_POPUP: The widgets load in dockable, movable, sizable pop-up windows.

TARGET_PREVIEW: The widgets load in this widget’s preview pane.

TARGET_PREVIEW_TOPMOST: The widgets load in the top-most widget’s preview pane.

caption (optional): Override for the default workflow caption. Please see Appendix C: Labels and Icons for label formatting details.

icon (optional): Override for the default workflowicon. You can use the ICON_NONE constant to create a text-only button.

public void setLinkIcon(String key, String icon) throws StudioAPIException

o Set the link icon for a column (or row) on which setAsLink() has been called.

o Parameters: key: The column key. This column must already

exist (or be set to COLUMN_PRIMARY) and have had the setAsLink() method called against it.

icon: The icon to set as the link icon.

public void setActiveLinkIcon(String key, String icon) throws StudioAPIException

o Set the link icon for a column (or row) when it’s inits active or open state. For example, if the target is TARGET_NESTED, you may want to use open and closed folder icons to represent expanded and collapse rows.

o Parameters: Key: The column key. This column must already

exist (or be set to COLUMN_PRIMARY) and have had the setAsLink() method called against it.

Icon: The icon to set as the active link icon.

public void setLinkCaption(String key, String caption) throws StudioAPIException

o Set the caption for a column (or row) on which setAsLink() has been called.

o Parameters:

key: The column key. This column must already exist (or be set to COLUMN_PRIMARY) and have had the setAsLink() method called against it.

caption: The new caption. Please see Appendix C: Labels and Icons for label formatting details.

public void setDefaultValue(String key, String defaultValue) throws StudioAPIException

o Set a column's default value when it's NULL in the database.

o Parameters: key: The column key. This column must already

exist.

public int addItem(long itemID) throws StudioAPIExceptiono Manually add an item/row to the list. The row’s

index (1-based) is returned.o Parameters:

itemID: The context ID of the item/row.

public void setData(int index, String key, String value) throws StudioAPIException

o Set a list item's valueo Parameters:

index: The index of the row in the list (1-based).

key: The column key. value: The new value.

public void setStyle(int index, String key, String style)throws StudioAPIException

o Set a list item's style.o Parameters:

index: The row’s index (1-based). key: The column key. style: The CSS style(s). For example: “font-

weight:bold;color:red;”.

public String getData(int index, String key) throws StudioAPIException

o Get the formatted data at the specified row and column.

o Parameters: index: The row’s index (1-based). key: The column key.

public long getReference(int index[, String key]) throws StudioAPIException

o The the reference/context ID of the specified row orcell.

o Parameters: index: The row’s index (1-based). key (optional): The column key. If this parameter

is not specified, the context ID of the row is returned.

public void addCondition(String propertyAttribute, Stringoperator, String compValue [, String logic]) throws StudioAPIException

o Add a condition for the query builder.o Parameters:

propertyAttribute: An Adapt PROPERTY.ATTRIBUTE pair

operator: The operator used to compare the current value to compValue

compValue: The value to compare again the current parameter value

logic (optional): Specify the query logic, ie AND or OR. The default value is AND.

public void addCondition(String sql) throws StudioAPIException

o This version of the method allows you to specify a condition using raw SQL.

o Parameters: none.

public void beginGroup([String logic])o Begin a group of conditions (inserts a left

parenthesis '(' into the query)o Parameters:

logic (optional): The logic to apply to the group, which can be AND or OR. By default, the logic is AND.

public void endGroup()o End a group of conditions (inserts a right

parenthesis ')' into the query).o Parameters: none.

public int loadData() throws StudioAPIExceptiono Call this method to run the query and populate the

list with the data. The total number of rows retrieved is returned.

o Parameters: none.

public void setSortable(boolean fSortable)

o Set the list’s ability to sort and display sortable columns. By default, lists are sortable.

o Parameters: fSortable: Set to TRUE to make the list sortable

(default) or FALSE to turn off sorting.

public void setSizeableColumns(boolean fSizeableColumns)o Give the user the ability to size the list columns.

By default, the columns of a list can be sized.o Parameters:

fSizeableColumns: Set to TRUE to make the listcolumns sizeable (default) or FALSE to disable this feature.

JournalAPI

The JournalAPI class is a widget data type object that provides the means for quickly displaying a user or entity’s journal. Thejournals are displayed in a list control.

Constants:

DF_DATETIME: Display the journal dates and times. DF_DATEONLY: Only display the journal dates. DF_TIMEONLY: Only display the journal times. TOOLBAR_POSITION_TOP: Positions the toolbar over the

list. TOOLBAR_POSITION_BOTTOM: Positions the toolbar below the

list.

Methods:

public JournalAPI(HttpServletRequest request, HttpServletResponse response) throws StudioAPIException

o Standard Constructoro Parameters:

request: The HttpServletRequest object available in the JSP environment.

response: The HttpServletResponse object available in the JSP environment.

public void setJournalType(char journalType, long ownerID) throws StudioAPIException

o Set the journal type to user or entity. By default,the current user’s journal is displayed.

o Parameters: journalType: Specifies the journal type.

Possible values are: JOURNAL_TYPE_ENTITY JOURNAL_TYPE_USER

ownerID: The owner of the journal.

public void addColumn(char column, String width) throws StudioAPIException

o Add a journal column.o column: A journal-specific column. Possible values

are: JOURNAL_COLUMN_DATETIME JOURNAL_COLUMN_WORKFLOW JOURNAL_COLUMN_USER_INIT JOURNAL_COLUMN_USER_NAME JOURNAL_COLUMN_NOTES

o width: The column’s width. This can be in either pixels, ie “150px” or as a percentage, ie “25%”. When using percentages, it is up to the developer not to exceed 100%.

public void setColumnHeader(String key, String header) throws StudioAPIException

o Set the header of a journal column (overriding the default).

o Parameters: key: The column key. header: The new header. Please see Appendix C:

Labels and Icons for label formatting details.

public void setDateFormat(byte dateFormat) throws StudioAPIException

o Set the date/time format.o Parameters:

dateFormat: The date format. Possible values are:

DF_DATETIME DF_DATEONLY DF_TIMEONLY

public WidgetAPI getWidget()o Retrieves the underlying WidgetAPI objecto Parameters: none.

public ToolbarAPI getToolbar()o Retrieves the underlying ToolbarAPI objecto Parameters: none.

public void removeToolbar() throws StudioAPIExceptiono Removes the toolbar from the widget. If this method

is not called and no items are added to the toolbar,a blank toolbar will still appear.

o Parameters: none.

public void setToolbarPosition(byte position) throws StudioAPIException

o Position the toolbar above or below the list. By default, the toolbar is above the list.

o Parameters: position: Can be one of the following constants:

TOOLBAR_POSITION_TOP TOOLBAR_POSITION_BOTTOM

public int loadData() throws StudioAPIExceptiono Call this method to run the query and populate the

list with the journal items. The total number of rows retrieved is returned.

o Parameters: none.

TabbedWidgetAPI

The TabbedWidgetAPI creates a widget frame that displays multiplewidgets using tabs.

Constants:

There are no constants specific to the TabbedWidgetAPI class.

Methods:

public TabbedWidgetAPI(HttpServletRequest request, HttpServletResponse response) throws StudioAPIException

o Standard Constructoro Parameters:

request: The HttpServletRequest object available in the JSP environment.

response: The HttpServletResponse object available in the JSP environment.

public void addTab(char runType, String workflow [, String caption][, String icon]) throws StudioAPIException

o Add a tab.

o Parameters: runType: The tab contents configuration type.

This is for method consistency and possible future compatibility, as currently, the only valid value is CTYPE_WIDGET, as only widgets can be displayed. However, please keep in mindthat widgets can be lists, documents, html, etc.

workflow: The configuration name of the workflow (or currently, the widget). For example D_MYCANDIDATES or D_MYJOBS.

caption (optional): By default, the widget’s name will be displayed as the tab’s caption. However, you can override it by setting this optional parameter. Please see Appendix C: Labels and Icons for label formatting details.

icon (optional): By default, there is no icon. However, you can set this parameter to display an icon in the tab.

HtmlAPI

The HtmlAPI class is a widget data type object that allows you touse a widget to display custom html.

Constants:

There are no constants specific to the HtmlAPI class.

Methods:

public HtmlAPI(HttpServletRequest request, HttpServletResponse response) throws StudioAPIException

o Standard Constructoro Parameters:

request: The HttpServletRequest object available in the JSP environment.

response: The HttpServletResponse object available in the JSP environment.

public WidgetAPI getWidget()o Retrieves the underlying WidgetAPI objecto Parameters: none.

public ToolbarAPI getToolbar()o Retrieves the underlying ToolbarAPI objecto Parameters: none.

public void removeToolbar() throws StudioAPIExceptiono Removes the toolbar from the widget. If this method

is not called and no items are added to the toolbar,a blank toolbar will still appear.

o Parameters: none.

public void appendHTML(String html) throws StudioAPIException

o Append html to the current contents.o Parameters:

html: The html to append.

public void appendTemplate(HtmlTemplateAPI templateAPI) throws StudioAPIException

o Append an HtmlTemplateAPI object to the contents.o Parameters:

templateAPI: The HtmlTemplateAPI object.

public void clearContent() throws StudioAPIExceptiono Clear the current contents, including html and

templates.

o Parameters: none.

HtmlTemplateAPI

The HtmlTemplateAPI class allows you to create a template to which you can merge Adapt data and display within a widget. Thisis particular useful when displaying summary data for an entity or an Adapt document. An HtmlTemplateAPI object is not a “stand-alone” widget data type and cannot be attached directly to widgets. In order to be displayed, the HtmlTemplateAPI object must be appended to an HtmlAPI object using the HtmlAPI.appendTemplate() method (see above).

This section focuses on the API for merging Adapt data into an html template. For more information on creating html templates, see Appendix D: HTML Templates.

Constants:

There are no constants specific to the HtmlTemplateAPI class.

Methods:

public HtmlTemplateAPI(String templateName) throws StudioAPIException

o Standard Constructoro Parameters:

templateName: The name of the html template. All html templates are located in StudioConfig/<domain>/base (or custom)/html, soonly the filename should be specified. By default, the base or custom folder is determined by the widget location. However, itcan be changed using the setLocationType() method (see below).

public void setLocationType(byte locationType)o The location type. If this method isn’t called, the

location type will match that of the container widget.

o Parameters: locationType: Possible values are:

ASM_LOCTYPE_BASE ASM_LOCTYPE_CUST

public void setContextID(long contextID)o Allows the context ID to be set explicitly. By

default, the context ID will match that of the container widget.

o Parameters: contextID: The context ID.

public long getContextID()o Retrieve the context ID.o Parameters: none.

public void setPrimaryReference(String primaryReference)o Set the primary property/attribute pair for the

query builder, ie CAND_GEN.REFERENCE.o Parameters:

primaryReference: An adapt attribute in the format PROPERTY.ATTRIBUTE.

public void linkProperty(String property, String viaAttribute) throws StudioAPIException

o Link in a property table. This is necessary when another table is used to link Adapt properties. Forexample, in order to display the client for a job listing, you would link in the X_JOB_CLIENT propertyvia JOB. Then you could use REFERENCE:X_JOB_CLIENT.CLIENT when adding the clientcolumn.

o Parameters: property: The configuration name of the Adapt

property. viaAttribute: The primary reference attribute of

the property (usually "REFERENCE"). public void addAttribute(String token, String attribute

[, String referenceChain]) throws StudioAPIException public void addAttribute(int tokenIndex, String attribute

[, String referenceChain]) throws StudioAPIExceptiono Link an Adapt attribute to a token within the html

template.o Parameters:

token or tokenIndex: If a String is supplied, the token is referenced by its tag name. If an integer is supplied, the token is referenced byindex. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

attribute: Specifies an Adapt attribute in the format PROPERTY.ATTRIBUTE or PROPERTY(NOCC).ATTRIBUTE.

public void setOccurrence(String token, int occurrence) throws StudioAPIException

public void setOccurrence(int tokenIndex, int occurrence)throws StudioAPIException

o Set the occurrence of an Adapt attribute that has been linked to a token within the html template. Please note that this is for multi-occurrence properties, not named occurrences.

o Parameters: token or tokenIndex: Specifies an Adapt attribute

that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can

only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

occurrence: The occurrence number.

public void setAsLink(String token [, char runType][, String workflow]) throws StudioAPIException

public void setAsLink(int tokenIndex [, char runType][, String workflow]) throws StudioAPIException

o Set an attribute as a workflow link.o Parameters:

token or tokenIndex: Specifies an Adapt attribute that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

runType (optional): The run type of the workflow (which must be specified if a runType is provided). Possible values are:

CTYPE_ENTITY (default) CTYPE_BO CTYPE_VIEW

workflow (optional): The configuration name of the run type (does not apply to CTYPE_ENTITY).

public void addWorkflow(String token, char runType, String workflow) throws StudioAPIException

public void addWorkflow(int tokenIndex, char runType, String workflow) throws StudioAPIException

o Add a workflow link and assign it to a token.o Parameters:

token or tokenIndex: Specifies an Adapt attribute that has been mapped to a token. If a String

is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

runType: The run type of the workflow. Possible values are:

CTYPE_ENTITY (default) CTYPE_BO CTYPE_VIEW

workflow: The configuration name of the run type (does not apply to CTYPE_ENTITY).

public void addLabel(String token, String key [, char labelType]) throws StudioAPIException

public void addLabel(int tokenIndex, String key [, char labelType]) throws StudioAPIException

o Add a label and assign it to a token.o Parameters:

token or tokenIndex: Specifies an Adapt attribute that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

key: Specified the label key. Please see Appendix C: Labels and Icons for label formatting details.

labelType (optional): The type of label. Possible values are:

CTYPE_NONE (literal) CTYPE_STUDIO CTYPE_WIDGET CTYPE_BO

CTYPE_VIEW CTYPE_MENU CTYPE_CODE CTYPE_DOCCAT CTYPE_ROLE CTYPE_PROPERTY CTYPE_ATTRIBUTE CTYPE_NOCC

public void addDocument(String token, String docCategoryPath) throws StudioAPIException

public void addDocument(int tokenIndex, String docCategoryPath) throws StudioAPIException

o Add an Adapt document and assign it to a token.o Parameters:

token or tokenIndex: Specifies an Adapt attribute that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

docCategoryPath: The configuration path of the document category, ie “Resume/Original Resume”.

public void addTemplate(String token, HtmlTemplateAPI templateAPI) throws StudioAPIException

public void addTemplate(int tokenIndex, HtmlTemplateAPI templateAPI) throws StudioAPIException

o Add an html template and assign it to a token. Thisprovides the ability to nest templates within templates. This is also the recommended approach topulling in sections of cross-reference data, as eachtemplate will have its own independent query.

o Parameters:

token or tokenIndex: Specifies an Adapt attribute that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

templateAPI: The HtmlTemplateAPI object.

public void setCaption(String token, String caption) throws StudioAPIException

public void setCaption(int tokenIndex, String caption) throws StudioAPIException

o Use this method to override a default caption. The token must have already been mapped using one of this object’s add methods.

o Parameters: token or tokenIndex: Specifies an Adapt attribute

that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

caption: A string representing the caption. Please see Appendix C: Labels and Icons for label formatting details.

public void setIcon(String token, String icon) throws StudioAPIException

public void setIcon(int tokenIndex, String icon) throws StudioAPIException

o Use this method to override a default icon. The token must have already been mapped using one of this object’s add methods.

o Parameters: token or tokenIndex: Specifies an Adapt attribute

that has been mapped to a token. If a String is supplied, the token is referenced by its tagname. If an integer is supplied, the token is referenced by index. The index notation can only be used when the standard token name formatting is used, which is “TOKEN_<n>” where <n> is the index number.

icon: The path of the icon (relative to the widget location).

QueryBuilderAPI

The QueryBuilderAPI class provides a way to build custom queries to retrieve data from the domain database.

Constants:

DBTYPE_SQLSERVER DBTYPE_ORACLE CONNECTION_NONE CONNECTION_DOMAIN CONNECTION_USER

Methods:

public QueryBuilderAPI(DomainI domain) throws StudioAPIException

o Standard Constructor, but it is best to use getQueryBuilder() from the data type object you’re working with. That method will automatically set the domain and connect you to the database.

o Parameters: domain: The DomainI object representing the

domain you wish to connect to.

public Connection connectToUsers() throws Exceptiono Disconnect from the domain database and connect to

the user database.o Parameters: none.

public void close() throws SQLExceptiono Closes the current connection and result set.

public byte getDatabaseType()o Get the current database type. The return values

will be one of the following: DBTYPE_SQLSERVER DBTYPE_ORACLE

o Parameters: none.

public ResultSet runQuery(String query) throws SQLException

o Run a query using the current connection. This method returns a ResultSet object. This method can only be used to retrieve results. It cannot be usedto run INSERT or UPDATE queries.

o Parameters: query: The query to run.

public void runUpdate(String query) throws SQLExceptiono Use this method to run an INSERT or UPDATE query.o Parameters:

query: The query to run.

Appendix A: Reference Chains

Reference chains provide a way to link attributes from tables that do not have a reference field for the current primary property.

The reference chain is made up of one or two attributes separatedby a colon: <LINK ATTRIBUTE>:<REFERENCE ATTRIBUTE>. When not specified, the link attribute is assumed to be the current primary reference. However, the reference attribute is always required (that is, when a reference chain is even needed). This is the attribute that contains the primary reference of the foreign property. In some cases, the property contains a reference to your primary property, so this is all you need, as the link attribute is implicitly the primary reference. Here’s an example. Let’s say our primary reference property is CAND_GENand we want to display the job category, which is in another property:

list.addColumn("JOB_CAT.JOB_CATEGORY", "20%", "JOB_CAT.REFERENCE");

JOB_CAT table contains the attribute we want to display and has adirect reference attribute to the candidate’s primary reference called REFERENCE.

However, let’s say we want to display the candidate’s current employer, which is CLIENT_GEN.NAME. The CLIENT_GEN property contains no direct reference to our primary reference property - CAND_GEN. However, the CAND_GEN property contains the attribute CURR_COMP, which is a reference to CLIENT_GEN; therefore, our link attribute. We can then specify the reference attribute which in this case is CLIENT_GEN.REFERENCE. The result is the following:

list.addColumn("CLIENT_GEN.NAME", "25%", "CAND_GEN.CURR_COMP:CLIENT_GEN.REFERENCE");

With the CLIENT_GEN property now linked, we can display the NAME attribute (or any other attribute, for that matter) from that property.

Please note that reference chains can only contain one link attribute; therefore, they can only go two levels deep.

Appendix B: Toolbar Controls

Here are some examples of the toolbar controls:

Spacers

Code:

toolbar.addWorkflowButton("W_US_RecordACandidateCall", toolbar.CTYPE_VIEW);

toolbar.addSpacer(); // default spacer of 10pxtoolbar.addWorkflowButton("Resume/Original Resume",

toolbar.CTYPE_DOCCAT, "$DOC$");toolbar.addSpacer(25); // 25px specifiedtoolbar.addAdaptMenu("S_rsCandCont", "images/icon_calls.gif");// no spacer between thesetoolbar.addAdaptMenu("S_rsCandPlc", "images/icon_placements.gif");

Output:

Labels

Code:

toolbar.addSpacer();toolbar.addLabel("My Label"); // literaltoolbar.addSpacer();toolbar.addLabel("$LBL_HOTCAND$"); // Studio labeltoolbar.addSpacer();toolbar.addLabel("CAND_GEN.STATUS"); // Attribute label

Output:

Buttons

Code:

JavaScript: toolbar.addJavascriptButton("alert('javascript alert!')", "images/icon_error.gif", "Alert!");

- or - toolbar.addWorkflowButton(“alert(‘javascript alert!’)”,

toolbar.CTYPE_JAVASCRIPT, “images/icon_error.gif”, “Alert!”);

Hyperlink: toolbar.addHyperlinkButton("http://www.bond-us.com", "images/bondlogo.png", "Bond International Software");

- or - toolbar. addWorkflowButton ("http://www.bond-us.com",

toolbar.CTYPE_URL, "images/bondlogo_16.png", "Bond International Software");

Adapt Workflow: toolbar.addWorkflowButton("W_US_RecordACandidateCall", toolbar.CTYPE_VIEW, "images/call.gif");

Adapt Document: toolbar.addWorkflowButton("Resume/Original Resume", toolbar.CTYPE_DOCCAT, "$DOC$");

Widget: toolbar.addWorkflowButton("RS_CAND_FASTFIND", toolbar.CTYPE_WIDGET, "images/cand_fastfind.gif");

Refresh: toolbar.addRefreshButton();

Sample output (not necessarily from code samples above):Standard button:

Standard text button:

Refresh button (with default icon):

Check boxes

Code:toolbar.addCheckbox("CAND_GEN.HOT", "=", "Y", "$LBL_HOTCAND$");

Output:

Radio button group

Code:toolbar.addRadioButton("JOB_GEN.JOB_TYPE", "=", "Job Type US/CO");toolbar.addRadioButton("JOB_GEN.JOB_TYPE", "=", "Job Type US/DO");toolbar.addRadioButton("JOB_GEN.JOB_TYPE", "IN", "Job Type US/DO,Job

Type US/CO", "$LBL_ALL$");

Output:

Adapt Menu

Code:toolbar.addAdaptMenu("S_rsCJobPlac", "images/icon_placements.gif");

Output:

Custom Menu

Code:String folderMenu = "FOLDER_ACTIONS";toolbar.addCustomMenu(folderMenu, "images/folder_menu.gif", "Talent Pool

Functions");toolbar.addCustomMenuItem(folderMenu, toolbar.CTYPE_VIEW,

"W_US_CreateFolder");

toolbar.addCustomMenuItem(folderMenu, toolbar.CTYPE_JAVASCRIPT, "deleteFolder('" + widget.widgetTagID() + "', " + folderID + ")", "", "$LBL_REMOVE_FOLDER_TP$");

toolbar.addCustomMenuItem(folderMenu, toolbar.CTYPE_VIEW, "W_US_AddCandidateToFolder");

Output:

Select Control (single)

Code:toolbar.addSelect("MY_SELECT", false, "My Select");toolbar.addSelectItem("MY_SELECT", "1", "Select Item 1");toolbar.addSelectItem("MY_SELECT", "2", "Select Item 2");toolbar.addSelectItem("MY_SELECT", "3", "Select Item 3");toolbar.addSelectItem("MY_SELECT", "4", "Select Item 4");toolbar.addSelectItem("MY_SELECT", "5", "Select Item 5");

Output:

Select Control (multiple)

Code:toolbar.addSelect("MY_SELECT", true, "My Select");toolbar.addSelectItem("MY_SELECT", "1", "Select Item 1");toolbar.addSelectItem("MY_SELECT", "2", "Select Item 2");toolbar.addSelectItem("MY_SELECT", "3", "Select Item 3");toolbar.addSelectItem("MY_SELECT", "4", "Select Item 4");toolbar.addSelectItem("MY_SELECT", "5", "Select Item 5");

Output:

Date Field

Code:toolbar.addDateField("DATE_FIELD");

Output:

Text FieldCode:

toolbar.addTextField("TEXT_FIELD_1");

Output:

Search Field

Code:// It’s not recommended to search both attributes and documents for

performance// reasons, but for example purposes …String searchField = "CANDIDATE_SEARCH";toolbar.addSearchField(searchField);

// Attributes to searchtoolbar.addSearchAttribute(searchField, "JOB_CAT.JOB_CATEGORY",

"JOB_CAT.REFERENCE");

toolbar.addSearchAttribute(searchField, "PERSON_GEN.FULLNAME", "PERSON_GEN.REFERENCE");

toolbar.addSearchAttribute(searchField, "CLIENT_GEN.NAME", "CAND_GEN.CURR_COMP:CLIENT_GEN.REFERENCE");

// Documents to searchtoolbar.addSearchCategory(searchField, "Resume/Original Resume",

toolbar.TARGET_DOC_DEFAULT);toolbar.addSearchCategory(searchField, "Notes/Candidate Profile");

Output:

Appendix C: Labels and IconsAs you have probably noticed, the label and icon parameters are optional on most of the API methods where an item may require oneor both of them. This is because the studio framework attempts to automatically retrieve a proper labels and icons based on the format of the parameter or the item’s key and using the user’s current language.

Labels:

By default, meaning no type specified, the following input stringformats prompt the studio framework to acquire the following typeof label:

- PROPERTY.ATTRIBUTE: Get the Adapt attribute’s name from md_multi_names. For example, PERSON_GEN.FULLNAME could return “Full Name” in English.

- PROPERTY(NOCC).ATTRIBUTE: Get the named occurrence name from md_multi_names. For example, TELEPHONE(Home).TEL_NUMBER would return “Home” in English.

- CodePath/CodePath/Code: Attempt to resolve the path as a code or code group and get its name. Please note that document categories are in the same format as codes. However, it will look up a code label by default when the type is not specified as can be done in certain methods.

- $LBL_STUDIOLABEL$: The surrounding $ will indicate a studiolabel.

- Literal: When the format does not match one of the above, no look up occurs and the input string is interpreted as a literal. For methods allowing it, you can also specify CTYPE_NONE to force the input string as a literal.

The above represent the defaults based on the format of the method’s key, label or caption parameter. However, when a type parameter is available, it can be set to force the label look up type. The following types are valid for label look up:

- CTYPE_VIEW- CTYPE_BO- CTYPE_MENU- CTYPE_JAVASCRIPT- CTYPE_STUDIO- CTYPE_WIDGET- CTYPE_CODE- CTYPE_ATTRIBUTE- CTYPE_DOCCAT- CTYPE_NOCC

Icons:

As with labels, the studio framework attempts to retrieve the matching icon for the configuration artifact specified whenever the icon parameter is not provided. This allows consistency throughout the system. However, when an icon is specified, a relative path (ie no beginning slash) is assumed to be relative to the current widget’s location. Both the asm_base and asm_custom folders contain an image folder, so “images/myicon.gif” specified in a custom widget, for example, will be loaded from/WebApp/template/view_templates/<domain>/asm_custom/images.

Absolute paths and urls can also be specified, ie /WebApp/images/doclib/doc_16.png or http://www.myurl/images/myicon.gif.

Whenever a method allows the type to be specified and the type isCTYPE_DOCCAT, you can have a document type’s default icon load byproviding the extension surrounded by $. For example, “$XLSX$” or“$DOCX$” tells the framework to display an Excel icon or an MS Word icon respectively.

By default, button-based toolbar controls will display a default icon if the icon parameter is not provided or set to null or blank. Any resolved or provided label will be displayed as rollover text. However, when a text button is desired, use the constant ICON_NONE for the icon parameter to achieve this.

Appendix D: HTML TemplatesHTML templates allow the developer to create widgets that displayAdapt data or documents in any arrangement. This is achieved by creating one more html template files containing token identifiers to which data elements can be mapped. As stated in the setup section of this document, the html templates reside in the StudioConfig/<domain>/base(or custom)/html folder. The token identifiers can be any string delimited in the following fashion:{$MyToken$}. However, using the index approach, ie {$TOKEN_n$} where n is a numeric index, makes the template more generic and you can then use the index-based methods for mapping and other operations.

Data is acquired using a similar method as EntityListAPI. The difference is that the data for only one entity is retrieved. Rather than adding columns, attributes are mapped to tokens. Notice that the addAttribute() method is formatted much like the addColumn() method of EntityListAPI:

list.addColumn("CLIENT_GEN.NAME", "25%", "CAND_GEN.CURR_COMP:CLIENT_GEN.REFERENCE");

- vs -template.addAttribute(6, "CLIENT_GEN.NAME", "CAND_GEN.CURR_COMP:CLIENT_GEN.REFERENCE");

This following example is a candidate summary widget. The widget’s layout is based on an html template. This widget is loaded as a preview widget from a selected row of a candidate entity list, so the context ID (candidate’s entity ID in this case) is automatically provided. Also, please note that this template widget is located within a tab of a tabbed widget (see TabbedWidgetAPI), which is a separate feature and is not part of the html template itself.

This particular widget has a primary template that embeds two additional templates: one for the address information and one

for the social networking workflows. In this case, all of the data is linked to the candidate, so the embedded templates are for formatting purposes only.

Here is the jsp code for this widget:

<%@page import="com.bis.studiomanager.api.*"

%><%try {

// Declare the widgetHtmlAPI widget = new HtmlAPI(request, response);

// Create the templates from the template filesHtmlTemplateAPI template = new

HtmlTemplateAPI("rs_summary_template.html");HtmlTemplateAPI addressTemplate = new

HtmlTemplateAPI("address_template.html");HtmlTemplateAPI socialNetTemplate = new

HtmlTemplateAPI("social_net_template.html");

// the toolbar code is in a shared jsp%><%@include file="rs_cand_preview_toolbar.jsp"%><%

template.setPrimaryReference("CAND_GEN.REFERENCE");

template.addLabel(1, "PERSON_GEN.FULLNAME");template.addAttribute(2, "PERSON_GEN.FULLNAME", "REFERENCE");template.setAsLink("TOKEN_2");

template.addLabel(3, "CAND_GEN.STATUS");template.addAttribute(4, "CAND_GEN.STATUS");

template.addLabel(5, "CAND_GEN.CURR_COMP");template.addAttribute(6, "CLIENT_GEN.NAME",

"CAND_GEN.CURR_COMP:CLIENT_GEN.REFERENCE");template.setAsLink("TOKEN_6");

template.addLabel(7, "CAND_GEN.AVAIL_ST");template.addAttribute(8, "CAND_GEN.AVAIL_ST");

template.addLabel(9, "JOB_CAT.JOB_CATEGORY");template.addAttribute(10, "JOB_CAT.JOB_CATEGORY", "JOB_CAT.REFERENCE");template.setOccurrence(10, 1);

// Get the address data into the address template and map it to a tokenaddressTemplate.setPrimaryReference("CAND_GEN.REFERENCE");addressTemplate.addAttribute(1, "ADDRESS(Primary).CITY",

"ADDRESS.REFERENCE");addressTemplate.addAttribute(2, "ADDRESS(Primary).STATE",

"ADDRESS.REFERENCE");template.addLabel(11, "City, State/Province");template.addTemplate(12, addressTemplate);

template.addAttribute(14, "JOB_CAT.JOB_CATEGORY", "JOB_CAT.REFERENCE");template.setOccurrence(14, 2);

template.addLabel(15, "TELEPHONE(Cell).TEL_NUMBER", template.CTYPE_NOCC);

template.addAttribute(16, "TELEPHONE(Cell).TEL_NUMBER", "TELEPHONE.REFERENCE");

template.addLabel(17, "SKILLS.SKILL");template.addAttribute(18, "SKILLS.SKILL", "SKILLS.REFERENCE");template.setOccurrence(18, 1);

template.addLabel(19, "EMAIL(Email1).EMAIL_ADD");template.addAttribute(20, "EMAIL(Email1).EMAIL_ADD", "EMAIL.REFERENCE");template.setAsLink(20, template.CTYPE_VIEW, "W_US_SendAnEmail");

template.addAttribute(22, "SKILLS.SKILL", "SKILLS.REFERENCE");template.setOccurrence(22, 2);

template.addLabel(23, "$LBL_SOCIAL_NETWORKING$");

// Set up the social network template

socialNetTemplate.setPrimaryReference("CAND_GEN.REFERENCE");socialNetTemplate.addWorkflow(1, template.CTYPE_VIEW,

"W_US_UpdateSocialNetworks");socialNetTemplate.setIcon(1, "images/facebook_16.png");

socialNetTemplate.addWorkflow(2, template.CTYPE_VIEW, "W_US_UpdateSocialNetworks");

socialNetTemplate.setIcon(2, "images/twitter_16.png");

socialNetTemplate.addWorkflow(3, template.CTYPE_VIEW, "W_US_UpdateSocialNetworks");

socialNetTemplate.setIcon(3, "images/linkedin_16.png");

socialNetTemplate.addWorkflow(4, template.CTYPE_VIEW, "W_US_UpdateSocialNetworks");

socialNetTemplate.setIcon(4, "images/google_16.png");

// map the social network templatetemplate.addTemplate(24, socialNetTemplate);

template.addAttribute(26, "SKILLS.SKILL", "SKILLS.REFERENCE");template.setOccurrence(26, 3);

template.addLabel(29, "$LBL_PROFILE$");template.addDocument(30, "Notes/Candidate Profile");

widget.appendTemplate(template);

}catch ( Exception e ) {

out.println("ERROR: " + e);e.printStackTrace();return;

}%><jsp:forward page="/asm/widget_render"/>

Here is the primary template (rs_summary_template.htm):

<style>.summaryTable {

margin: 5px;

width: 99%;overflow: hidden;

}.labelToken {}

.dataToken {font-weight: bold;

}.profileToken {

padding: 10px;height: 75px;overflow-y:auto;white-space:normal;

}</style><table class="summaryTable" cellspacing="5" cellpadding="0">

<tr><td class="labelToken">{$TOKEN_1$}</td><td class="dataToken">{$TOKEN_2$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_3$}</td><td class="dataToken">{$TOKEN_4$}</td>

</tr><tr>

<td class="labelToken">{$TOKEN_5$}</td><td class="dataToken">{$TOKEN_6$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_7$}</td><td class="dataToken">{$TOKEN_8$}</td>

</tr><tr>

<td class="labelToken">{$TOKEN_9$}</td><td class="dataToken">{$TOKEN_10$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_11$}</td><td class="dataToken">{$TOKEN_12$}</td>

</tr><tr>

<td class="labelToken">{$TOKEN_13$}</td><td class="dataToken">{$TOKEN_14$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_15$}</td><td class="dataToken">{$TOKEN_16$}</td>

</tr><tr>

<td class="labelToken">{$TOKEN_17$}</td>

<td class="dataToken">{$TOKEN_18$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_19$}</td><td class="dataToken">{$TOKEN_20$}</td>

</tr><tr>

<td class="labelToken">{$TOKEN_21$}</td><td class="dataToken">{$TOKEN_22$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_23$}</td><td class="dataToken">{$TOKEN_24$}</td>

</tr><tr>

<td class="labelToken">{$TOKEN_25$}</td><td class="dataToken">{$TOKEN_26$}</td><td>&nbsp;</td><td class="labelToken">{$TOKEN_27$}</td><td class="dataToken">{$TOKEN_28$}</td>

</tr><tr>

<td colspan="5" style="padding-top:10px;"><fieldset class="profileToken">

<legend style='color:#999999;'>{$TOKEN_29$}</legend><div>{$TOKEN_30$}</div>

</fieldset></td>

</tr></table>

The template for the address (address_template.htm) is very simple:

{$TOKEN_1$}, {$TOKEN_2$}

… as is the template for social networking (social_net_template.htm):

<table width="75%" cellpadding="0" cellspacing="0"><tr>

<td>{$TOKEN_1$}</td><td>{$TOKEN_2$}</td><td>{$TOKEN_3$}</td><td>{$TOKEN_4$}</td>

</tr></table>

HTML templates can also be used to create Adapt document widgets.This is done by creating a simple template and using addDocument()to map an Adapt document to a token within the template:

Document template (document_template.htm):

<style>.documentDiv {

padding: 10px;overflow-y:auto;white-space:normal;

}</style><div class="documentDiv">{$TOKEN_1$}</div>

JSP code:

<%@page import="com.bis.studiomanager.api.*"

%><%try {

// Declare the widget objectHtmlAPI widget = new HtmlAPI(request, response);

HtmlTemplateAPI template = new HtmlTemplateAPI("document_template.html");

// the toolbar code is in a shared jsp%><%@include file="rs_cand_preview_toolbar.jsp"%><%

template.setPrimaryReference("CAND_GEN.REFERENCE");// Map the resume to the tokentemplate.addDocument(1, "Resume/Original Resume");

widget.appendTemplate(template);

}catch ( Exception e ) {

out.println("ERROR: " + e);e.printStackTrace();return;

}%><jsp:forward page="/asm/widget_render"/>

The result is a widget that displays the candidate’s resume:

Appendix E: Sample Widget – My CandidatesThis widget demonstrates the following key features:

- Select control- Custom menu button- Overriding column headers- Adding conditions- Setting default column values- Retrieving configuration IDs- Checkboxes- Workflow buttons- Column aliasing- Reference Chains- Column links- QueryBuildAPI usage

<%@page import="com.bis.studiomanager.api.*,

java.sql.ResultSet"%>

<%try {

// Declare the list and toolbar objectsEntityListAPI list = new EntityListAPI(request, response);WidgetAPI widget = list.getWidget();ToolbarAPI toolbar = list.getToolbar();

// --- Set up the entity list --- //// only allow single row selectionlist.setSelectionType(list.SELECTION_TYPE_SINGLE);

// Primary referencelist.setPrimaryReference("CAND_GEN.REFERENCE");

// Add the columnslist.addColumn("CAND_GEN.RANKING", "10%");list.addColumn("CAND$PERSON_GEN.FULLNAME", "25%", "REFERENCE");list.addColumn("TELEPHONE(Cell).TEL_NUMBER", "20%", "REFERENCE");list.addColumn("CLIENT_GEN.NAME", "25%",

"CAND_GEN.CURR_COMP:CLIENT_GEN.REFERENCE");list.addColumn("JOB_CAT.JOB_CATEGORY", "20%", "JOB_CAT.REFERENCE");

// Make certain columns links to open the entitylist.setAsLink("CAND$PERSON_GEN.FULLNAME");list.setAsLink("CLIENT_GEN.NAME");

// Override any default valueslist.setDefaultValue("CAND_GEN.RANKING", "0");

// Override the column header for Ranking (the adapt description isn't good for this label)

list.setColumnHeader("CAND_GEN.RANKING", "$LBL_RANK$");

// Don't list candidates with no namelist.addCondition("CAND$PERSON_GEN.FULLNAME", "<>", "NULL");

// Filter by folder id if one is selectd. Otherwise, filter on the widget data owner being the recruiter

long folderID = widget.getParameterAsLong("FOLDER_SELECTION");if ( folderID > 0 ) {

list.addCondition("CAND_GEN.REFERENCE", "IN", "SELECT ENTITY FROM PROP_X_FOLDER_ENT WHERE REFERENCE=" + folderID);

}else {

list.addCondition("CAND_GEN.REFERENCE", "IN", "SELECT REFERENCE FROM PROP_OWN_RECR WHERE RECRUITER=" + widget.dataOwnerID());

}

// if this system has been configured for talent pools, the code id willbe > 0

long c_folderTypeTP = list.getConfigurationID("Folder Types/TP", list.CTYPE_CODE);

String selectKey = "FOLDER_SELECTION";

if ( c_folderTypeTP > 0 ) {toolbar.addSpacer(2);

// Create a new SELECT listtoolbar.addSelect(selectKey, false, "Folder Types");toolbar.addSelectItem(selectKey, "0", " -- My Candidates -- ");

// Run a separate query to get the widget data owner's foldersQueryBuilderAPI query = new QueryBuilderAPI(list.myDomain());ResultSet rs = null;try {

String sql = " SELECT REFERENCE, FOLDER_NAME"+ " FROM PROP_FOLDER_GEN"+ " WHERE"+ " PROP_FOLDER_GEN.OWNER=" +

widget.dataOwnerID()+ " AND

PROP_FOLDER_GEN.FOLDER_TYPE=" + c_folderTypeTP+ " AND REFERENCE NOT IN (SELECT

ENTITY_ID FROM ENTITY_TABLE WHERE STATUS='D')";

// add each result as a SELECT itemrs = query.runQuery(sql);if( rs != null ) {

while ( rs.next() ) {toolbar.addSelectItem(selectKey,

rs.getString("REFERENCE"), rs.getString("FOLDER_NAME"));}

}}catch ( Exception e ) {

e.printStackTrace();}finally {

// this closes the result set and the connectionquery.close();

}

// Add a custom menu to display folder operations

String folderMenu = "FOLDER_ACTIONS_" + (String)((folderID > 0)?"1":"0");

toolbar.addCustomMenu(folderMenu, "images/folder_menu.gif", "Talent Pool Functions");

// Create a Talent Pool (always visible"D:/Adapt/11.7/WebApp/template/asm_base/images/folder_menu.gif")

toolbar.addCustomMenuItem(folderMenu, toolbar.CTYPE_VIEW, "W_US_CreateFolder");

// Delete the current Talent Pool (only visible when a talent poolis selected)

if ( folderID > 0 ) {toolbar.addCustomMenuItem(folderMenu,

toolbar.CTYPE_JAVASCRIPT, "deleteFolder('" + widget.widgetTagID() + "', " + folderID + ")", "", "$LBL_REMOVE_FOLDER_TP$");

}

// Add candidate to Talent Pool (always visible)toolbar.addCustomMenuItem(folderMenu, toolbar.CTYPE_VIEW,

"W_US_AddCandidateToFolder");

// Remove the selected candidate from the current Talent Poolif ( folderID > 0 ) {

String uri = request.getRequestURI();String thisPath = uri.substring(0, uri.lastIndexOf("/"));toolbar.addCustomMenuItem(folderMenu,

toolbar.CTYPE_JAVASCRIPT, "removeFromFolder('" + thisPath + "','" + folderID +"','" + widget.widgetTagID() + "','TP',1)", "", "$LBL_REMOVE_FROM_TP$");

}

toolbar.addSpacer();}

toolbar.addCheckbox("CAND_GEN.HOT", "=", "Y", "$LBL_HOTCAND$");

toolbar.setAlign(toolbar.ALIGN_RIGHT);toolbar.addWorkflowButton("W_US_RecordACandidateCall",

toolbar.CTYPE_VIEW, "images/call.gif");

// Run the query and fill the list with the current page's datalist.loadData();

}catch ( Exception e ) {

out.println("ERROR: " + e);e.printStackTrace();return;

}%><jsp:forward page="/asm/widget_render"/>

Appendix F: Sample Widget – Job Order QueueThis widget demonstrates the following key features:

- Linking additional properties- Overriding column headers- Column links- Retrieving labels- Adding conditions- Workflow buttons- Column aliasing- Reference Chains- Setting custom styles on list data

<%@page import="com.bis.studiomanager.api.*,

java.util.Calendar"

%><%try {

// Declare the list and toolbar objectsEntityListAPI list = new EntityListAPI(request, response);ToolbarAPI toolbar = list.getToolbar();

// --- Set up the entity list --- //// there are no workflows, so turn row selection offlist.setSelectionType(list.SELECTION_TYPE_MULTI);

// Primary referencelist.setPrimaryReference("JOB_GEN.REFERENCE");

// Link in "X" tablelist.linkProperty("X_CLIENT_JOB", "JOB");

// Add the columnslist.addColumn("DISPOSITION", "13%");list.addColumn("JOB_GEN.JOB_ID", "14%");list.addColumn("JOB_TITLE.JOB_TITLE", "14%", "REFERENCE");list.addColumn("JOB_GEN.START_DT", "14%");list.addColumn("JOB_GEN.NUM_REM", "5%");list.addColumn("JOB_GEN.NUM_PLACE", "5%");list.addColumn("JOB_GEN.NUM_REQ", "5%");list.addColumn("CLIENT_GEN.NAME", "15%",

"REFERENCE:X_CLIENT_JOB.CLIENT");list.addColumn("CONTACT$PERSON_GEN.FULLNAME", "10%",

"REFERENCE:X_CLIENT_JOB.CONTACT");

// Override the DISPOSITION column headerlist.setColumnHeader("DISPOSITION", "$LBL_DISPOSITION$");list.setColumnHeader("CONTACT$PERSON_GEN.FULLNAME",

"X_CLIENT_JOB.CONTACT");

// Make certain columns links to open the entitylist.setAsLink("JOB_GEN.JOB_ID");list.setAsLink("CONTACT$PERSON_GEN.FULLNAME");list.setAsLink("CLIENT_GEN.NAME");

// Only show active and partially filled jobslist.addCondition("JOB_GEN.STATUS", "IN", "Job Status US/A,Job Status

US/P");// Only show contract and direct jobs … no opportunitieslist.addCondition("JOB_GEN.JOB_TYPE", "IN", "Job Type US/D,Job Type

US/C");

int count = list.loadData();

// Run the query and fill the list with the current page's datafinal long DAY_IN_MILLIS = 86400000;long dlong = 0L;int diff = 0;String lblOverdue = list.getLabel("$LBL_OVERDUE$");String lblWithinSeven = list.getLabel("$LBL_DUE_WITHIN_SEVEN_DAYS$");String lblGreaterSeven = list.getLabel("$LBL_GREATER_THAN_SEVEN_DAYS$");

toolbar.setAlign(toolbar.ALIGN_RIGHT);toolbar.addWorkflowButton("RS_JOB_FASTFIND", toolbar.CTYPE_WIDGET,

"images/job_fastfind.gif");

long today = Calendar.getInstance().getTimeInMillis();

for ( int r = 1; r <= count; r++ ) {dlong = list.getReference(r, "JOB_GEN.START_DT");diff = (int)((dlong - today) / DAY_IN_MILLIS);

if ( diff < 0 ) {list.setData(r, "DISPOSITION", lblOverdue);list.setStyle(r, "DISPOSITION", "color: #ff0000;");

}else if ( (diff <= 7) && (diff >= 0) ) {

list.setData(r, "DISPOSITION", lblWithinSeven);list.setStyle(r, "DISPOSITION", "color: #00cc33;");

}else {

list.setData(r, "DISPOSITION", lblGreaterSeven);}

}}catch ( Exception e ) {

out.println("ERROR: " + e);e.printStackTrace();return;

}%><jsp:forward page="/asm/widget_render"/>

Appendix G: Sample Widget – My ProjectsThis widget demonstrates the following key features:

- Disabling selections- Checkboxes- Reference Chains- Custom filters (manually retrieving widget parameters and

setting conditions)- Widget links (nested in this case)

<%@page import="com.bis.studiomanager.api.*"

%><%try {

// Declare the list and toolbar objectsEntityListAPI list = new EntityListAPI(request, response);WidgetAPI widget = list.getWidget();ToolbarAPI toolbar = list.getToolbar();

// --- Set up the entity list --- //// disable row selectionlist.setSelectionType(list.SELECTION_TYPE_NONE);

// Primary referencelist.setPrimaryReference("PROJ_GEN.REFERENCE");

list.linkProperty("X_CLIENT_PRJ", "PROJECT");

// Add the columnslist.addColumn("PROJ_GEN.PROJ_ID", "20%");list.addColumn("PROJ_GEN.PROJ_DESC", "40%");list.addColumn("CLIENT_GEN.NAME", "25%",

"REFERENCE:X_CLIENT_PRJ.CLIENT");

// Override the default header (in this case, use the xref to display "Client" instead of "Name")

list.setColumnHeader("CLIENT_GEN.NAME", "X_CLIENT_PRJ.CLIENT");

// Nested widgetslist.setAsLink(list.COLUMN_PRIMARY, list.CTYPE_WIDGET,

"D_MYPROJECTS_JOBS", list.TARGET_NESTED);

// Only show active projectslist.addCondition("PROJ_GEN.PROJ_STATUS", "=", "Project Status US/A");

String everyone = widget.getParameter("EVERYONES");if ( !"Y".equals(everyone) ) {

list.addCondition("PROJ_GEN.REFERENCE", "IN", "SELECT REFERENCE FROM PROP_OWN_CONS WHERE CONSULTANT=" + widget.dataOwnerID());

}

// --- build the toolbar --- ///// Checkbox for listing hot jobs onlytoolbar.addCheckbox("EVERYONES", "=", "Y", "$LBL_EVERYONES$");

// Run the query and fill the list with the current page's datalist.loadData();

}catch ( Exception e ) {

out.println("ERROR: " + e);e.printStackTrace();return;

}%><jsp:forward page="/asm/widget_render"/>