缓慢打开';视图面板';(Xpages)

缓慢打开';视图面板';(Xpages),xpages,lotus-notes,Xpages,Lotus Notes,我在加载viewPanel时遇到了一个草率的问题,页面打开了,但看起来数据源正在一次加载所有文档,此时尝试打开列出的文档需要很长时间。您能告诉我是否可以限制数据源加载的文档数量吗?提高绩效 <?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom" xmlns:xe="http://w

我在加载viewPanel时遇到了一个草率的问题,页面打开了,但看起来数据源正在一次加载所有文档,此时尝试打开列出的文档需要很长时间。您能告诉我是否可以限制数据源加载的文档数量吗?提高绩效

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xc="http://www.ibm.com/xsp/custom"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xp:this.data>
    <xp:dominoView var="viewProposta" keysExactMatch="true"
        dataCache="nodata">

        <xp:this.categoryFilter><![CDATA[#{javascript:var filtro=[];
                if(viewScope.statusVoltar!=null){
                    viewScope.status=viewScope.statusVoltar;
                    sessionScope.remove("statusVoltar");
                } 
                if(compositeData.filtraUsuario){
                    filtro.push(sessionScope.usuarioLogado.nome);
                }
                if(compositeData.filtraEntidade){
                    filtro.push(sessionScope.usuarioLogado.fk_entidade_funcional);
                }
                return filtro.join("\\");}]]>
        </xp:this.categoryFilter>

        <xp:this.viewName><![CDATA[#{javascript:if(!viewScope.minhasPendencias ){   
            if(compositeData.filtraEntidade){
                switch(viewScope.status) {
                    case "Solicitado":
                        var vw = "vw_parecer_solicitado_entidade"
                        break;
                    ...
                }
            }
            if(compositeData.filtraUsuario){
                switch(viewScope.status) {
                    case "Solicitado":
                        var vw = "vw_parecer_solicitado_usuario"
                        break;
                    ....
                    }
                }
            }else
            var vw= "vw_parecer_minhas_pendencias";

            return vw;}]]>
        </xp:this.viewName>
    </xp:dominoView>

</xp:this.data>


<xp:viewPanel value="#{viewProposta}" rows="20" id="viewPanel1"
    pageName="/xsp_parecer.xsp" viewStyleClass="bloco" var="doc">

    <xp:viewColumn columnName="ds_status" id="viewColumn8"
        style="">
        <xp:this.facets>
            <xp:viewColumnHeader value="" xp:key="header"
                id="viewColumnHeader8" style="text-align:center">
            </xp:viewColumnHeader>
        </xp:this.facets>
        <xp:this.rendered><![CDATA[#{javascript:viewScope.statusVector.length>0}]]></xp:this.rendered>
    </xp:viewColumn>


    <xp:viewColumn columnName="ds_parecer" displayAs="link"
        style="width:18.0%">
        <xp:this.openDocAsReadonly><![CDATA[#{javascript:var valores:java.util.Vector =doc.getDocument().getItemValue("no_destinatarios");
            valores.addAll(doc.getDocument().getItemValue("no_emitente"));
            return !valores.contains(sessionScope.usuarioLogado.nome);}]]></xp:this.openDocAsReadonly>
        <xp:viewColumnHeader style="text-align:center"
            value="Ds_parecer">
        </xp:viewColumnHeader>

        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete">
            <xp:this.action>
                <xp:actionGroup>
                    <xp:executeScript>
                        <xp:this.script><![CDATA[#{javascript:if(compositeData.filtraEntidade)
                                return sessionScope.retornarPara="/xsp_lista_propostas_unidade.xsp";
                            else
                                return sessionScope.retornarPara="/xsp_lista_propostas.xsp";}]]>
                        </xp:this.script>
                    </xp:executeScript>
                    <xp:openPage target="editDocument"
                        documentId="#{javascript:doc.getDocument().getUniversalID()}">
                        <xp:this.name><![CDATA[#{javascript:return "/xsp_"+doc.getDocument().getItemValueString("form").split("_")[1]+".xsp"}]]></xp:this.name>
                    </xp:openPage>
                </xp:actionGroup>
            </xp:this.action>
        </xp:eventHandler>

    </xp:viewColumn>

    <xp:viewColumn id="viewColumn2" style="width:13%">
        <xp:this.value><![CDATA[#{javascript:
        if(!doc.isCategory()){
            var fk=doc.getDocument().getItemValueString("fk_proposta");
            if(fk == null || fk == "")
                fk = doc.getDocument().getItemValueString("fk_proposta_aux");
            return @DbLookup("","vw_proposta_pesquisa",fk,"ds_proposta");}}]]></xp:this.value>
        <xp:viewColumnHeader id="viewColumnHeader2" value="Proposta"
            style="text-align:center">
        </xp:viewColumnHeader>
    </xp:viewColumn>

    <xp:viewColumn columnName="no_processo_adm" id="viewColumn10"
        style="">
        <xp:this.facets>
            <xp:viewColumnHeader value="No_processo_adm"
                xp:key="header" id="viewColumnHeader10"
                style="text-align:center">
            </xp:viewColumnHeader>
        </xp:this.facets>
    </xp:viewColumn>

    <xp:viewColumn columnName="ds_assunto">
        <xp:this.facets>
            <xp:viewColumnHeader value="Ds_assunto" xp:key="header"
                style="text-align:center">
            </xp:viewColumnHeader>
        </xp:this.facets>
    </xp:viewColumn>
    <xp:viewColumn columnName="unidade_solicitante"
        style="width:8%">
        <xp:viewColumnHeader value="Unidade_solicitante"
            style="text-align:center">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="no_remetente" id="viewColumn4"
        style="text-align:left">
        <xp:viewColumnHeader value="No_remetente"
            id="viewColumnHeader4" style="text-align:center">
        </xp:viewColumnHeader>
    </xp:viewColumn>

    <xp:viewColumn columnName="ct_posicao_parecer" id="viewColumn3"
        styleClass="centro">

        <xp:this.rendered><![CDATA[#{javascript:viewScope.status=="Concluído"}]]></xp:this.rendered>
        <xp:viewColumnHeader value="Ct_posicao_parecer"
            id="viewColumnHeader3" style="text-align:center">
        </xp:viewColumnHeader>
    </xp:viewColumn>

    <xp:viewColumn columnName="dt_envio" id="viewColumn5"
        styleClass="centro">
        <xp:this.rendered><![CDATA[#{javascript:viewScope.status!="Concluído"}]]></xp:this.rendered>
        <xp:viewColumnHeader value="Dt_envio" id="viewColumnHeader5"
            style="text-align:center">
        </xp:viewColumnHeader>
    </xp:viewColumn>

    <xp:viewColumn columnName="dt_conclusao" id="viewColumn1"
        styleClass="centro">

        <xp:this.rendered><![CDATA[#{javascript:viewScope.status=="Concluído"}]]></xp:this.rendered>
        <xp:viewColumnHeader value="Dt_conclusao"
            id="viewColumnHeader1" style="text-align:center">
        </xp:viewColumnHeader>
    </xp:viewColumn>

    <xp:viewColumn id="viewColumn7" rendered="false">
        <xp:this.value><![CDATA[#{javascript:return ""}]]></xp:this.value>
        <xp:button value="Remover" id="killdoc">
            <xp:eventHandler event="onclick" submit="true"
                refreshMode="partial" refreshId="viewPanel1" id="eventHandler1">

                <xp:this.script>
                    <xp:executeClientScript>
                        <xp:this.script><![CDATA[return window.confirm("Confirma a exclusão?")]]></xp:this.script>
                    </xp:executeClientScript>
                </xp:this.script>

                <xp:this.action><![CDATA[#{javascript:var d:NotesDocument=doc.getDocument();
                    apagarProposta(d);}]]>
                </xp:this.action>
            </xp:eventHandler>
        </xp:button>
        <xp:viewColumnHeader value="" id="viewColumnHeader7"
            rendered="false">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:this.facets>
        <xp:pager partialRefresh="true" xp:key="headerPager"
            id="pager1" rendered="true" layout="Previous Group Next">
        </xp:pager>
        <xp:pager partialRefresh="true" layout="Previous Group Next"
            xp:key="footerPager" id="pager2">
        </xp:pager>

    </xp:this.facets>
</xp:viewPanel>


加载的文档数取决于定义的行数。ViewNavigator功能经过优化,仅显示当前页面以及其他页面的视图

例外情况是,如果寻呼机已将
alwayscalculatellast
设置为
true
。如果是这样,它需要遍历整个视图,以计算出它需要显示为最后一个视图的页码。

您的viewPanel中有一些非常“昂贵”的东西,如

  • @数据库查找
  • doc.getDocument().getItemValueString(…)
  • doc.getDocument().getItemValue(…)
试着摆脱他们

如果访问参考底图文档中的字段,则会导致性能下降。在视图列中包含所有需要的数据要好得多


更糟糕的是@DbLookup。它为视图中的每一行执行对另一个视图的调用。尝试从按钮或鼠标上方调用@DbLookup。

您是否能够共享您目前拥有的代码片段?我注意到您使用了
dataCache=“nodata”
它指示页面在每次新的POST操作发生时从头开始重建视图数据-这可能是您在打开列出的文档时性能不佳的罪魁祸首,或者至少是它与第一次加载视图一样慢的原因,假设我正确理解您的意思。我不知道真正的原因,配置已经是这样了。但我想这会影响文档的加载。您能告诉我,如果加载一个包含一千多个文档的视图,那么在访问该视图时是否会加载所有内容?如果更改此缓存设置可以提高性能?您正在运行哪个IBM Domino版本以及您设置了哪些应用程序xsp属性?@shillem version 8.5.3 xsp属性:xsp.ajax.renderwholetree=true xsp.application.forcelRefresh=true xsp.application.timeout=90 xsp.compress.mode=gzip nolength xsp.error.page=error.xspxsp.error.page.default=true xsp.library.dependens=com.ibm.xsp.extlib.library xsp.min.version=8.5.3 xsp.partial.update.timeout=120 xsp.persistence.mode=basic xsp.persistence.tree.maxviews=16 xsp.redirect=false xsp.resources.aggregate=true xsp.session.timeout=90 xsp.theme=titlepage.xsp.theme.mobile.pagePrefix=m(如果此属性为空)。标记为false是否有趣?不,默认值为false