package $proteus.oa;

import net.cyan.proteus.*;
import net.cyan.arachne.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.gzzm.platform.desktop.StyleUtils;
import com.gzzm.platform.login.UserOnlineInfo;
import net.cyan.commons.util.io.WebUtils;
import net.cyan.proteus.base.*;
import net.cyan.commons.util.*;

public class main implements TemplateProcessor
{

    public void process(TemplateContext context)throws Exception
    {
        TemplateWriter writer = context;
RequestContext requestContext=RequestContext.getContext();
ServletConfig config=requestContext.getServletConfig();
ServletContext application=requestContext.getServletContext();
HttpServletRequest request=requestContext.getRequest();
HttpServletResponse response=requestContext.getResponse();
HttpSession session=request.getSession(false);
java.io.PrintWriter out=context.get("out$");
TagContext tagContext = TagContext.getTagContext(context);
TagInfo tagInfo;
writer.write("\r");
writer.write("\r");
writer.write("\r");

    String navigator = WebUtils.getNavigator(request);
    String defaultStylePath = "/oa/styles/plain";
    if (navigator == null || navigator.equals("IE6") || navigator.startsWith("IE6.")) {
        defaultStylePath = "/oa/styles/default";
    }
    UserOnlineInfo userOnlineInfo = UserOnlineInfo.getUserOnlineInfo(request);
    Integer userId = userOnlineInfo.getUserId();
    String stylePath = StyleUtils.getStylePath(userId, defaultStylePath);

    if (stylePath != null && stylePath.contains("plain") && (navigator == null || navigator.equals("IE6") || navigator.startsWith("IE6."))) {
        stylePath = "/oa/styles/default";
    }

    StyleUtils.setStylePath("oa", stylePath, request, response);
    StyleUtils.setStylePath("desktop", stylePath, request, response);

writer.write("\r");
tagInfo = new TagInfo();
tagInfo.setTagName("html");
tagInfo.setLine(21);
tagInfo.setHasEndTag(true);
tagInfo.setHasEndSymbol(false);
TagProcessor proteusForwardProcessor$HtmlTagProcessor$0 = new net.cyan.arachne.result.ProteusForwardProcessor.HtmlTagProcessor();
if(tagContext.doStart(proteusForwardProcessor$HtmlTagProcessor$0,tagInfo))
{
do
{
if(tagContext.doBefore())
{
writer.write("\r");
tagInfo = new TagInfo();
tagInfo.setTagName("head");
tagInfo.setLine(22);
tagInfo.setHasEndTag(true);
tagInfo.setHasEndSymbol(false);
tagInfo.setTagBefore(true);
TagProcessor proteusForwardProcessor$HeadTagProcessor$0 = new net.cyan.arachne.result.ProteusForwardProcessor.HeadTagProcessor();
if(tagContext.doStart(proteusForwardProcessor$HeadTagProcessor$0,tagInfo))
{
do
{
if(tagContext.doBefore())
{
writer.write("\r");
writer.write("\n");
writer.write("    <meta name=\"referrer\" content=\"always\">\r");
writer.write("\n");
writer.write("    <meta name=\"renderer\" content=\"webkit\">\r");
writer.write("\n");
writer.write("    ");
writer.write("<title");
writer.write(">");
writer.write(DataConvert.toString(ElElement.getValue("language.getWord(\'系统标题\')",context,25)));
writer.write("</title>");
writer.write("\r");
writer.write("\n");
writer.write("    <style type=\"text/css\">\r");
writer.write("\n");
writer.write("        html, body {\r");
writer.write("\n");
writer.write("            margin: 0;\r");
writer.write("\n");
writer.write("            padding: 0;\r");
writer.write("\n");
writer.write("            border: 0 none;\r");
writer.write("\n");
writer.write("            height: 100%;\r");
writer.write("\n");
writer.write("            overflow: hidden;\r");
writer.write("\n");
writer.write("        }\r");
writer.write("\n");
writer.write("    </style>\r");
writer.write("\n");
writer.write("    ");
tagInfo = new TagInfo();
tagInfo.setTagName("script");
tagInfo.setLine(35);
tagInfo.setHasEndTag(true);
tagInfo.setHasEndSymbol(false);
tagInfo.addAttribute(new TagAttribute("type",null,new AttributeValue(new AttributeItem("text/javascript",false))));
tagInfo.addAttribute(new TagAttribute("src",null,new AttributeValue(new AttributeItem("net.cyan.arachne.RequestContext.getContext().transformUrl(\'/im/im.js\')",true))));
TagProcessor scriptTagProcessor$0 = new net.cyan.proteus.base.ScriptTagProcessor();
if(tagContext.doStart(scriptTagProcessor$0,tagInfo))
{
do
{
if(tagContext.doBefore())
{
tagContext.doAfter();
}
}while(tagContext.doEnd());
}
writer.write("\r");
tagInfo = new TagInfo();
tagInfo.setTagName("script");
tagInfo.setLine(36);
tagInfo.setHasEndTag(true);
tagInfo.setHasEndSymbol(false);
tagInfo.setTagBefore(true);
tagInfo.addAttribute(new TagAttribute("type",null,new AttributeValue(new AttributeItem("text/javascript",false))));
tagInfo.addAttribute(new TagAttribute("src",null,new AttributeValue(new AttributeItem("net.cyan.arachne.RequestContext.getContext().transformUrl(\'/oa/main.js\')",true))));
TagProcessor scriptTagProcessor$1 = new net.cyan.proteus.base.ScriptTagProcessor();
if(tagContext.doStart(scriptTagProcessor$1,tagInfo))
{
do
{
if(tagContext.doBefore())
{
tagContext.doAfter();
}
}while(tagContext.doEnd());
}
writer.write("\r");
tagInfo = new TagInfo();
tagInfo.setTagName("script");
tagInfo.setLine(37);
tagInfo.setHasEndTag(true);
tagInfo.setHasEndSymbol(false);
tagInfo.setTagBefore(true);
tagInfo.addAttribute(new TagAttribute("type",null,new AttributeValue(new AttributeItem("text/javascript",false))));
tagInfo.addAttribute(new TagAttribute("src",null,new AttributeValue(new AttributeItem("net.cyan.arachne.RequestContext.getContext().transformUrl(\'/platform/commons/image.js\')",true))));
TagProcessor scriptTagProcessor$2 = new net.cyan.proteus.base.ScriptTagProcessor();
if(tagContext.doStart(scriptTagProcessor$2,tagInfo))
{
do
{
if(tagContext.doBefore())
{
tagContext.doAfter();
}
}while(tagContext.doEnd());
}
writer.write("\r");
tagContext.doAfter();
}
}while(tagContext.doEnd());
}
writer.write("\r");
writer.write("\n");
writer.write("<body>\r");
writer.write("\n");
writer.write("\r");
writer.write("\n");
writer.write("<iframe id=\"mainFrame\" frameborder=\"0\" style=\"width:100%;height:100%\"></iframe>\r");
writer.write("\n");
writer.write("</body>\r");
tagInfo = new TagInfo();
tagInfo.setTagName("script");
tagInfo.setLine(44);
tagInfo.setHasEndTag(true);
tagInfo.setHasEndSymbol(false);
tagInfo.addAttribute(new TagAttribute("type",null,new AttributeValue(new AttributeItem("text/javascript",false))));
TagProcessor scriptTagProcessor$3 = new net.cyan.proteus.base.ScriptTagProcessor();
if(tagContext.doStart(scriptTagProcessor$3,tagInfo))
{
do
{
if(tagContext.doBefore())
{
writer.write("\r");
writer.write("\n");
writer.write("    var mainFrame = Cyan.$(\"mainFrame\");\r");
writer.write("\n");
writer.write("    mainFrame.style.height =\r");
writer.write("\n");
writer.write("        (Cyan.navigator.isOpera() ? document.body.clientHeight : document.documentElement.clientHeight) + \"px\";\r");
writer.write("\n");
writer.write("    mainFrame.src = Cyan.transformUrl(\r");
writer.write("\n");
writer.write("        \"");
writer.write(DataConvert.toString(ElElement.getValue("request[\'style.path\']",context,49)));
writer.write("/main.ptl?desktop=desktop&groupId=desktop&menuId=");
writer.write(DataConvert.toString(ElElement.getValue("request.parameter.menuId",context,49)));
writer.write("\" +\r");
writer.write("\n");
writer.write("            \"&toPath=");
writer.write(DataConvert.toString(ElElement.getValue("request.parameter.toPath",context,50)));
writer.write("\");\r");
tagContext.doAfter();
}
}while(tagContext.doEnd());
}
writer.write("\r");
tagContext.doAfter();
}
}while(tagContext.doEnd());
}

    }
    public void process(TemplateContext context,String name)throws Exception
    {
         context.callAnonymousMethod(this,name);
    }

}