• The problem of using sample XPages (with Dojo) in another database.

    By zxserg user 1 decade ago

    Hello!

    I want to make some iphone-styled XPages in an old database , I tried to do by instruction in ReadMe.pdf.

    1. I opened old local database in the Designer.

    2. Imported Dojo Mobile 1.5 (dojo-release-1.5.0rc2-src) into dojo15 directory

    3. Copied some Custom Controls and XPages from MobileControlsLite.nsf

    4. After then I tried to preview "ViewAndDocument" XPage in the browser, and get this error:

    The runtime has encountered an unexpected error.

       1: #{javascript: 
       2: var stylesheetUrl = compositeData.stylesheetUrl;
       3: if  ((stylesheetUrl == null) ||(stylesheetUrl == "")) {
       4:    if (org.openntf.util.Directories.externalFilesInstalled()) {
       5:        stylesheetUrl = "/domjs/mobile/themes/iphone/iphone.css";
       6:    }
       7:    else { 
       8:        stylesheetUrl = "dojo15/dojox/mobile/themes/iphone/iphone.css";
       9:    }
      10: }       
    
    after then a wrote in the XPage:
    <xc:mConfiguration
            stylesheetUrl = "dojo15/dojox/mobile/themes/iphone/iphone.css">
        </xc:mConfiguration>
      11: "<link href='" + stylesheetUrl + "' rel='stylesheet'></link>"}
    

    but received this error:

    The runtime has encountered an unexpected error.

      1: #{javascript:
       2: if (org.openntf.util.Directories.externalFilesInstalled()) {
       3:    "<script type='text/javascript' src='/domjs/mobile/dojo.js'></script>";
       4: }
       5: else { 
       6:    "<script type='text/javascript' src='dojocustom/dojo.js'></script>";
       7: }
       8: }
    

    What else should I do in addition to 1)-4) points?

    Thanks in advance.

    • need more info

      By Niklas Heidloff 1 decade ago

      I don't know what's causing your problem. I'd need more info like which Domino version, which mobile controls version, which elements you copied, which browser, etc.

       

      The easiest way is to simply use MobileControlsLite.nsf and point it to your existing nsf, e.g. in the mView control and the document control.

       

      If you want to copy the design elements I'd copy the elements from MobileControlsLite.nsf rather than downloading it from Dojo. You can find the Dojo files and my JavaScript files in certain subfolders like 'dojocustom'. In order to do this you need to use the Package Explorer view or Java perspective. But again, this is harder since I haven't had the time to document this.

      • By Clay Martin 1 decade ago

        I have the same issue using the MobileControlsLite.nsf db.



        Windows/32 8.5.2 server

        Signed and built with 8.5.1 F1 client



        Server log

        HTTP JVM: com.ibm.xsp.webapp.FacesServlet$ExtendedServletException: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression

        • Sort of working...

          By Clay Martin 1 decade ago

          Java Build Path -> Source

          Got it to work by adding as a folder "WebContent/WEB-INF/src"



          Then got an error with 8.5.1 client .getDataDirectory(); is undefined.

          Tried with 8.5.2 works, but i don't think correctly. ie get below.



          GET http:// … server../srzxuq/XPages/MobileControlsLite.nsf/ibm/xsp/widget/layout/nls/xspClientDojo_en-us.jsGET http://..server../srzxuq/XPages/MobileControlsLite.nsf/ibm/xsp/widget/layout/nls/xspClientDojo_en-us.js

          <br/>
          

          200 OK

              64ms    <br/>
          

          dojo.js (line 14)

          ParamsHeadersPostPutResponseCacheHTML



          Could not load 'ibm.xsp.widget.layout.nls.xspClientDojo_en-us'; last tried '../ibm/xsp/widget/layout/nls/xspClientDojo_en-us.js'

          [Break on this error] (function(){var 1=null;if((1||(typeo…etTimeout(dojo._loadInit,100);}})();

          dojo.js (line 14)

          dojo.parser.parse is not a function

          [Break on this error] dojo.parser.parse();

          • comments

            By Niklas Heidloff 1 decade ago

            Not sure why you had to set the build path again since I had done this.

             

            xspClientDojo_en-us can be ignored. Not needed.

             

            Other people ran into the parser.parse issue as well. See other discussion thread for how to fix this. I'm not sure though why some people get this error and others don't.

            • Solved

              By Kateryna Czerniachowska 1 decade ago

              Please open Java Perspective. Check WebContent/WEB-INF catalog, maybe some packages or java-classes are missing. Look into the names of the folders. It is possible that in your project some dojo-folders are missing.

      • Reference other database

        By Tom Weeghmans 1 decade ago

        Niklas,

        Great effort!

        Can you tell me how I have to reference another database? Are there specific security settings that I have to set?

        In the XP:dominoView databaseName attribute I have tried several options like !! but I always get the same  errormessage (see attachment).

        Cheers,

        Tom

         

        • custom property

          By Niklas Heidloff 1 decade ago

          mView and mDocumentContainer have a property 'database'. There you can define the database name (and path) (e.g. names.nsf). Using another server is currently not implemented.

          • Mobile Control DataSource from a different server

            By Tan TS 1 decade ago

            I understand that the mobile controls cannot use a datasource that is coming from a different server where the XPage is residing. This feature is a necessity in our environment where the security policy deem that mobile devices are less secure and requires the Mobile version of the Domino App to be splitted into  2 tier application  with the Data nsf sitting in the Green Zone Domino Server  and the Design (ie mobile control nsf) sitting in the DMZ Domino Server. I hope to use the Mobile control to meet the security poiicy but could not go further as a result of this limitation. I am sure the creator of the mobile control can understand my frustration of trying to exploit the advantage of UI separation  from data capability of XPages from using the mobile control and find that it is not fully achieving this objective when the data is residing on a different server.

             

              

            • comments

              By Niklas Heidloff 1 decade ago

              True, but this would be easy to fix. I just haven't had the time to do it.