How do you remove the default WMS Layer from a basic WorldWind Java application? If I remove it like so, my application is still trying to reach the public WorldWind WMS servers:
import gov.nasa.worldwind.Model;
Model testModel = new BasicModel();
testModel.getLayers().clear(); // Makes default geo invisible, but still queries server in background.
// Add my own layers, here
Oh wow - thanks for reminding me about an old love !
However, regarding your question:
If you want to work completely offline, use property
gov.nasa.worldwind.avkey.OfflineMode
(answer found here)
If you want to remove individual layers, take a look at the config folder.
config/worlwind.layers.xml contains the layer config, just comment out layer you do not want to use.
The folder resides in worldwind.jar when using the standard build, but you can specify a different location - take a look at the Configuration class on how to do that.
There is also another interesting file there, DataFileStore.xml, which lets you define the cache location. If you fill the cache with your area of interest while being online, this data will also be used when in offline mode. Once there were also Cachepacks available but it seem these are not available anymore.
I think there was also a tool to select an area and download the data into the cache for offline mode.
Have fun !
Related
Our application is deployed in websphere and uses lots of custom jvm properties.
Right now we are adding the properties one by one through admin console.
This is a pain during development phase.
Because every day after syncing their code, each and every developer needs to find out if a new property has been added/renamed and do those changes in their own console. Else the application wont start.
It also takes a lot of application setup time, while deploying to various testing environments.
Could you help me identify the place where websphere stores these custom properties? We are thinking of writing a code to update that file (?) directly instead of adding one by one through admin console.
Please help.
P.S:- We are not allowed to use jython in our local :(
In the server.xml configuration for that given server, located somewhere like
Dmgr/config/cells/cellName/nodes/nodeName/servers/server1/server.xml
You can inspect the <processDefinitions> element and add a "systemProperties" stanza like:
<systemProperties xmi:id="Property_1460665921900" name="someName" value="someValue" required="false"/>
DO THIS AT YOUR OWN RISK. The "Property_1112223334445" part is fragile, and you need to make sure it has a unique 13-digit number at the end.
Or, you can modify the "genericJvmArguments" tag in the same file, using a format more like -DsomeName=someValue
Finally, if you do have jacl scripting access, there is an article on updating using scripting here.
I'm new to Liferay but I have to update (fix bug and add some enhancement) a site made with Liferay 6.1.1
I have a form that create an organization and a blank site for it.
The problem is that currently, an admin have to go to the control panel, change the public site template, change the name in the template to organization's name, check an option to merge with the main site public pages, then give admin rights for their site to the user who create it.
This task have no variant so I'm quite sure it can be done automatically when the user create the organization. I find the java files which create the organization from the form, but I have no idea where I should look for to make previous task automatic, or how to add it to the code...
Anybody can help me plz ?
Suggestion I can give you is some tip, how to look for specified classes allowing you to do some work. Each time you want to start to creating, modifying, removing some Liferay objects, just look for this pattern:
${MODEL_NAME}LocalServiceUtil.java
Here are few examples:
If you are looking for Liferay API allowing you to create some User, just look for class UserLocalServiceUtil.java
If you want modify some Layout look for LayoutLocalServiceUtil.java
and so on with rest. Most of time Liferay serve such classes with plenty useful static methods, which means you can use them immediately in your code.
Your work doesn't seem to be very hard, try to look for such util services and you should be able to achieve your goals easly. Good luck! ;-)
tomic answer's help me well to start the work. I just want to add an other link I just find with some usefull information close to what I try to do :
https://blog.ancud.de/home/-/blogs/creating-sites-and-users-programmatically
Also there is a "definition" part in it wich is very usefull when you are new to Liferay :
To start with we have to know the right terms:
A site in Liferay is a Group with a special site flag set to 'true',
a page is called Layout and
a site template is called LayoutSetPrototype.
I have an idea for a GUI application, however it needs a set of technologies that i do not use frequently (as such i am a bit of a novice here, apologies if this is stupid!).
I want a 3D Earth Model, (like google earth, the actual look to be like the terrain overlay in google maps (I don't care about roads, just height & position)). Like google maps & google earth i will wish to add my custom tracks & locations & boundaries; and move / pan / tilt etc...
I cannot however be continually connected to the internet. So i will need a 1 time download of terrain/geodata before i startup the program. (Can this be done as a single kml dataset ? (Is that even correct?) i guess i would need a 'local map server' instead of an internet connection?)
I will need to use a precompiled language (preferably java) to actually write the program in. (Scripting / Javascript is not acceptable) Can i interface Java & KML using an existing library ?
Is it possible to reproduce the google maps 'map window' with the terrain imaging in 3rd party software ? (Can i pull this from open source somewhere?)
Everything you want to do is possible -- however -- let me preface this by saying that it will be a long, difficult journey.
Let's start with the easy thing: you can load your data as KML, it will show up as a layer in Google Earth, and you'll be able to turn it on and off. You'll also be able to turn off default layers (roads, etc) either programmatically or via the GUI.
I would use Google Earth (the web plugin thing) tied to a C# application. You do not want to use the old Google Earth COM API. It was deprecated by Google as of GE 6, and was truly a terrible thing to work with. Java could also work, but I prefer C# development. In either case, you can use the language's ability to call into the Google Earth API directly.
Here's a good example (C#). It's GNU/GPL, so it may work as a base for your app:
http://code.google.com/p/winforms-geplugin-control-library/
Essentially, you load a Google Earth web page in a WebBrowser control, which allows you to manage it directly. Actually interfacing with the web page is the hard part (but still easier than the COM API!) -- hopefully you can use the control library linked above to get a feel for how it works.
As for your internet connectivity issue: yes -- Google Earth (even the web plugin) supports caching. The exact amount of cache that is allowed is ~100 MB. Exactly what goes in the cache is a complete mystery. The 100MB limit won't get you very far -- but you can create larger caches (up to 2GB) using the full Google Earth app. These caches work with the web browser plugin, you just have to copy the database file into the Google Earth application data directory (and rename the file I think -- the plugin appends a 0 or something to the file name.) The process for creating a cache is simple -- fly around the area in question at the altitude you'd like. There are tools to help automate this, such as:
http://bx11.110mb.com/gecacher.htm
Note that caching Google's data isn't exactly what they'd like you to do. So please keep in mind that you'll need to fully review the EULA to make sure you're not violating it...
Good luck! I've been working with GE in a large app for ~3 years; It's definitely a fun thing to work with and can make your application really stand out.
I have an SQLite database stored in the assets resources of one application used to load UI and other stuff into the app, mainly just holding text nothing out of the ordinary. I want to be able to get a writable version of this database so I can modify it from another application.
Example:
First application is on the market with limited number of enabled features. User gets to a certain point where they need to buy extra content to do more stuff in the app. The original app has these features but they are not enabled in the app using the database. I want the user then to download a second app from the market which is just used to change one field in the database from disabled to enabled thus unlocking the new features.
I have an idea I may need to use content providers but my understanding is once created they are accessible to all applications. I need it, for piracy reasons I guess, to only be able to communicate with apps signed off by my key.
Thanks
Sam,
I understand what you intend to do, but you are going about it the wrong way. Your 'Unlock App' would not be able to modify the Database in the assets folder of your 'Free App'. That's just general android security model stuff.
You may want to look at this question: How can I use the paid version of my app as a "key" to the free version?
It describes how you can create a 'Unlock App' on the market to unlock features of your 'Free app' without needing to actually modify any of the original data in the 'Free App'.
Good luck
I'm working on an app that is meant to be used by fans of a sport team. In the future, I expect to use the same app but for any different team. So, what changes would be the colors, team logo, app name and the like.
So, is there any technique that allows me to build binaries for different teams without having duplicated resources?
Probably the best way is to depart from the default build system. That typically means writing custom Ant scripts (or you could use some kind of preparatory script that manipulates the resources prior to invoking the default build).
I've previously sketched an outline of how I achieved something similar.
Is it possible to have one binary that contains all the resources and have the user select which team they want from the app itself? Then the app can load whichever resources it needs.
There may be a better way to do this, but here goes:
Build your app for the first team and make all logos / team names / styles / etc resources. Then just write yourself a script that allows you to delete all the items in the res/ folder of your project and replace them with different items. If you are smart, then most of the string's like team names are included in the logos, so all your script has to do is to delete the old ones and copy in the new ones from some other location on your hard drive.
The worst part about this is that you will have to define android-type file for the styles. It might be good to have your script take as parameters a team primary & secondary color, and actually generate all the android-type style files.
Again, there might be a better way, I am just saying that this way could be a solution.
I think build your application which will load the image , colour information from internet / your server. then,
1) ask user for team name which they are following and download image,color information from internet/server and store it as local. don't download next time.
2) attach any global id with each build which will download the image,color information from server first time user installs the application.