The getAssetType()
method is implemented by the Asset Picker container page and is called by the plugin page, which is included in the container through the dspel:include
tag.
getAssetType()
returns a JavaScript associative array with the following keys:
Key | Description |
---|---|
| The asset item descriptor type. |
| The Nucleus path to the repository component for the asset. |
| The |
| The display property of the asset item type as specified in the repository definition file. |
| Specifies the type of asset being searched for. Can be either “file” or “repository”. |
The plugin uses these values to perform the search or browse on the item returned by the getAssetType()
method.
The following example is from assetPickerContainer.jsp
in <ATG11dir>\AssetUI\j2ee-apps\assetui.ear\assetui.war
.
<script language="JavaScript"> // // Returns the selected asset type to the plugin // function getAssetType() { var assetType = new Object(); assetType.itemType = "<c:out value='${itemType}'/>"; assetType.componentPath = "<c:out value='${componentPath}'/>"; assetType.encodedType = assetType.componentPath + ":" + assetType.itemType; assetType.itemDisplayProperty = getItemDisplayProperty( assetType.componentPath, assetType.itemType ); for (var i=0; i<assetTypes.length; i++) { if ( assetTypes[i].componentPath == assetType.componentPath && assetTypes[i].typeName == assetType.itemType ) { assetType.typeCode = assetTypes[i].typeCode; } } return assetType; }
The next example, from repositorySearchResults.jsp
, shows how this method is called by a plugin page:
function performSearch() { var assetType = getAssetType(); var itemType = assetType.itemType; var componentPath = assetType.componentPath; var itemDisplayProperty = assetType.itemDisplayProperty; var encodedType = assetType.encodedType; document.repositorySearchForm.componentPath.value = componentPath; document.repositorySearchForm.itemType.value = itemType; document.repositorySearchForm.encodedType.value = encodedType; if ( itemDisplayProperty != null ) { document.repositorySearchForm.sortProperty.value = itemDisplayProperty; } else { document.repositorySearchForm.sortProperty.value = "displayName"; } document.repositorySearchForm.submit(); } </script>