index_005fhead_jsp.java 11.5 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.day.crx.CRXRepository
 *  com.day.crx.License
 *  com.day.crx.i18n.Dictionary
 *  javax.jcr.Repository
 *  javax.jcr.Session
 *  javax.jcr.Workspace
 *  javax.servlet.Servlet
 *  javax.servlet.ServletConfig
 *  javax.servlet.ServletContext
 *  javax.servlet.ServletException
 *  javax.servlet.ServletRequest
 *  javax.servlet.ServletResponse
 *  javax.servlet.http.HttpServletRequest
 *  javax.servlet.http.HttpServletResponse
 *  javax.servlet.jsp.JspFactory
 *  javax.servlet.jsp.JspWriter
 *  javax.servlet.jsp.PageContext
 *  javax.servlet.jsp.SkipPageException
 *  org.apache.commons.lang3.StringEscapeUtils
 *  org.apache.jasper.runtime.HttpJspBase
 *  org.apache.jasper.runtime.JspSourceDependent
 */
package com.day.crx.explorer.impl.jsp;

import com.day.crx.CRXRepository;
import com.day.crx.License;
import com.day.crx.explorer.impl.j2ee.CRXContext;
import com.day.crx.explorer.impl.j2ee.JCRExplorerServlet;
import com.day.crx.explorer.impl.ui.NodeBrowse;
import com.day.crx.i18n.Dictionary;
import java.io.IOException;
import java.util.List;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.Workspace;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.SkipPageException;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.jasper.runtime.HttpJspBase;
import org.apache.jasper.runtime.JspSourceDependent;

public final class index_005fhead_jsp
extends HttpJspBase
implements JspSourceDependent {
    private static List _jspx_dependants;

    public Object getDependants() {
        return _jspx_dependants;
    }

    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        JspWriter out = null;
        JspWriter _jspx_out = null;
        PageContext _jspx_page_context = null;
        try {
            try {
                Session repSession;
                String pageName;
                Dictionary dict;
                String docroot;
                boolean licensed;
                CRXContext ctx;
                _jspxFactory = JspFactory.getDefaultFactory();
                response.setContentType("text/html");
                _jspx_page_context = pageContext = _jspxFactory.getPageContext((Servlet)this, (ServletRequest)request, (ServletResponse)response, null, false, 8192, true);
                pageContext.getServletContext();
                pageContext.getServletConfig();
                _jspx_out = out = pageContext.getOut();
                response.setContentType("text/html; charset=utf-8");
                pageName = (String)request.getAttribute("crx.explorer.pageName");
                ctx = null;
                repSession = null;
                try {
                    ctx = CRXContext.getInstance(pageContext, request);
                    dict = ctx.getCurrentDictionary();
                    docroot = ctx.getDocroot();
                    pageName = (String)request.getAttribute("crx.explorer.pageName");
                    repSession = ctx.getSession();
                }
                catch (Exception v0) {
                    dict = Dictionary.getCurrent();
                    docroot = JCRExplorerServlet.getDocrootPrefix(request);
                }
                licensed = true;
                if (ctx != null && ctx.getRepository() instanceof CRXRepository) {
                    try {
                        licensed = ((CRXRepository)ctx.getRepository()).getLicense() != null;
                    }
                    catch (Exception v1) {}
                }
                String usersPath = ctx.getUsersPath();
                String groupsPath = ctx.getGroupsPath();
                out.write("<head>\n    <title>");
                out.print(dict.fmt("crex.crx_0.tit", (Object)JCRExplorerServlet.getProductVersion()));
                out.write("</title>\n    <script type=\"text/javascript\" src=\"");
                out.print(docroot);
                out.write("/crx_main_files/admin.js\"></script>\n    <script type=\"text/javascript\" src=\"");
                out.print(docroot);
                out.write("/ui/util.js\"></script>\n    <link href=\"");
                out.print(docroot);
                out.write("/crx_main_files/admin.css\" type=\"text/css\" rel=\"stylesheet\">\n    <script type=\"text/javascript\">\n        function openBrowser() {\n            var win = window.open(\"browser/index.jsp\", \"browser_window\", \"menubar=no,resizable=yes,status=yes\");\n                win.focus();\n        }\n\n        function openNTAdmin() {\n            var win = window.open(\"nodetypes/index.jsp\", \"ntadmin_window\", \"menubar=no,resizable=yes,status=yes\");\n            win.focus();\n        }\n\n        function openUserAdmin() {\n            var uri = \"");
                out.print(docroot);
                out.write("/ui/usereditor.jsp\";\n            uri+= \"?ck=\" + new Date().valueOf();\n            uri+= \"&Path=\" + escape(\"");
                out.print(usersPath);
                out.write("\");\n            var win = window.open(uri, \"userAdministration\" , \"scroll=yes, height=550, width=690, resizable=no, status=no\");\n            win.focus();\n        }\n        function openGroupAdmin() {\n            var uri = \"");
                out.print(docroot);
                out.write("/ui/usereditor.jsp\";\n            uri+= \"?ck=\" + new Date().valueOf();\n            uri+= \"&Path=\" + escape(\"");
                out.print(groupsPath);
                out.write("\");\n            var win = window.open(uri, \"groupAdministration\" , \"scroll=yes, height=550, width=690, resizable=no, status=no\");\n            win.focus();\n        }\n\n        function openPrincipalAdmin() {\n            var uri = \"");
                out.print(docroot);
                out.write("/ui/principal_administration.jsp\";\n            uri+= \"?ck=\" + new Date().valueOf();\n            var win = window.open(uri, \"principalAdministration\" , \"scroll=yes, height=550, width=690, resizable=no, status=no\");\n            win.focus();\n        }\n\n        function openAccessControlEditor() {\n            var uri = \"");
                out.print(docroot);
                out.write("/ui/aceditor.jsp\";\n            uri+= \"?ck=\" + new Date().valueOf();\n            uri+= \"&Path=/\";\n            var win = window.open(uri, \"acEditor\" , \"scroll=yes, height=910, width=800, resizable=yes, status=no\");\n            win.focus();\n        }\n    </script>\n");
                String head_userId = repSession == null ? null : repSession.getUserID();
                String wspName = repSession == null ? "--not logged in--" : repSession.getWorkspace().getName();
                NodeBrowse.init(pageContext);
                out.write("</head>\n<body>\n<center>\n<table id=maintable cellSpacing=0 cellPadding=0 align=center border=0>\n  <tbody>\n  <tr>\n    <td class=toolcell colSpan=2>&nbsp;&nbsp;<A href=\"http://www.adobe.com/\" target=_blank>www.adobe.com</A>&nbsp;&nbsp; </td></tr>\n  <tr>\n    <td class=bannercell colspan=2><SPAN class=leadcelltext>");
                out.print(dict.fmt("crex.crx_0.tit", (Object)JCRExplorerServlet.getProductVersion()));
                out.write("<br>");
                out.print(dict.msg("crex.crx.des"));
                out.write("</SPAN></TD>\n  <tr>\n    <td id=technavcell colSpan=2>\n      <div id=technav>\n      ");
                if (pageName.equals("main")) {
                    out.write("<span class=\"technavat\">");
                    out.print(dict.msg("crex.main_console.lab"));
                    out.write("</span>");
                } else {
                    out.write("<a href=\"");
                    out.print(docroot);
                    out.write("/index.jsp\">");
                    out.print(dict.msg("crex.main_console.lab"));
                    out.write("</a>");
                }
                if (pageName.equals("config")) {
                    out.write("<span class=\"technavat\">");
                    out.print(dict.msg("crex.rep_config.lab"));
                    out.write("</span>");
                } else {
                    out.write("<a href=\"");
                    out.print(docroot);
                    out.write("/config/index.jsp\">");
                    out.print(dict.msg("crex.rep_config.lab"));
                    out.write("</a>");
                }
                out.write("</DIV></TD></TR>\n  <TR>\n    <TD class=techcontentcell valign=top>\n        ");
                if (!licensed) {
                    out.write("<b style=\"color: red\"><br/>No valid CRX license configured. Check config of License Module or click <a href=\"");
                    out.print(docroot);
                    out.write("/apps/crx-launchpad/license.jsp?\">here</a> to enter serial number.</b><br/>");
                }
                out.write("<table class=content cellSpacing=0 cellPadding=0>\n        <tbody>\n        ");
                if (ctx != null) {
                    out.write("<TR class=content>\n              <TH class=content colSpan=2>");
                    out.print(dict.fmt("crex.userid_0.lab", (Object)StringEscapeUtils.escapeHtml4((String)head_userId)));
                    out.write(32);
                    out.write(124);
                    out.write(32);
                    out.print(dict.fmt("crex.workspace_0.lab", (Object)StringEscapeUtils.escapeHtml4((String)wspName)));
                    if ("anonymous".equals(head_userId) || head_userId == null) {
                        out.write("\n        | <a href=\"");
                        out.print(docroot);
                        out.write("/login.jsp\">");
                        out.print(dict.msg("crex.login.btn"));
                        out.write("</a>\n\t");
                    } else {
                        out.write("\n\t| <a href=\"");
                        out.print(docroot);
                        out.write("/logout.jsp\">");
                        out.print(dict.msg("crex.logout.btn"));
                        out.write("</a>\n        | <a href=\"");
                        out.print(docroot);
                        out.write("/login.jsp\">");
                        out.print(dict.msg("crex.switch_workspace.btn"));
                        out.write("</a>\n        | <a href=\"");
                        out.print(docroot);
                        out.write("/impersonate.jsp\">Impersonate</a>\n\t");
                    }
                    out.write("</TH></TR>");
                }
            }
            catch (Throwable t) {
                if (!(t instanceof SkipPageException)) {
                    out = _jspx_out;
                    if (out != null && out.getBufferSize() != 0) {
                        out.clearBuffer();
                    }
                    if (_jspx_page_context != null) {
                        _jspx_page_context.handlePageException(t);
                    }
                }
            }
        }
        finally {
            if (_jspxFactory != null) {
                _jspxFactory.releasePageContext(_jspx_page_context);
            }
        }
    }
}