public void Set_Main_Writer()
{
// If this is for HTML or HTML logged in, try to get the web skin object
string current_skin_code = currentMode.Skin.ToUpper();
if ((currentMode.Writer_Type == Writer_Type_Enum.HTML) || (currentMode.Writer_Type == Writer_Type_Enum.HTML_LoggedIn))
{
// Check if a different skin should be used if this is an item display
if ((currentMode.Mode == Display_Mode_Enum.Item_Display) || (currentMode.Mode == Display_Mode_Enum.Item_Print))
{
if ((currentItem != null) && (currentItem.Behaviors.Web_Skin_Count > 0))
{
if (!currentItem.Behaviors.Web_Skins.Contains(current_skin_code))
{
string new_skin_code = currentItem.Behaviors.Web_Skins[0];
current_skin_code = new_skin_code;
}
}
}
}
// Build the RequestCache object
RequestCache RequestSpecificValues = new RequestCache(currentMode, searchResultStatistics, pagedSearchResults, currentUser, publicFolder, topLevelCollection, tracer);
if ((currentMode.Writer_Type == Writer_Type_Enum.HTML) || (currentMode.Writer_Type == Writer_Type_Enum.HTML_LoggedIn))
{
mainWriter = new Html_MainWriter(RequestSpecificValues);
}
// Load the OAI writer
if (currentMode.Writer_Type == Writer_Type_Enum.OAI)
{
mainWriter = new Oai_MainWriter(HttpContext.Current.Request.QueryString, RequestSpecificValues);
}
// Load the DataSet writer
if (currentMode.Writer_Type == Writer_Type_Enum.DataSet)
{
mainWriter = new Dataset_MainWriter(RequestSpecificValues);
}
// Load the DataProvider writer
if (currentMode.Writer_Type == Writer_Type_Enum.Data_Provider)
{
mainWriter = new DataProvider_MainWriter(RequestSpecificValues);
}
// Load the XML writer
if (currentMode.Writer_Type == Writer_Type_Enum.XML)
{
mainWriter = new Xml_MainWriter(RequestSpecificValues);
}
// Load the JSON writer
if (currentMode.Writer_Type == Writer_Type_Enum.JSON)
{
mainWriter = new Json_MainWriter(RequestSpecificValues, UI_ApplicationCache_Gateway.Settings.Servers.Image_URL);
}
// Load the HTML ECHO writer
if (currentMode.Writer_Type == Writer_Type_Enum.HTML_Echo)
{
mainWriter = new Html_Echo_MainWriter(RequestSpecificValues, browse_info_display_text);
}
// Default to HTML
if (mainWriter == null)
{
mainWriter = new Html_MainWriter(RequestSpecificValues);
}
}