#set ($view = $context.getRequestParameter("view"))
#set ($viewpath = $context.getRequestParameter("viewpath"))
#set ($label = $context.getRequestParameter("label"))
#set ($id = $context.getRequestParameter("id"))
#set ($module = $context.findValue("module"))
#set ($viewid = $url_util.getPathUtilities().extractFileName($view) )
#set ($columns = $context.getRequestParameter("columns"))
#if ($columns)
$context.putPageValue("detailviewercolumns",$columns)
#end
#if(!$hitssessionid)
#set( $hitssessionid = $context.getRequestParameter("hitssessionid") )
#end
#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("editpath"))
#if(!$editpath)
#set( $editpath = "$componenthome/detaileditor/genericsave.html" )
#end
#if($data.getId().startsWith("multiedit"))
#set($multiedit = true)
#end
#set( $viewdata = $searcher.getViewData($view) )
$context.getText($viewdata)
##
##th-large
#if (($edit && $edit != "false") || ($openview && $openview == $view))
#set( $targetdiv = $context.getRequestParameter("targetdiv"))
#if (!$targetdiv)
#set( $targetdiv = "tabsummarypanel")
#end
#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 != "" || $detail.dataType == "searchjoin")
#set( $foundone = true)
$!context.putPageValue("val",$value)
$context.putPageValue("showalllanguagevalues",false)
$!context.putPageValue("detail",$detail)
$pages.include("$componenthome/xml/detailreadonly.html", $context)
#end
#end ##foreach loop
#if( !$foundone )
[[No data has yet been entered]]
#end
#if(($caneditasset || $caneditallassets) && !$print.equals("true"))
[[Edit ]]
#if( $caneditmetadatasetup )
#if ( $view.contains("$asset.assettype") )
#set ( $type = $asset.assettype )
#end
#end
#end
#else ##showit
[[No data has yet been entered]]
#end
#end ##edit