IBM worklight deploy to external server - ibm-mobilefirst

we are developing an application on IBM WL Enterprise ver 6.2.0.1.
We have four environments which are (Dev/QA/UAT and PROD).
Each Env has its own URL (For example Dev env has " https://mobile-dev.company.com").
When we do the code build, we need to target the env URL by defining the External server path + the context for the app.
Then we do the build which generates the ".adapter/.wlapp" files.
I need to know where does the Env URL get reflected in these files (.adapters/.wlapp)?
If I changed for example (ProjectName-common.wlapp) to .zip and extracted it, where will I find the Env URL value inside it? (Same question for Adapters files)
Thank you

You will not.
The .wlapp contains only the metadata of the application and the web resources.
The URL is stored in the generated project.
For iOS, that would be the worklight.plist file in the Xcode project.
For Android, the wlclient.properties in the assets folder of the Android project.
For WP8, it will also be wlclient.properties.
The adapter is unrelated; in its XML file you will see the URL that the request will be directed at.

Related

Is there is any way to get the appcenter config from env file in React Native

One of my android application is developed using React-Native and I have plans to distribute this using app-center as this app is for Internal users. In App-Center I have different projects (created new app) for the different environments - one for dev, one for uat and one for production.
My issue here is whenever I create build package (apk file) to deploy to App Center project, I need to manually change the app-center config. I have used .env config file to get config for different environment. But I can't use this to set app-center config. Can anyone guide me how I can automate this process by either configuring the app-center in .env file or somewhere in code?
If you want to use a specific configuration for each build with the same code, you should use the appcenter's environment variable.
Just add an "app_secret" environment variable, and use a pre build script to create a appcenter-config.json file containing the app_secret

unable to include external files in a project

I have created the default play application in IntelliJ in directory P. I have over-written the default index.scala.html with my own html code. The html code refers to some css and js files which are outside the directory P. To include these external files, I added the directory of these files using project configuration settings.
My webpage doesn't load properly as the server returns 404 for the css and js files. What am I doing wrong?
When you added your directory using project structure, you only say:
Hey, IDEA, please consider this folder part of my project, consider
its contents source code and display it when I open my project.
However, when you deploy or run your app, you only deploy the usual folders to the server, which contain the resources which will be available for clients to access.
The external directory is not part of these directories and will not be deployed.
What you can do is to copy the file from the external directory as a part of your build process before deploying the application.
EDIT: Detailed answer here: What is intellij's build process for play applications

Cloudbees RUN#cloud System Path

I'm deploying a NodeJS application that's using ImageMagick (via node-gm) to Cloudbees. My build script is compiling it and loading the binaries into a special directory in my deployment zip:
-main.js
-path_utilities
-imagemagick
- bins...
The binaries are accessed via spawn() within gm, so path_utilities/imagemagick needs to be on the path. How do you modify the system PATH variable on a RUN#cloud instance?
Thanks!
Chris
Derp - you can change the path while in the app:
process.env.PATH = process.env.PATH + ":./path_utilities/imagemagick"
EDIT:
Editing the path like this works, but is crappy. The better way is to fork the clickstack you're based off of and edit the path in the application loader.

How to change the path that jar files use in java Web Applications

I have written a java Servlet web application, using NetBeans 7.2.1. The program have some jar file libraries that I have attached to the project. The application runs fine using NetBeans and Apache Tomcat 7.0.27.
My problem is that some of the jar file libraries that I am using in the project, need to access to some folders and files. I put these folder and files on the same directory as the whole NetBeans project is. but I got this exception:
Exception: java.lang.RuntimeException: java.io.FileNotFoundException
So I used these codes to find out where should I put them:
out.println("current directory: " + new File(".").getAbsolutePath());
out.println("current directory: " + System.getProperty("user.dir"));
out.println("current directory: " + getServletContext().getRealPath(("/")));
So I figured out that the current working directory is:
C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin
My question is that how can I set different directory address for each web application? I have many web applications and some of them use the same resource file names. I can't just put all of them in one directory.
Please note that I don't have access to the source code of jar files to change the. I just need a way to set the absolute path that the jar files use.
I have the same problem when I put the WAR file on the unix server. The extracted WAR file is in this location on the server:
/data02/tools/Apache/Tomcat/apache-tomcat-6.0.37/webapps/BANNEROnline
But I figure I should put the resource folders and files in this path (moosavi3 is my username!):
/home/moosavi3
How can I change the path?
The working directory is the directory from which java.[exe,bin] is started. I assume the bin directory is where the tomcat start-up script is? If the jars are all using this working directory I don't believe there is a way to make different web-apps have different working directory, they're all loaded on the same jvm (java.exe) from the same working directory.
A working directory is the directory from which a binary is started, it is not some arbitrary value that you can change.
I suspect these jar files where meant to be run as standalone applications and expected the filesystem resources they are trying to access to be in the same location as themselves.
Any filesystem resources would have to be moved to the location of your java.exe so that the correct file path resolution can result from your jars.
Standard Servlet project requires external libraries to be placed in the 'WEB-INF/lib' directory under project root. You can search google for 'servlet directory structure' and do your own research for more information. Shared libraries between web applications can be placed in the 'lib' directory under tomcat root, they should be picked up by tomcat jvm. My recommendation would be to keep the dependencies project specific, because you may need different versions in different projects in the future.
Update:
Read this page on the tomcat documentation, it will explain exactly how the project should be structured, and how to add a library that will be shared across all web applications:
http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html
Update 2:
The following Stackoverflow link explains several options how to add a static file to your web application, that will available at runtime.
https://stackoverflow.com/a/2161583/940754
Update 3:
Add a path to the classpath using the project's manifest:
http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

OData and Objective C

I am trying to develop an ipad app that would interact with SQL server.Simple. So, i used WCF web service. I am getting the data there as xml. now, i want to develop an objective c client that would consume it. So, i used the odatagen tool to generate proxy. I did that and i got 2 files xyz.h and xyz.m. No more files. Now i have included them in my project. But in the xyz.h file i have error that says "import "OdataObject.h" file not found. I have done the header search path and library search path settings. What is missing.?
You have to include in your project the files that you should have in the OData4ObjC repository you cloned from github (or codeplex):
the .a library located in the /framework/bin/odatalib/lib/-yourplatform-/-yourversion-
all the files located in the /framework/bin/odatalib/include folder