Unable to set up jquery mobile project with worklight 6.1 - ibm-mobilefirst

I am unable to set-up a IBM Worklight project involving jquery-mobile. Here are my environment details:
eclipse Version: Juno Service Release 2 (32-bit version since I am using jre1.6.0_41)
Worklight version: 6.1.0.01
jquery-mobile: 1.3.1
I can create a new worklight project (called MyLab1) and associate jquery-mobile CSS and JS files to it. However the problems are:
The default .html file gets created as index.html (under 'apps->MyLab1->common') while my expectation is it should be MyLab1.html (as per the training material I have from IBM Worklight)
The 'Mobile Navigation' pane is completely blank while my expectation (again as per training material) is I will see a 'page(default)' control there
Whenever I try to create a new control (under 'Mobile Navigation' pane) I get the error 'Mobile Navigation controls cannot be added to the current page. This feature is only enabled for projects which have jQuery Mobile or Dojo mobile available'
I do not see any option (under eclipse menu) to start or stop Worklight sever (that comes with Developer studio version)
I am fairly new to Mobile application development space (just started with IBM worklight set up this week) and given the above issues I believe I may be doing something fundamentally wrong.

Starting Worklight 6.1, it is very much expected for a new application filenames' to be main.js, main.css and index.html.
Additionally, while you can do the adding of jQuery Mobile by yourself, you should instead use the wizard Worklight Studio provides for you.
This way not only will the files you choose be added properly to your project, but the HTML file will be updated accordingly as well (HEAD references, initial jQuery Mobile template in the body element).
The Palette view should then also list the relevant jQuery Mobile widgets you can use in your app.
Please follow the Worklight 6.1 training modules if you intend on using Worklight 6.1.
My impression is that you are reading the Worklight 5.0.x training modules.
To start or stop the Worklight Server, you need to open the Servers view and click either the play or stop buttons.
Use the keyboard shortcut Ctrl+3 and write "server".
Everything works: http://i.stack.imgur.com/K1G8O.png

I found the solution after trying out a few things. It turned out that WL-6.1.x doesn't work well with JRE 6 (32 bit) and eclipse Juno (32 bit) combination. Once I switched to JRE7/Juno-64 bit; things apparently started to work (for now at least).
Thanks Idan for your helpful comments

Related

Worklight Console does not show new changes to project -- seems to use original code

I am running Eclipse Luna 4.4.1 with Worklight Studio 6.2...
I have made changes to my Worklight project. For some reason, I cannot get these changes to be seen/previewed when opening in the Worklight Console...
I have made simple changes such as adding print (console.log) statements to see if these changes are making it out to the console... I have even removed design elements to see if I can get this preview to error out...
Here is what I do:
Highlight the app folder (the folder under the "apps" folder) and right-click
Select Run As > 2 Build All Environments
Once that is complete, I highlight the project folder (the topmost folder in the project) and right-click, selecting Open Worklight Console, which opens the console in Firefox
Click the Preview as Common Resources link in the Console
The "old" code/project runs -- no changes appear
I have tried Cleaning the project, closing and re-opening Eclipse, rebooting my machine, etc. but nothing seems to shake this up. Worklight seems to use the "old" code no matter what I do in Eclipse...
Is there a setting on Worklight I may be missing?
Starting Worklight 6.2 you do not need to either build or deploy your application in order to see changes made to web resources.
The following should suffice:
Create a Project and application
Run As > Run on Worklight Development Environment
Open console, view the application (keep this tab open)
In Eclipse, change some resource (image, CSS, HTML, JavaScript)
Return to the previously opened tab and refresh it
The change should be visible to you.
Something to try:
Close Eclipse
Open your TMPDIR and delete the wlBuildResources folder
Open Eclipse, try again
You can also try adding a mobile environment to your application; there are some reports this some times, show how, helps 'refreshing' the web resources used while previewing applications
You can also make sure you are using the very latest 6.2.0.01 iFix; there were preview-related fixes in the past. You can get it from IBM Fix Central website (assuming you are an IBM customer/business partner; for evaluation purposes you should download the latest available version, from the Eclipse Marketplace - v6.3)
Note that Run As > Build all environment does not actually deploy your modified web resources to the server, it only generates the .wlapp for later consumption elsewhere, so I suggest to follow my steps at the very top of this answer, by using Run As > Run on Worklight Development Server, and later on simply save (ctrl/cmd-s) and then go to the console to verify the changes are there.

IBM Worklight 6.0 - Controlling Dojo Layers

The question concerns how to use the Dojo tooling in Worklight Studio 6.
I am using Worklight Studio 6.0.0.20130926-1933 as a a plugin for my Juno Eclipse on a macbook.
I want to use Dojo, and to use a few more Dojo components than are delivered in the standard layers. So, when creating my project I selected the option to add Dojo Toolkit and took the New Dojo Library option, in the dialogue that appears I stayed with the "provided" dojo, and expanded the "select Dojo components to be included" section - this shows all the optional Dojo modules, including ones I want to use (for example dojox/form/Manager).
Having finished that selection I see some layer files have been created in my new DojoProject and they are copied to the www directory of my Worklight project, however so far as I can see the extra Dojo modules are not present in the layers - a search for dojox/form finds nothing, and my app's attempt to require "dojox/form/Manager" fails.
I can work round this by manually building layers and loading them, but I assume that I'm not using the tool correctly.
What is the correct way to use the Worklight tools to control the layer contents?
Transpires that the selected Dojo components are available for use but do not get included in any layers. The dojo components are available for serving via the Dojo Libarary Requests capability.
Seems that at present if we need to get those extra files into layers then we are required to use the Dojo layer building scripts by hand and copy the results in the Worklight project's wwww directory.

IBM Worklight 6.0 - Worklight Starter Dojo example broken?

I've installed Worklight 6 in an instance of Eclipse Juno and I am wanting to migrate working apps into it from Eclipse Helios and Worklight 5. I am running into some strange problems, possibly because of the transition to Dojo 9 or maybe the new directory structure of the resident Dojo files. So I decided to start with the examples. I use Dojo in my apps, so I downloaded the WorklightStarter_DojoMobile eclipse project and imported it. I did the 'build and deploy' step, and also deployed the WorklightStarterAdapter.
I am trying to run the app in the browser simulator and it appears to be busted. I get the 'about' view but no feeds. I ran it with Firebug and the console shows a lot of peculiar errors.
I won't paste in the network links but a lot of files are not found:
WorklightStarter_DojoMobile/apps/services/preview/WorklightStarter_DojoMobile/android/1.0/default/cordova_plugins.json not found
WorklightStarter_DojoMobile/apps/services/preview/WorklightStarter_DojoMobile/android/1.0/default/dojo/core-web-layer.js not found
WorklightStarter_DojoMobile/apps/services/api/WorklightStarter_DojoMobile/android/init unauthorized
/WorklightStarter_DojoMobile/apps/services/preview/WorklightStarter_DojoMobile/android/1.0/default/dojox/mobile/themes/android/android-compat.css
Procedure invocation error. White spaces are required between publicId and systemId. Failed to parse the payload from backend (procedure: HttpRequest) with transformation...
Indeed, the Worklight Starter Dojo Edition is not fully compatible with Worklight 6; instead, you can use the Dojo examples from the training materials.

IBM Worklight 6.0 - Dojo library uses localhost after deploy

I have a Worklight 6.0 project that uses the new Dojo 1.9 libs, I created an external dojo project, like the documentation suggested, then, in the main project properties, under "Dojo toolkit", it references this dojo19 project.
The project works on the local server, then I did "Run As" | "Build for Remote Server...", and entered the correct domain:port and context path, clicked Build, the *.wlapp files were updated. (I've also updated the settings for publicWorkLightHostname / publicWorkLightPort / publicWorkLightProtocol in the "Environment Entries for Web Modules" in the installed war to match the remote server names/port/protocol.)
But, after deploying both war and -all.wlapp file, accessing the app I get JS errors when it tries to refer to the dojo19 library:
The page at
https://<myIP>:9443/<myproject>/apps/services/www/ /mobilewebapp/default/IODMobile.html
ran insecure content from http://localhost:64441/dojo19/<myproject>/IODMobile/mobilewebapp/dojo/nls/core-web-layer_en-us.js.
The dojo19 is the project name in my Worklight developer workspace that I referred to above.
Why is it trying localhost? Seems there's a missing step here in deploying the dojo library project into Worklight.
Where are you trying to preview the application when you get the error message?
See the changes in Dojo in Worklight 6.0
If launching the application in emulator/simulator/device, see Billy Rowe's answer in this question
Partial copy/paste:
Step 1: Verify your application works in the Mobile Browser Simulator
with Provide Library Resources checked. If the Console log is showing
resources being served from the server, then these have to be copied
to your application before deploying to AVD or a device
Step 2: After you think you have all Dojo/resources within your
project, uncheck Provide Library Resources and test it again in MBS.
If it fails in MBS, then something is missing in your application that
is in the library/server. You can check Provide Library Resources and
retest to see if it shows you what that is. Not all resources are
shown, e.g. if there's a missing CSS file.
Also I would suggest to do all of this in the Development environment (that is, in Eclipse) before starting to deploy the .war file and .wlapp file etc... (which, BTW, I hope you're doing based on the new instructions for Worklight 6.0)
In the information center, it will show you how to uncheck the Provide Library Resources in the Console Log.
I think what you're running into is:
1) Something is being served from the Dojo Library/Server
2) A bug in 6.0 that used "localhost" instead of the IP of the host (your machine running eclipse). This is fixed in the 6.0 iFix. With this fix, you can run your app external to Studio and still use the Dojo Library/Server. Without this fix, you must have everything you need within your app.
Can you install the iFix and let us know if that fixed the problem?

Cannot use Direct Update for Windows 8 in Worklight 5.0.6

I use Worklight 5.0.6 and can't use direct update for a Windows 8 application.
IBM Worklight Information Center tells that windows 8 app can use direct update.
My way to test direct update as follows.
Please tell me how to use direct update in Windows8.
make windows8 env project
change wlInitOptions.connectOnStartup value "true" (in common\js\initOptions.js )
select [Build All and Deploy]
double click .jsproj file run simulator in visual studio 2012 for Windows8
make app "back ground"
change html file and "re [Build All and Deploy]"
make app "foreground"
This documentation page is misleading (I will open a defect to correct it).
Direct Update (as in the process of updating the web resources of the application after it has already been installed on the device) is available ONLY for iOS and Android. In those environments following your steps will indeed trigger a Direct Update.
The update (or rather, upgrade) of Desktop applications has no relation what-so-ever to the Direct Update mechanism mentioned above.
For Desktop enviornments consider it like updating any other desktop application - where you up the version number, and the app detects that there is an update available or so.
In the case of Adobe Air and Windows 7/Vista Gadgets:
Build your application and install it
In application-descriptor.xml, up the value of the version attribute in the envrionment's element (for instance from "1.0" to "1.1")
Build again
I believe that now you need to go to the Worklight Console and re-download the installer, and it will detect that it needs to upgrade rather than install afresh).
Note: iGoogle, Facebook, Windows 7/Vista Gadgets and Dashboard environments will be removed in the next version of Worklight. All have ample replacements with other supported Worklight environments.
In the case of Windows 8:
Direct Update most certainly does not exist for it
The steps above are also not relevant as it is not a downloadable executable