Auto-upload on save - eclipse

I'm delveloping a PHP web application on my local PC. Whenever I save a file it would be handy if Eclipse could upload the file to my web server via FTP. Is Eclipse able to do that?? I think Netbeans offers such an option. At the moment I do the upload manually which is very annoying...

Take a look at Eclipse Target Management (RSE). You can find a tutorial on getting started page.
A big downside is that the quality of RSE's error messages range from okay-if-ambiguous to downright horrible (IBM-style 3 chars + 4 digits with no text message) so it's best if you know whatever protocol you're using well enough to guess what the error is without really needing the message to explain it to you.

So, after a whole lot of tries, I finally found something that works!
What you need to install is Eclipse WebDAV and FTP Support. I have not found the eclipse update site, but this site has n archived version of it. This allows you to sychronize your code with an FTP site.
http://eclipse.jcraft.com/
Then, to Automatically Upload On Save, you can use my Auto Hot Keys Script at:
Eclipse Synchronize Hotkeys

Related

Setting up Sublime Text 3 w/ a local server for testing

I am taking a course on web development and I haven't been getting any help on how to set up Sublime Text 3 with a local server. I am being taught by some foreigners who can hardly speak English, so when I ask them, they don't really know how to explain it to me. Videos online haven't helped.
They want me to use Eclipse with Apache Tomcat, which I have set up, but I would like to use Sublime Text 3 instead of Eclipse, because I like it much better. I read something about MAMP, but again, I would need help setting it up. If anyone could point me in the right direction or give me a breakdown of what I need to do. My current assignments are with using AJAX & JSON... and then AngularJS. So I need to basically be able to retrieve items from a JSON file and insert them in my HTML, from a local server. I hope I made sense here.
Thanks!
Use livereload, it helps auto refreshing the site, it also compiles files like less, css, html, javascript and more. make sure all your files are in one big folder with sub folders for images etc.
Do you know how to use Terminal? The simplest way to set up a local server is to navigate to your project folder inside the Terminal and then type Python -m SimpleHTTPServer. Then, you will have a server running and you can go to your browser and go to localhost:8000 as your address.

Packaging a GWT app to run completely offline NOT installed via a "marketplace"

Theres a few questions similar to this, so I'll try to be clear as possible.
We have an existing, fairly large and complex, GWT webgame I have been asked to make work offline. It has to be offline in pretty much the strictest sense.
Imagine we have been told to make it work off a CD Rom.
So installation is allowed, but we cant expect the users to go to a Chrome/Firefox store and install it from there. It would need to be off the disc.
Likewise, altering of the browsers start-up flags would be unreasonable to expect of users.
Ideally, it would be nice if they just clicked a HTML file for the start page and it opened in their browsers of choice.
We successfully got it working this way in Firefox by adding;
"<add-linker name='xsiframe' />"
To our gwt.xml settings. This seems to solve any security issues FF has with local file access.
However, this does not solve the problem for Chrome.
The main game starts up, but various file requests are blocked due to security issues like these;
XMLHttpRequest cannot load file:///E:/Game%20projects/[Thorn]%20Game/ThornGame/text/messages_en.properties. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.MyApplication-0.js:34053 com_google_gwt_http_client_RequestBuilder_$doSend__Lcom_google_gwt_http_client_RequestBuilder_2Ljava_lang_String_2Lcom_google_gwt_http_client_RequestCallback_2Lcom_google_gwt_http_client_Request_2 MyApplication-0.js:34053
Now I was aware same origin policy issues might popup as during development we often tested locally using flags in chrome to bi-pass them.
Thing is...now I dont know how to get around them when we cant use startup flags.
Obviously in the example given its just the .properties file GWT uses to get some language related text. I could dump that inline in one way or another.
However, its only one of many,many,many files being blocked.
The whole game was made to run off *.txt game scripts on the sever - to allow easy updating by non-coders. Really the actual GWT code is just an "engine" and all the XMLHttpRequested files supply the actual "game".
These files are of various types; csv, txt, ntlist, jam.
The last two being custom extensions for what are really just txt files.
All these files are blocked by chromes security. It seems from what I can make out only images are allowed to be accessed locally.
Having all these files compiled in would just be impossible, as they are not fixed in number (ie, one central .txt file determains various scene .txt files which in turn determain various object files and directory's...).
Putting all this into a bundle would be nightmare to create and maintain.
So in essence I need some way to supply a offline version of a GWT project that can access a large number of various files in its subdirectories without security issues.
So far all I can think of is;
A) Theres something I can tell chrome via html or gwt that allows these files to be read in Chrome like FF can. (I suspect this isn't possible).
An alternative to XMLHttpRequest maybe?
B) I need to somehow package a game+a webbrowser in a executable package that has permission to access files in its directory's. (http://www.appcelerator.com/titanium ? ?? ).
C) I need to package and have the user run a full webserver that can then deliver all these files in a XMLHttp accessible way.
D) Bit of a funny one...we cant tell the user to add flags to browser start up...but Maybe I could write a game installer which just detects if they have Chrome or Firefox. It then opens up the games html in their browser with the correct flags for them? This would open up security issues if they browse elsewhere with that instance though, so Id presumably need other flags to disable the url bar if that's possible.
I am happy to make various changes to our code to achieve any of this - but as mentioned above theres no way to determain all the files needing to be accessed at compile time.
And finally, of course, it all has to be as easy as possible for the end user.
Ideally just clicking a html file, or installing something no more complex then a standard windows program.
Thanks for reading this rather long explanation, any pointers and ideas would be very welcome. I especially will appreciate multiple different options or feedback from anyone that's done this.
========================================
I accepted the suggestion to use Chromiumembedded below.
This works and does what I need (and much much more)
To help others that might want to use it, I specifically made two critical changes to the example project;
Because CEF needs a absolute path to the web apps local html, I wrote a c++ function to get the directory the .exe was launched from. This was a platform specific implementation, so if supporting a few OS's (which CEF does) be sure to write dedicated code for each.
Because my webapp will make use of local files, I enabled the Chrome flag for this by changing the browser settings;
browser_settings.file_access_from_file_urls = STATE_ENABLED;
These two changes were enough to get my app working, but it is obviously the bare minimum to make a application. Hopefully my finding will help others.
I'd suggest going the wrapper route. That is, provide a minimal browser implementation that opens your files directly. Options are Chromium Embedded[1]. If the nature of the application absolutely requires the files to be served as non-file urls then bundle a minimal webserver, have the on-disk executable start the server and open the bundled browser with whatever startup arguments you want.
[1] https://bitbucket.org/chromiumembedded/cef

We don't need to stop running project due to server side datas changes

How to do server side datas changes may be effect or update by browser's refresh in GWT projects ? Browsers may download js files of client side , but not server side. When a project is bigger and bigger , that may consumes many times of us. We also wait js files downloading times. One or two times were not problem. But if we changes small things and we want to see it's effects urgently , we will stop server again , re-run the project again , wait js file downloading time , reLogin again and so on. So , I really want to know how to do. Any suggestions would be appreciated. Thanks for reading my question patiently...
There's a "Restart Server" button in the DevMode window (in the Google Plugin for Eclipse it's a pair or swirling yellow arrows).
It'll restart the webapp, reloading the compiled classes from WEB-INF/classes and JARs from WEB-INF/lib.
If you're using Eclipse, it should already be configured to compile classes to that WEB-INF/classes folder so it should Just Work™.
My problem can solved with JRebel but I want to know is another way because it is not free tool :) .
It is awesome tool. You can add it your eclipse as plugin and add it's nature. If you run your project with it's console you can get always update datas of client and server side datas by saving your class or xml or any other files (I mean as I know ). If you want to test with it , guide is here..
JRebel for Eclipse
That may be helpful for you...
To see the immediate changes you can copy your js files and paste it in your target folder of entrypoint project. And a browser refresh will suffice. Sometimes clearing of browser cache also required.
This might not be a classy solution but it will reflect the changes and in cases where you don't want to restart the server again and again to check whether it works or not.

FTP in NetBeans 6.1

Is there an FTP browser hiding away in NetBeans 6.1? The help manual doesn't even suggest FTP exists.
All I've been able to find so far is a tree viewer in the Services panel (no edit controls) and the ability to upload projects, folders and specific files from the Projects/Files views. Is there anywhere to delete or rename or will I have to keep switching back to my browser?
I can see from the previews that there's a nice FTP controller in 6.5 but I'm not desperate enough to completely convert to a beta (yet).
It looks like something was recently added to netbeans for php...
http://blogs.oracle.com/netbeansphp/entry/ftp_support_added
don't know if you can make use of that...
You can try the Plugin FTP Site Deployer. This is free and open source plugin for Netbeans, it's add a contextual menu with the voice "upload to FTP". Is still in development but it is working:
You can find some other information here:
http://www.askweb.it/wordpress/?p=136
And download source and nmb from sourceforge
https://sourceforge.net/projects/ftpsitedeployer/
The remotefs addin works for 6.5:
remotefs
(source: netbeans.org)

How to save file using Eclipse Monkey?

I've recently started working with Aptana and Eclipse Monkey. What I want to do now is to create a script that saves a file then uploads it to a FTP.
Problem is that Eclipse Monkey is VERY poorly documented and Google returned only unrelated results.
I've made it upload the file, but I need the script to save the file before uploading.
sync.uploadCurrentEditor();
Do you know any resource for Eclipse Monkey with methods,etc ?
Check this out, it has the solution for your problem:
http://forums.aptana.com/viewtopic.php?t=5216
Edit; to be more specific;
You need to add the following line into the meta-data piece at the top, so the script knows the reference 'editors':
* DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript
After you've done that, you need to add the following line right before the sync. stuff;
editors.activeEditor.save();
That's it :)