How do I rename the context root of Application Center in Worklight 6.2? - worklight-server

I want to rename appcenterconsole to devappcenterconsole, and applicationcenter to devapplicationcenter. I am running Worklight 6.2 on Tomcat. I wonder if this is as simple as rename the war file, deploy it and update the server.xml?

See the Context container in the Tomcat documentation : http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
Especially the path attribute description.
You can for example modify the path attributes with : /devappcenterconsole and /devapplicationcenter.
Be aware also that if you modify the default context root of applicationcenter you must configure the endpoint property as documented in http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/appcenter/r_ac_endpoint_tomcat.html?lang=en

Related

request.getContextPath in React

I am building an Single-Page-Application where the front end is using ReactJS, and React Router.
The application shall be hosted with conventional app server either Tomcat or Weblogic (just due to whatever reason as required by our client).
My question is straight forward: in React, how could I get the application context path which is equivalent to request.getContextPath() as in jsp? I did many searching in google, but none of it could just give me a straight to the point answer. Whether react having such equivalent function? Or if I could grab this path from JSP? If so, how to grab it?
Thanks.
I had this problem as well and solved it like this:
In reactjs, when you are building your app for production, you need to run "npm run build".
To build it correctly, you need to set the homepage property in package.json to the main url of your site.
In my case I am using http://localhost:3000 for local development, and http://localhost:8080/myapp for stage testing.
That app needs to know if there is a "myapp" in the url or not. This is basically the problem of this post.
My answer is, because you need to specify the homepage property in package.json anyway, I am using this value to find my context path.
I am doing this like this:
{packageJson.homepage.substring(packageJson.homepage.lastIndexOf("/"))+"/login"}
For my test environment this returns: /login
For my stage environment this returns: /myapp/login
Maybe this helps.

Change the default location of Pycharm Project

I am using PyCharm 3.4.1 on Ubuntu 14.04. For new project it suggests ~/PyCharmProjects for storing project folders. Is it possible to change the location and name of this proposed folder?
(I couldn't find any reference to changing it in the interface, on the JetBrains site, or in the settings files. Either it isn't possible or (I hope) I missed something.)
Note, it is not a duplicate of Can I change the location/name of PyCharmProjects? - I am aware that it is possible to change proposed path for every created project - but I want defaults that I like.
I know this is an old question, but is is certainly possible as of now
Settings | Appearance & Behaviour | System Settings | Default directory
See JetBrains support page
screenshot
In fact, this is possible. In the IDE settings folder (https://www.jetbrains.com/help/pycharm/project-and-ide-settings.html), under config/options/recentProjectDirectories.xml, you can add an option lastProjectLocation. It wil honor this setting when creating new projects. My recentProjectDirectories.xml looks like this:
<application>
<component name="RecentDirectoryProjectsManager">
<option name="lastProjectLocation" value="$USER_HOME$/my_projects" />
</component>
</application>
In fact, for most options that you want to customize, you could do a diff of the config/options folder before and after you make the change: this way you can find out a lot about how PyCharm (or any IntelliJ tool) configures its editor.
I haven't found an explicit option for doing this in PyCharm, but the following steps have worked as an alternative:
Move your PycharmProjects folder to the desired location.
When you create a new project, press the "..." button to the right of the path (This is on the pop up window that asks for location and interpreter).
Navigate to the new location of PycharmProjects and select that directory.
Add the name of the new project to the directory location (ie. /home/alex/Documents/PycharmProjects/new_project_name)
Now, whenever you create a new project, the location will default to the last chosen path.
This wouldn't be a good solution for someone who is creating projects in many different directories, rather than just PycharmProjects. All my projects are within PycharmProjects and this works just fine.
PyCharm (since at least version 2017) remembers the parent directory of the last place where you created a project. So create a junk project in the directory that you want to be your default projects directory, then close that project, and delete it from disk. The next time you create a project, pycharm will automatically put you in that directory.
It's not a provided option. See this old thread (2003) on devnet.jetbrains.com where this is being discussed.
Subsequent requests to specify a default directory for projects has gone unanswered:
https://devnet.jetbrains.com/thread/157005;jsessionid=5A2C7A1F90969DEAD3908924FFF1AF3A?tstart=1
https://devnet.jetbrains.com/message/857698
https://devnet.jetbrains.com/thread/67231;jsessionid=5255DB0AAB942F0DCDF1B86AFFE54976
Just an update to #Psionman's answer. At least in the professional version (2019.3.5), t appears to have shifted just a bit. The field is now available at
File | Settings | Appearance & Behavior | System Settings > Project Opening > Default Directory
The latest version 2021.3 has the following option:
File | Settings | Appearance & Behavior | System Settings > Project (Dialogue) > Default project directory
Just like virtualenvwrapper, PyCharm apparently obeys $PROJECT_HOME
export PROJECT_HOME=$HOME/Devel
pycharm
or
PROJECT_HOME=$HOME/Devel pycharm
I would have to agree, because I could not find an option in the program. However, based on the answers, found a folder labeled (in my case)
\Users\.PyCharmCE2018.1\config\options
In this folder there are XMLs, one named option with a tag "file.chooser.recent.files". I worked with this, which I found to work for me.
Maybe this also serves:
File -> Settings -> Project (name) -> Project Structure -> Add Content Root
Add folders and then create files and/or navigate between them easily.

Gxt 3 Neptune Theme Setup Issue

I just installed GXT SDK 2.6 and created a new google web project.
added the following jars to the lib folder and to the build path
gxt-3.1.1.jar
gxt-theme-neptune.jar
but when i run my page on the browser i get the following error pls help.
[ERROR] [ia] - Errors in 'jar:file:/C:/Anant%20Choubey/Eclipse%20Workspace/GXT%20-%20IA%20-%2003Oct2014/IA/lib/gxt-theme-neptune.jar!/com/sencha/gxt/theme/neptune/client/base/Css3ThemeAppearance.java'
[ERROR] [ia] - Line 58: The method moreIcon() of type Css3ThemeAppearance must override or implement a supertype method
I have made no other changes elsewhere.
I think you have old version of theme plugin. Download new gxt-theme-neptune.jar-3.1.1 and try again.
Download link of gxt-theme-neptune.jar-3.1.1...

gruntjs / angularjs - optional development config?

Like most js web apps we have a config.js file that contains global config information about the app, base api urls and such. These values are often different in local development than in production.
I've looked at answers like: Development mode for AngularJS using GruntJS, and also things like grunt-replace for creating an on-the-fly config file.
My issue is that the "development" part varies from developer to developer, we all need a version of the API setup so the base api urls will be different. I'd like to allow each developer to override specific variables in the config in a way that doesn't require them to commit that info to the git repo (I agree that this isn't best practice, everything should be in the repo, but as this is only 1/2 variables for this project I can overlook it)
Any ideas on how to achieve this setup?
You can use grunt-preprocess. I would have production (and dev-server, etc) values in a file, say env.json. You could use grunt to look for an optional file, say overrides.json or developer.json, which would extend/overwrite the values from env.json.
var envFile = require('./env.json');
You can create command line options to grunt with grunt.option, e.g. var env = grunt.option('env') || undefined;, which could be used to turn off overriding.
You can get data from the optional file using fs.existsSync:
var fs = require('fs');
var developerFile;
if (fs.existsSync('./developer.json')) {
developerFile = require('./developer.json');
}
The simplest way to define the grunt-preprocess context would be to use the developer.json file if present, or the env.json file if not:
context: developerFile ? developerFile : envFile;
This requires the developer file to be complete. An alternative is to extend the envFile with options from developerFile if it's present.
In my project, we use different config files (which are basically files with JS object). So every developer has his app/configs/developer/config.js file, which is not comited in the source control, so every developer has his own setup. Project uses link to app/scripts/config.js by default and this file is just a soft link to developers config file. However, there are also app/configs/staging/config.js and app/configs/production/config.js files, which are replaced when using gruntjj to build project. Those configs are just copied to build solution instead of soft linked file.
I hope that makes sense..

problems configuring qooxdoo Inspector component

I am trying to configure the Inspector component as per instructions here: http://manual.qooxdoo.org/current/pages/application/inspector_selenium.html#pages-application-inspector-selenium-using-the-qooxdoo-inspector-to-write-selenium-tests
I am having problems following the configuration instructions, where it says to configure the Selenium window with the selenium-core zip file. I cannot find this file at the provided address: http://seleniumhq.org/download/
Any suggestions as to what I should use instead of that zip file?
Thanks
You can just press the "Use default URI" button in the Inspector's Selenium Options window and it will load the scripts from the Selenium SVN repository on Google Code. If that doesn't work for you it gets a bit complicated since the Inspector requires a deprecated version of Selenium:
Download Selenium RC from here and unpack it:
https://code.google.com/p/selenium/downloads/detail?name=selenium-remote-control-1.0.2.zip
Then extract
selenium-remote-control-1.0.2/selenium-server-1.0.2/selenium-server-standalone-1.0.2.jar to a directory named e.g. "selenium-server" and enter the path to that directory in the Inspector's Selenium Options window.

Resources