Orbeon 4 tab loading

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Orbeon 4 tab loading

blabla
We migrated my Orbeon to Version 4.2 and had this problem that we previously did not had before when using the old version. After login using an username, the tabs did not shown in the page, it only show after refreshed the page. We did not had this problem using orbeon 3.9 and older version of orbeon. We unable to find the source of this problem and the solutions for it, suspect it might cause by the sessions. Please help with this problem.

Thanks

basically we use web-inf/web.xml to control who can access the url, code as below :

<security-constraint>
        <web-resource-collection>
            <web-resource-name>UIS Protected Resources</web-resource-name>
            <url-pattern>/uis-welcome/login/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>registered</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/uis-authentication/login</form-login-page>
            <form-error-page>/uis-authentication/login-error</form-error-page>
        </form-login-config>
    </login-config>
    <security-role>
        <role-name>registered</role-name>
    </security-role>


and we filter user access at config/theme.xsl file, code as follow :


<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    xmlns:xh="http://www.w3.org/1999/xhtml"
    xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:version="java:org.orbeon.oxf.common.Version">

    <xsl:import href="theme-plain.xsl"/>

   
    <xsl:variable name="request" select="doc('input:request')" as="document-node()"/>
    <xsl:variable name="session" select="doc('input:session')" as="document-node()"/>
    <xsl:variable name="current-user-role" select="$session/users/user/user_role" as="xs:string"/>
    <xsl:variable name="current-user-agent" select="$request/*/headers/header[name='user-agent']/value" as="xs:string"/>

   
    <xsl:variable name="applications-welcome" select="doc('/ubd_gen_next_degrees-apps-list-welcome.xml')" as="document-node()"/>
    <xsl:variable name="applications-student" select="doc('/ubd_gen_next_degrees-apps-list-student.xml')" as="document-node()"/>
    <xsl:variable name="applications-admission-staff" select="doc('/ubd_gen_next_degrees-apps-list-admission-staff.xml')" as="document-node()"/>

   
    <xsl:variable name="current-application-id" select="tokenize(doc('input:request')/*/request-path, '/')[4]" as="xs:string"/>
    <xsl:variable name="current-category-id" select="tokenize(doc('input:request')/*/request-path, '/')[3]" as="xs:string"/>
    <xsl:variable name="current-section-id" select="tokenize(doc('input:request')/*/request-path, '/')[2]" as="xs:string"/>

   
    <xsl:variable name="title" select="if (/xh:html/xh:head/xh:title != '')
                                       then /xh:html/xh:head/xh:title
                                       else if (/xh:html/xh:body/xh:h1)
                                            then (/xh:html/xh:body/xh:h1)[1]
                                            else '[Untitled]'" as="xs:string"/>

    <xsl:template match="xh:head">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
            <xh:link rel="stylesheet" href="/fr/style/bootstrap_all/css/bootstrap.css" type="text/css"/>
            <xh:link rel="stylesheet" href="/fr/style/form-runner-bootstrap-override.css" type="text/css"/>
            <xh:link rel="stylesheet" href="/config/theme-staff/examples.css" type="text/css" media="all"/>
            <xh:link rel="stylesheet" href="/fr/style/menu_style.css" type="text/css" />
            <xh:link rel="shortcut icon" href="/ops/images/orbeon-icon-16.ico"/>
            <xh:link rel="icon" href="/ops/images/orbeon-icon-16.png" type="image/png"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="xh:body">
        <xsl:copy>
            <xsl:apply-templates select="@* except @class"/>
            <xsl:attribute name="class" select="string-join(('orbeon', @class), ' ')"/>
            <xh:div class="container">
                <xh:div align="right">
                <xsl:value-of select="string($request/*/remote-user)"/>
                <xsl:choose>
                <xsl:when test="string-length(string($request/*/remote-user)) = 0">
                     | <xh:a href="/uis-welcome/login/">Login</xh:a>
                </xsl:when>
                <xsl:otherwise>
                     | <xh:a href="/uis-authentication/logout?global=true">Logout</xh:a>
                </xsl:otherwise>
                </xsl:choose>
                </xh:div>

                <xh:ul id="nav">

                    <xsl:for-each select="$applications-welcome/*/section">

                        <xsl:variable name="main-selected" as="xs:boolean" select="@sid = $current-section-id"/>

                        <xh:li class="{if ($main-selected) then 'current' else ''}">
                            <xh:a href="#"><xsl:value-of select="@label"/></xh:a>
                            <xh:ul>
                                <xsl:for-each select="./category">
                                    <xh:li>
                                        <xh:a href="#"><xsl:value-of select="@label"/></xh:a>
                                        <xh:ul>
                                            <xsl:for-each select="./application">
                                                <xh:li><xh:a href="/{@sid}/{@id}/"><xsl:value-of select="@label"/></xh:a></xh:li>
                                            </xsl:for-each>
                                        </xh:ul>
                                    </xh:li>
                                </xsl:for-each>
                            </xh:ul>                           
                        </xh:li>

                    </xsl:for-each>

                    <xsl:for-each select="$session/users/user">

                        <xsl:if test="matches(.,'student')">

                            <xsl:for-each select="$applications-student/*/section">

                                <xsl:variable name="main-selected" as="xs:boolean" select="@sid = $current-section-id"/>

                                <xh:li class="{if ($main-selected) then 'current' else ''}">
                                    <xh:a href="#"><xsl:value-of select="@label"/></xh:a>
                                    <xh:ul>
                                        <xsl:for-each select="./category">
                                            <xh:li>
                                                <xh:a href="#"><xsl:value-of select="@label"/></xh:a>
                                                <xh:ul>
                                                    <xsl:for-each select="./application">
                                                        <xh:li><xh:a href="/{@sid}/{@id}/"><xsl:value-of select="@label"/></xh:a></xh:li>
                                                    </xsl:for-each>
                                                </xh:ul>
                                            </xh:li>
                                        </xsl:for-each>
                                    </xh:ul>                           
                                </xh:li>

                            </xsl:for-each>

                        </xsl:if>

                        <xsl:if test="matches(.,'admission-staff')">

                            <xsl:for-each select="$applications-admission-staff/*/section">

                                <xsl:variable name="main-selected" as="xs:boolean" select="@sid = $current-section-id"/>

                                <xh:li class="{if ($main-selected) then 'current' else ''}">
                                    <xh:a href="#"><xsl:value-of select="@label"/></xh:a>
                                    <xh:ul>
                                        <xsl:for-each select="./category">
                                            <xh:li>
                                                <xh:a href="#"><xsl:value-of select="@label"/></xh:a>
                                                <xh:ul>
                                                    <xsl:for-each select="./application">
                                                        <xh:li><xh:a href="/{@sid}/{@id}/"><xsl:value-of select="@label"/></xh:a></xh:li>
                                                    </xsl:for-each>
                                                </xh:ul>
                                            </xh:li>
                                        </xsl:for-each>
                                    </xh:ul>                           
                                </xh:li>

                            </xsl:for-each>

                        </xsl:if>

                    </xsl:for-each>                     

                </xh:ul>

                <xsl:apply-templates select="node()"/>
            </xh:div>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

when we tried to debug from the epilogue-servlet.xpl:
    <p:processor name="oxf:scope-generator">
        <p:input name="config">
            <config>
                <key>requserdata</key>
                <scope>session</scope>
                <session-scope>application</session-scope>
            </config>
        </p:input>
        <p:output name="data" debug="true" id="session"/>
    </p:processor>
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 4 tab loading

Erik Bruchez
Administrator
I followed-up on StackOverflow:

http://stackoverflow.com/questions/18371045/orbeon-4-tab-loading-issue?noredirect=1#comment27014058_18371045

Bottom line is that there is not enough information to answer.

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 4 tab loading

blabla
I had added in more information on the post in

http://stackoverflow.com/questions/18371045/orbeon-4-tab-loading-issue?noredirect=1#comment27014058_18371045

feel free to ask if need more information.
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 4 tab loading

Alessandro  Vernet
Administrator
I see you're using the oxf:scope-generator to read the value for key "requserdata" from the session. Where is this value stored? I don't see this being done in any of the code you quote there, but it must obviously happen, otherwise it would never work.

Could the write happen after the read, instead of before as it should? This would explain why it works the second and subsequent times, but not the first time.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet