<%@ include file="inc/dynamic_content_core_top.jsp"  %>
<%@ page extends="oneit.servlets.jsp.FormJSP" %>

<%@ include file="/inc/stdimports50.jsp" %>

<%
    ORMProcessState     process             = (ORMProcessState)(ProcessDecorator.getDefaultProcess(request));
    ObjectTransaction   objTran             = (process == null ? ObjectTransaction.getTransaction () : process.getTransaction ());
    Article             applicantArticle    = PerformaArticleUtil.getArticleByShortCut(objTran, PerformaArticleUtil.APPLICANT_PORTAL);
    Article             adminArticle        = PerformaArticleUtil.getArticleByShortCut(objTran, PerformaArticleUtil.ADMIN_PORTAL);
    SecUser             loggedInUser        = SecUser.getTXUser(objTran);
    OAuthUserExtension  userEx              = (loggedInUser != null ? loggedInUser.getExtension(OAuthUserExtension.REFERENCE_OAuthUserExtension) : null);
    String              portalName          = PerformaArticleUtil.getPortalName(objTran, article, applicantArticle, adminArticle);
%>

<%@ include file="setuprequest.jsp" %>

<%
    if(CollectionUtils.equals(portalName, PerformaArticleUtil.ADMIN_PORTAL))
    {
%>
        <%@ include file="extensions/adminportal/inc/htmlheader.jsp" %>
        <%@ include file="extensions/adminportal/inc/menuinclude.jsp" %>
<%
    }
    else if(CollectionUtils.equals(portalName, PerformaArticleUtil.APPLICANT_PORTAL))
    {
%>
        <%@ include file="extensions/applicantportal/inc/htmlheader.jsp" %>
        <%@ include file="extensions/applicantportal/inc/menuinclude.jsp" %>
<%
    }

    String renderMode = CMSArticleTagDecorator.getRenderMode (request, "Page");

    Map m = CollectionUtils.mapEntry(NavigationBarDF.NAV_BAR, navbar.getChildNavBarFor (article))
                           .mapEntry("StartLevel", new Integer (0))
                           .mapEntry("EndLevel", new Integer (0))
                           .mapEntry("RenderMode", renderMode).toMap();
%>
    <oneit:dynInclude page="descendPageContent.jsp" data="<%= m %>"/> 
<%
    if(CollectionUtils.equals(portalName, PerformaArticleUtil.ADMIN_PORTAL))
    {
        %><%@ include file="extensions/adminportal/inc/htmlfooter.jsp" %><%
    }
    else if(CollectionUtils.equals(portalName, PerformaArticleUtil.APPLICANT_PORTAL))
    {
        %><%@ include file="extensions/applicantportal/inc/htmlfooter.jsp" %><%
    }
%>