How to extend an orientdb embedded server to have my own servlets? - orientdb

I have created an orientdb embedded server standalone app to which I can query from console. However I need to extend the functionality to publish a page where multiple users can run queries and see (custom) svg visualizations. How can I do this?
I presume I need to create some html pages with servlets and also some orient db javascript libraries. But I am not sure how to connect all these.
Any help is appreciated!
Thanks,
Rao

You can create your pages under OrientDB server's www directory or also create a plugin that is a zip with pages and optionally Java classes. Unzip the studio file under plugins to see how is made.
Look also to how to write plugins.

I just found that required html files placed under the path: "[orientdb app path]/src/site" are accessible through http url. The bold ones are the folders which I created.
This path is looked upon in the OServerCommandGetStaticContent.java which in turn is configured in the config.xml for HTTP requests. I think if you wish you handle the http requests in your own java, you can mention that in the config.xml.
Thank you Luca for your pointer!
Rao

Related

Move website to another server without FTP or SSH

I have a problem with an existing TYPO3 website. (9.5.13)
Unfortunately, I no longer have FTP or SSH access to this server. (Provider can no longer be contacted) I would therefore have to move this website to another server. I only have admin access to Typo3 website.
Unfortunately I can't find a way to do this without copying the files and the database to the new server.
Is there a possibility? If so, how can I do this?
There is no real good way if you don't have a proper access to the server.
For the database you could use the extension phpmyadmin or t3adminer
but there is IMO no extension to download the content of the fileadmin (which will be a native feature of TYPO3 11 LTS).
However you could download at least all extensions of course.
In former times, there were two extensions trying to implement a FTP client as backend-module. The one was "Typo3 quixplorer", the other was "Typo3 eXtplorer"... Quixplorer is outdated (last update of extension in 2010), eXtplorer had its last update 2008...
Both extensions have security issues! Be careful and remove them immediately after usage!
Maybe you can find similar projects running in current web environments...
You may build some php script to archive the whole fileadmin-folder, and make a database dump. which you can download from the server.
Or you use a script to contact the new server to transfer the data immideatly.
It's just a question how you can upload these scripts as TYPO3 does not allow the direct upload of executables.
This is a really unfortunate situation, but you can copy the database and the files by using this extensions. Be aware: I haven't tested this extensions or took a look into the code and picked them by their description and README files. Use them carefully and on your own risk!
Note: In general the TYPO3 Security Team recommends to not use any
extension that bundles database management tools on production TYPO3
websites.
Database:
Use EXT:adminer or EXT:phpmyadmin to download your database tables.
Files:
Install EXT:commands or EXT:additional_scheduler to zip & download your files & folders.
All in one solution:
While researching I've found the extension EXT:ns_backup. Maybe you can us it to transfer the backup to cloud services like dropbox.

How to execute a local file from GWT?

I want to run a third-party application from gwt for manipulating a local file and after this send file to server. I released the feature for uploading and sending file to server, but between these steps I want to change something in this file (with 3-rd party application installed on client machine). The main problem is that the applet cannot be used because nor Chrome, nor Mozilla do not support it. Are there some examples of other tools and technologies to do this?
The FileReader and FileWriter api can be used to work with local files. I think the htmt5rocks has a good example of how this can be done with javascript. These processes can be used with GWT elemental FileReader and Writer. I've added links to the javadoc below.
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://docs.sencha.com/gxt/4.x/javadoc/gwt-2.7.0/index.html?elemental/html/FileReader.html
http://docs.sencha.com/gxt/4.x/javadoc/gwt-2.7.0/index.html?elemental/html/FileWriter.html
Answer is simple: GWT is client-side technology. You cannot run 3rd party application installed on client side, access local drive files or so.
If you want to change some local file fromt GWT application, then you need to expose Java Applet, do operation on server side and then process it.
Why are you saying Firefox and Chrome don't support it?

yii2 remove backend/web and frontend/web from url

I am trying to change site url from http://localhost/yiiwebsite/backend/web/index.php url to http://localhost/yiiwebsite/admin and http://localhost/yiiwebsite/frontend/web/index.php url to http://localhost/yiiwebsite/.
Can anyone help me to do this.
It's described in official docs here.
Here is some basic info:
The application installed according to the above instructions should
work out of box with either an Apache HTTP server or an Nginx HTTP
server, on Windows, Mac OS X, or Linux running PHP 5.4 or higher. Yii
2.0 is also compatible with facebook's HHVM. However, there are some edge cases where HHVM behaves different than native PHP, so you have
to take some extra care when using HHVM.
On a production server, you may want to configure your Web server so
that the application can be accessed via the URL
http://www.example.com/index.php instead of
http://www.example.com/basic/web/index.php. Such configuration
requires pointing the document root of your Web server to the
basic/web folder. You may also want to hide index.php from the URL, as
described in the Routing and URL Creation section. In this subsection,
you'll learn how to configure your Apache or Nginx server to achieve
these goals.
By setting basic/web as the document root, you also prevent end users
from accessing your private application code and sensitive data files
that are stored in the sibling directories of basic/web. Denying
access to those other folders is a security improvement.
If your application will run in a shared hosting environment where you
do not have permission to modify its Web server configuration, you may
still adjust the structure of your application for better security.
Further configuration depends on chosen web server (Nginx / Apache), which is not even mentioned in the questoin. But both options are covered in official docs by the given link.
For shared hosting environment there is special section too.
And by the way this was asked before many times here on SO, just do a better research.

run GWT on non java server

I think answer on my question is NO. But still, I'm wondering is it possible to run gwt applicaton as frontend for example on Apache HTTPD server. The idea that compiled gwt is pure javascript and don't need java backend (if we don't use java based RPC)
There's nothing stopping you. GWT code breaks down into two parts; server-side and client-side code. As you say the client-side code compiles down into pure javascript which can be easily served up by httpd.
The main advantage of using gwt's classes on the server is that data you request via RPC will arrive in your client code as java objects with no work on your part. But you can easily make calls to any old service using the RequestBuilder class, or XMLHttpRequest if you need more control.
Edit: There is one special bit of configuration you should do to make sure httpd works well with your client-side gwt code:
<Files *.nocache.*>
ExpiresDefault "access"
</Files>
<Files *.cache.*>
ExpiresDefault "now plus 6 months"
</Files>
This makes sure that when you upload a new version of the app users' browsers will download it automatically, but also makes sure that they won't download the entire app every time they visit your website. Very useful.
Your opinion is wrong. You can create a gwt application which is designed only for front-end.
To test that you can do the following
Create a sample gwt application which has only front end content
Compile and build the application
Place the build content folder in your Apache web directory.
Ee : if you created a project called test-gwt, the JS and HTML contents are in test-gwt directory created inside the war directory.
Access the new application through a web browser, like http://localhost/test-gwt
Hope this would help.
That is possible and works like a charm as long as you don't write your server component with gwt.
Here is an simple gwt client only htaccess password app (currently only german) as an example, wich i've coded for fun.
"I'm wondering is it possible to run gwt applicaton as frontend for example on Apache HTTPD server".
The answer is NO. GWT UI frontend does not run on any server at all. It runs only on a browser with Javascript enabled.
But if I ignore the language semantics of the question and answering the gist of it - the answer is Yes. Pardon me, but I think the language you should have written is
"is it possible to SERVE the gwt applicaton frontend from an Apache HTTPD server".
Just deploy your servlet-less war onto the HTTPD (removing the WEB-INF folder).
In fact, you could even write RequestBuilder requests to request for static json streams from files placed in the GWT module development "public" folder. Where the GWT compiler would copy the contents of the "public" folder to the deployed application root.
Or you could use script-include to get your GWT client request for dynamic content jsonp from another server - which would not create any servlet in your app. I documented the script-include technique here: http://h2g2java.blessedgeek.com/2011/06/gwt-requestbuilder-vs-rpc-vs-script.html.

Configuring the webserver on a production site for Symfony

I am setting up my Symfony project on the production site. # this point it states:
This project uses the symfony libraries. If you see no image in this page, you may need to configure your web server so that it gains access to the symfony_data/web/sf/ directory.
Which basically means, I need to get into httpd.conf file and make some changes (for those who have diligently followed the Symfony tutorials, you guys know what I am talking about). Given this situation, I am not sure how I can go about configuring the httpd.conf file on the production server.
Anyone have any strategies around this? Thanks,
Parijat
You can do it by adding symbolic link from your symfony_data/web/sf to web/sf but your web server must follow symbolic links or you can add "Options Indexes FollowSymLinks" in to your .htaccess