#set ($view = $context.getRequestParameter("view"))
#set ($label = $context.getRequestParameter("label"))
#set ($id = $context.getRequestParameter("id"))
#if( !$catalogid )
#set( $catalogid = $mediaarchive.getCatalogId() )
#end
#if(!$searcher)
#set ( $searchtype = $context.getRequestParameter("searchtype") )
#if( $searchtype )
#set ( $searcher = $searcherManager.getSearcher($catalogid, $searchtype ) )
#else
#set ( $searcher = $mediaarchive.assetSearcher )
#end
#end
#set( $catalogid = $searcher.getCatalogId() )
#set( $searchtype = $searcher.getSearchType() )
#if(!$data)
#if( $asset )
#set( $data = $asset )
#else
#set ($data = $searcher.searchById($id))
#end
$context.putPageValue("data", $data)
#end
$context.putPageValue("searcher", $searcher)
$context.putPageValue("searchtype", $searchtype)
#set ( $openview = $context.getRequestParameter("openview") )
#set ( $edit = $context.getRequestParameter("edit") )
#set ($editpath = $context.getRequestParameter("editorpath"))
#if(!$editpath)
#set( $editpath = "${page.directory}/genericsave.html" )
#end
#if($data.getId().startsWith("multiedit"))
#set($multiedit = true)
#end
#if (($edit && $edit != "false") || ($openview && $openview == $view))
#else
#set ($showit = true)
#set ($print = $context.getRequestParameter("print"))
#if ($print && $print == "true")
#set( $assetdetails = $searcher.getDetailsForView($view, $user) )
#set( $showit = false)
#foreach( $detail in $assetdetails )
#set( $value = false)
#set( $value = $data.get($detail.getId()))
#if( $value )
#set( $showit = true)
#end
#end
#set( $viewlabel = $searcher.getViewLabel($view) )
##set ($pluginpath = $context.getRequestParameter("pluginpath"))
##set( $plugin = $pages.getPage("$pluginpath"))
$context.getText($viewlabel)
#end
#if ($showit)
#set( $foundone = false)
#set( $assetdetails = $searcher.getDetailsForView($view, $context.getUserProfile()) )
$context.putPageValue("details",$assetdetails)
$context.putPageValue("searcher",$searcher)
## TODO: USE THIS !$pages.include("/$applicationid/components/xml/detaileditorcss.html?detailsreadonly=true", $context)
#foreach( $detail in $assetdetails )
#set( $value = false)
#if( $searcherManager )
#set( $value = $searcherManager.getValue($data,$detail,$context.getLocale()) )
#else
#set( $value = $data.get($detail.getId()))
#end
#if( $value && $value != "")
#set( $foundone = true)
$detail.getText($context)
$!context.putPageValue("val",$value)
$!context.putPageValue("detail",$detail)
$pages.include("$apphome/components/xml/detailreadonly.html", $context)
#end
#end ##foreach loop
#if( !$foundone )
[[No Data has yet been entered.]]
#end
#if($caneditasset && !$print.equals("true"))
[[Edit ]]
#else
#end
#else ##showit
[[No data has been entered.]]
#end
#end ##edit