The Asset Picker client (the Business Control Center, in the case of ATG Content Administration) uses a JavaScript AssetBrowser object to populate the possible asset item types and repositories that can be selected by the picker. The client also uses the object to configure various options available to the picker.

The following example of the AssetBrowser object is taken from the Business Control Center page <ATG10dir>\PubPortlet\PubPortlets.ear\portlets.war\html\ProjectsPortlet\projectAssets.jsp, which is used to add assets to a project:

var picker = new AssetBrowser();
    picker.browserMode        = "project";
    picker.createMode         = "redirect";
    picker.closeAction        = "refresh";
    picker.assetTypes         = assetTypesList;
    picker.formHandler        = "/atg/epub/servlet/ProjectFormHandler";
    picker.formHandlerAction  = "1";
    picker.assetInfoPath      = "/atg/epub/servlet/ProcessAssetInfo";
    picker.defaultView        = "Search";
    picker.invoke();

The browserMode property can be set to "project", used for pages where multiple assets can be selected, or "pick", used for pages that allow selection of individual assets.

The defaultView property specifies the tab that is active when the page is displayed to the user.

For another example, see <ATG10dir>\PubPortlet\PubPortlets.ear\portlets.war\html\views\property\item\popupPickerEdit.jsp, which is a Business Control Center page that allows users to create a link that points to an asset.

The AssetBrowser object also has a property called viewConfiguration that makes customized data defined in the invoking JavaScript available to the plugin JSP.

var viewConfig = new Array();
viewConfig.key1 = 'value1';
viewConfig.key2 = 'value2';
var picker = new AssetBrowser();
picker.viewConfiguration = viewConfig;

The viewConfig associative array is available to the plugin via a getViewConfiguration() JavaScript method implemented by the container page (see assetPicker.jsp). The key/value pairs in the array are also available as page variables in the plugin page. For example, these key/value pairs:

<p>key1 = <c:out value='${key1}' />
<p>key2 = <c:out value='${key2}' />

render as follows:

key1 = value1
key2 = value2