I am trying to complete the StackMob hello_world tutorial for custom code found here:
https://www.stackmob.com/devcenter/docs/Getting-Started:-Custom-Code-SDK#a-register_your_method
but when I try to run the client-side iOS code it says:
{NSLocalizedRecoverySuggestion={"error":"hello_world is not an existing schema"},
I tried to do a POST request to ReadParams from their example project and that created the schema and returned correctly. Maybe GET requests don't modify schemas, but then how do they expect you to do the hello_world example?
Thanks!
[EDIT]: I got this working by making sure the package is of the correct java package form with src directory, etc. Then I changed my package name and forgot to change the pom.xml file to reflect that.
This happens when the API doesn't think there is a custom code method registered with that name yet. When you go to the settings page for the custom code module, you should see a list of the custom code methods available in the JAR which you uploaded.
If you don't see any such methods, then it is likely something went wrong trying to validate the JAR you uploaded. Feel free to contact support#stackmob.com with any questions specific to your app's custom code!
(Disclaimer: I'm a StackMob engineer)
Related
I'm currently working on a Plugin, which lets Players decide, whether they want to load a 16x16 ResourcePack or a 32x32 one. The packs are forced (they're needed for the gameplay). My problem is, that when I select a pack it should do this:
p.setResourcePack("https://github.com/Ole1Tau1/RPG/blob/main/RPGPack.zip", "E3CED908E76C7390DDC4F47C22F6FF16", true);
But instead of loading it, the client gives me an error:
Server resource pack couldn't be applied
Any functionality that requires custom resources might not work as expected
Anybody got an idea what I did wrong?
Full code is here BTW: https://github.com/Ole1Tau1/RPG/tree/main/RPSelector/src/main/java/dev/onetone/rpg/rpselector
Your repository seems private. So, only you -with your account- can access to it. With this, for all players that tried to download it, it will return 404 error.
To fix this, you can:
Make your repository public. I think you don't want, but if it contains only the zip file, it's fine.
Create a second repository to host it. It can be a good solution if you already have another repo with a wiki or other help that are public.
Use something else to host it. A website on the server where spigot is running, another website or anything else, you can host the zip file then change the link in your plugin.
Background:
I have a plugin which should give out links to helpfiles of other, currently installed, eclipse plugins.
At first I thought that I include those html files in my plugin, but I couldn't open them unless I copy them into the current workspace of the user. Since this is not an option, the most elegant way would be to use the eclipse-built-in help system.
So I need to access the eclipse help system programmatically to include the files into my code.
Does anyone know a workaround for this?
Edit: I guess I missed a central point: I generate an HTML-File, in which the links to the help system should be embedded.
When I open the helpfile to a given plugin, there is a link like this at the bottom:
http://127.0.0.1:11925/help/topic/plugin/help/html/maintopic.html?cp=5_1_2
The problem is: I can't access this document but I would need to.
From the Eclipse Platform API Specification, implement the IWorkbenchHelpSystem interface and call the displayHelp() method without an argument to programmatically open the Help window, or call the displayHelp() method with the context ID string as the single argument to programmatically open context-sensitive help for a specific context ID. Read the API for further information.
I am trying to learn how to develop web applications and I am a little stuck.
I want to create a movie review application. It has a few java class/packages which is inside a JAR file:
moviewebapp.jar
package - moviewebapp.movie
class - Movie.class
package - moviewebApp.servlet
MovieServlet.class
And a servlet class which has methods such as doPost, doGet, getMovie, updateMovie etc.
I have added the .JAR file to my build path.
I have developed a simple page where a user can click add movie review, which opens up a form where they can input the movie name and rating.
I now want to save the users input to a datastore. How do I use the methods within the servlet class in my javascript to deal with the post of the information about the movie?
I have tried doing imports and then trying to create a servlet object but I dont think I have the correct syntax or maybe thats not how I'm meant to do it.
Any help would be appreciated!
Jars are libraries you should not modify its code unless untill it is last option. You can import it's classes and use methods of those classes.
By your question it seems you are new to Java. So I suggest you should start with hello world tutorials of servers and jdbc then start developing applications. Good luck.
Trying to provide some guidance:
Easiest solution (not the best) : you have to submit your page to receive the entry from the user. Doing this you are going to lose the status of the page on the client side.
A better solution is to make a asynchronous javascript request to get the answer provided by the user for you to process on the server side.
I have created a subpackage of views in order to customize the default look of securesocial's templates. (I have used https://github.com/ngarera/securesocial-custom-views-sample as an example and basically copied the relevant files)
There are two i18n-files (messages.en, messages.de) in my /conf folder.
Viewing the main page confirms that the messages.en is correctly used.
However, when calling /login (and therefore displaying the custom template), no messages-key is correctly looked up - instead only the key itself (e.g. "auth.login") is displayed, when really it should show "Login".
I have seen a similar request at Stackoverflow (How to change text in SecureSocial) where it was stated to remove the .en file extension. Doing that will show the correct Message...but creating one messages file is not really the point of internationalization...
I have confirmed that my browser sends the correct language (http://www.mybrowserinfo.com/detail.asp?bhcp=1) so messages.de should work...(which it does when I open a self-made controller - only the custom-securesocial-view is not working...)
Does anybody have similar problems?
And why does the localization work for securesocial's messages?
Regards,
David
PS: using Play 2.1.3, Java
There were some issues in the SecureSocial code that prevented i18n from working properly.
This has been fixed and is currently available in the master-SNAPSHOT version because a stable version with those changes has not been released yet.
Up until now, when I needed to update the content of any pages, I have always had to update the source code directly and re-deploy the whole application. Right now, I want to implement a feature such that I can update the content of any HTML pages dynamically without having to re-deploy the application.
I tried to implement the feature with PrimeFaces's <p:editor> component but it does not work. To be more precise, my functions can correctly update the required page. When I goes to the source code folder, I can actually see my changes. However, subsequent requests for the page still render the old content.
I'd be very grateful if you could show me what I have done wrong. I'd also appreciate it very much if you could show me any other ways to achieve the same goal.
I think you are editing your work-space from your deployment. :)
You have 2 places with the code. One is deployed, and the other in your "working space".
First, it sounds to me like you want your working space to be the deployment. This way whenever you are editing something, you will be changing the deployment directly. For that, simply create a new project in your IDE and point it to the deployment folder.
I bet that :
C:\\Users\\James\\Documents\\NetBeansProjects\\MyProject\\MyProject-war\\web\\
points to your work-space and not the deployment. so effectively, your deployment is editing your work-space.
I think you are looking for this one:
FacesContext.getCurrentInstance().getExternalContext().getRealPath("/")
and if you want the location of the WEB-INF
use the following
String fullpath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("/")+File.separator+"WEB-INF";
and so on...
My code actually was working perfectly. From the above answer of user1068746, I did some research and found this article. The solution is very simple: creating a virtual directory mapping to my hard-disk's directory. As a result, any updates to my files on the hard-disk will immediately be visible to future requests.