2
votes

I am working on a mobile application using XPages. I am trying to speed things up by caching ressources locally on the device. That is not a simple task using the controls in the Extension Library (e.g. I have typeahead on some of the pages).

Therefore, I have decided to build a parallel interface using jQuery Mobile to be able to benchmark the two approaches.

In doing this I would like to handle the ressource for the jQuery Mobile XPage so that I only load the ressources needed, i.e. avoid loading dojo (there is a short guide e.g. on this page: http://dpastov.blogspot.dk/2011/01/trying-to-get-full-control-over-xpage.html). The problem with the solutions I have found is that they are application wide. E.g. setting

xsp.client.script.libraries=none

in xsp.properties will take effect for all of the XPages in the database (including the Ext.lib version of the app.). Following the guide in the "XPages Portable Command Guide", I have tried to set the property for the individual XPage (the jQuery Mobile one) as:

    <?xml version="1.0" encoding="UTF-8"?>
    <xp:view xmlns:xp="http://www.ibm.com/xsp/core" disableTheme="true" createForm="false">
        <xp:this.properties>
            <xp:parameter name="xsp.client.script.libraries" value="none">  
            </xp:parameter>
        </xp:this.properties>

Unfortunately, this does not seem to work.

I know, that I could put the second XPage in a separate database, however, I would like to avoid that since that raises other issues.

Any ideas?

/John

2

2 Answers

4
votes

You can disable the dojo libraries by adding

facesContext.getRequestParameters().setJsLibrary(0);

to beforeRenderResponse or beforePageLoad event of your XPage.

0
votes

using a secondary database for your jQuery design sounds reasonable. What you should do then is load the UI from the secondary database and use ajax calls to (a) ajax/rest control(s) in the primary database. You could also load your UI from resources or classic pages (set to passthru HTML).

Clarification of options (each bullet is a separate approach):

  • use a secondary database (the least desirable)
  • put the initial jQuery UI (sans actual data) into a classic page and load the data using a REST call from a JSON control (from extlib) that sits on an XPage
  • load the initial jQuery UI using an XAgent and proceed using REST/JSON for populating data

Hope that helps