Topic
11 replies Latest Post - ‏2013-01-11T11:11:37Z by SystemAdmin
MuraliK,Meduri
MuraliK,Meduri
50 Posts
ACCEPTED ANSWER

Pinned topic Can we replace the startup .html which we get when we create project in WLS

‏2012-11-15T20:07:16Z |
Hi Team
Need a small information on how to replace the startup .html file in Worklight studio which will get created commonly for all environmens under the commons folder.

Suppose i created a projet ABC, then i get ABC.html file under commons folder, but i wanted to replace it with my own .html file which i got from some where.

I did like this.
1) opend the application config.xml, and replaced the startup html file name there
and pasted my own html files under the commons foder and deleted the existing one. (i kept the WL imports and its related code as it is in my new file too)

But when i try to build it, its throwing the exception. Please help me in how to do it
  • MuraliK,Meduri
    MuraliK,Meduri
    50 Posts
    ACCEPTED ANSWER

    Re: Can we replace the startup .html which we get when we create project in WLS

    ‏2012-11-16T10:56:33Z  in response to MuraliK,Meduri
    Can any one please respond to this query, we need it ASAP please
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Can we replace the startup .html which we get when we create project in WLS

      ‏2012-11-16T16:03:11Z  in response to MuraliK,Meduri
      What's wrong with copying the contents of the new html file into the one Worklight generates for you using the application name? (I'm mostly just curious about the use case)

      I did the following:
      • New WL Project (wlproj)
      • New WL Application (appname)
      • Change appname/common/appname.html to appname/common/abc.html
      • Open application-descriptor.xml
      • Change:
      
      <mainFile>appname.html</mainFile>
      

      • To:
      
      <mainFile>abc.html</mainFile>
      

      • Create an Android and iPhone Environment
      • Build all and Deploy
      • Open Xcode > search for: worklight.plist > wlMainFile is abc.html > Run > works
      • Open Android Native Project folder > assets > www > skinLoader.html > ctrl+f > "abc.html" > found it > Run > works

      If you have issues, try removing your environments and adding them after you make the changes under common.
      • SystemAdmin
        SystemAdmin
        2327 Posts
        ACCEPTED ANSWER

        Re: Can we replace the startup .html which we get when we create project in WLS

        ‏2012-11-19T13:39:58Z  in response to SystemAdmin
        I tried the approach, but it does not work me ... :(
        • SystemAdmin
          SystemAdmin
          2327 Posts
          ACCEPTED ANSWER

          Re: Can we replace the startup .html which we get when we create project in WLS

          ‏2012-11-19T13:53:29Z  in response to SystemAdmin
          What kind of error/exception behavior are you seeing?
          • SystemAdmin
            SystemAdmin
            2327 Posts
            ACCEPTED ANSWER

            Re: Can we replace the startup .html which we get when we create project in WLS

            ‏2012-11-20T06:07:40Z  in response to SystemAdmin
            I created a worklight project
            I have the appname Sample1/common/Sample1.html
            I had another file with name index.html.
            I copied the same file to coomon folder
            I changed <mainFile>Sample1.html</mainFile> to <mainFile>index.html</mainFile>

            It is unable to build android environment.

            Here is the error
            • SystemAdmin
              SystemAdmin
              2327 Posts
              ACCEPTED ANSWER

              Re: Can we replace the startup .html which we get when we create project in WLS

              ‏2012-11-20T10:36:47Z  in response to SystemAdmin
              Rename the mainfile works for me but if i want to point to another file it did not work for me. Thanks for the help.. rename would also solve my problem.
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Can we replace the startup .html which we get when we create project in WLS

    ‏2012-11-20T11:34:59Z  in response to MuraliK,Meduri
    The main HTML file, and its filename is not visible to users - any particular reason why its name is of great significance?
    Just out of curiosity...

    Other than that, it is important to remember that Worklight is a single-page application.
    If you'd like to use multiple pages, you can use 3rd party solutions such as jQuery Mobile.
    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Can we replace the startup .html which we get when we create project in WLS

      ‏2013-01-11T10:10:55Z  in response to IdanAdar
      Idan, does this mean that you cannot implement a mobile website in the traditional sense e.g.

      mainpage.html --> page2.html

      because there would no longer be a link to the backend? It can only be done by injecting page2.html into the DOM of mainpage.html using something like JQM?
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Can we replace the startup .html which we get when we create project in WLS

    ‏2013-01-11T10:22:37Z  in response to MuraliK,Meduri
    Yes. You'll need to use the pages solution that a 3rd party such as jQuery Mobile offers.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: Can we replace the startup .html which we get when we create project in WLS

      ‏2013-01-11T10:47:12Z  in response to IdanAdar
      Thanks Idan. Do you know if creating traditional paginated mobile sites will be supported by Worklight in the future or will it always be single page apps?
      • SystemAdmin
        SystemAdmin
        2327 Posts
        ACCEPTED ANSWER

        Re: Can we replace the startup .html which we get when we create project in WLS

        ‏2013-01-11T11:11:37Z  in response to SystemAdmin
        Is it possible to trick the platform so that you can navigate to another page, but use all the static properties and .js files from the previous page? Would this be impossible because of the <mainpage> tag in the descriptor which links the page to the platform? The reason I ask is that I want to be able to have separate pages like a normal website.