I'd like to build an application using smartgwt and web2py.
I am new to both.
Ultimately what I would like to do is display objects obtained from a web2py backend in a smartgwt TileGrid.
Can anyone enumerate the broad strokes of what needs to be done? Or point me to any useful resources?
Any information that would apply more to django is also welcome.
download smartgwt (excellent framework by the way) and look into this example:
file://localhost/Users/massimodipierro/Desktop/smartgwt-1.0b1/samples/Showcase/www/com.smartgwt.sample.showcase.Showcase/index.html#tiling_load_on_deamnd
which displays images in a tilegrid. The images are received from Yahoo via an http request. The response is in JSON. Look into the source code. To see the json response from Yahoo try the following URL:
http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&output=json&query=snowboard
To make this work with web2py you need to replace that URL with the URL of a web2py action that returns a similar JSON response.
I do not know much about smartgwt but I am sure on the web2py google groups there are people willing to help.
Have a look at this tutorial on using web2py with Pajamas, which is another library built on GWT.
Related
I want to develop a website in which users can have video chat and they can connect to other user anonymously without had been added by the other person as friend. I also want that all the active users list is displayed on the website. So somebody please suggest me how can I implement it on django?
You can use a third party service for this. Or you can use WebRTC. There are some nodejs packages which can help you do this. I like "EasyRTC" for that.
Or if you want to use Python, you can use Twisted. Here's a tutorial (found on Google, not tested by myself - https://ferretfarmer.net/2013/09/05/tutorial-real-time-chat-with-django-twisted-and-websockets-part-1/)
In essence, Django doesn't handle the video streaming/chat part. You can use Django for authentication and serving the required html and other stuff. But the video chat needs to depend on other services.
If you are looking to create a video calling and chat application using django, django_channels, you can refer to this Github Repository .
It also tells you how to deploy your app to google app engine flex with Redis instance.
It took me a long time to build this, so I created a detailed basic public repository to help someone like myself and for future reference.
It might be a silly question for many, but why can't I instead
Create a view in django that takes a request and returns HttpResponse in, say, JSON format
Map the view to a URL
Hit the URL from my browser or another server and use the result?
Thanks.
EDIT - Two approaches: Import some djangorestframework or tastypie and build an api in my application which will throw json responses VS building a view and tell it to return json response. Is there any huge advantage of using the first one?
I think you could make the same argument about any extension library. It just depends on how much you want to rebuild and what the existing library has that would be beneficial to your project.
Many times I've created custom endpoints without an API library when working with ajax requests inside my project. For that instance, using an API package is overkill. But for having a full API server, Django rest framework offers a lot of functionality.
Sure, you can make views that do what you suggested. But at some point are you going to want to authenticate through an HTTP request? Are you going to want to filter? Are you going to want to make permissions, or just have all endpoints open? Are you going to want to protect against CORS?
You can kind of go down the list of all the features of an API library and ask these questions about what you want to accomplish with your project. If you're working with any type of external application and your django project is just for an API server, usually it's best to go with Rest Framework. If you just have some one-off endpoints to receive ajax requests, usually you just want to build custom endpoints.
I successfully implemented bing maps api in my ember-cli app but everything is in the index.html file, so what I would like to do is implement bing maps in a component to be able to change the longitude and latitude variables with values I get from a fixture or json. How would I be able to do this?
I don't really know ember-cli except from what I've read while looking to help you on the web, but it appears that it is web application, so you will be able to use the Bing Maps AJAX V7 control.
To get started, I would recommend to go through the MSDN articles available from Here: https://msdn.microsoft.com/en-us/library/gg427624.aspx
Let us know if you need any more help cause your question is somewhat really not precise.
I managed to do this and created a simple bing map addon for ember-cli, for the benefit of everyone.
Here is the link for anyone interested.
My situation: I'm working on a web monitoring dashboard that assembles informations from different applications and sources and generate graphs, info graphics and reports.
The applications I'm trying to integrate are CACTI, Nagios, and other local private monitoring tools. I had no problem to integrate these applications, except for Nagios (I don't have much experience with it).
What I want to know is if there is a way to use Nagios as a Web Service, or something similar, so I can expose some of the informations and use it to generate my own reports on my dashboard application.
Is it possible to do that without any epic effort?
thanks for reading.
Nagios 4.x starting with version 4.4 now includes CGIs for JSON output. Installing the newest version of Nagios might be the easiest way to go.
See the announcement here.
Review the slides from Nagios World Conference 2013 here.
The Check_MK Multisite GUI (Web base GUI using MK Livestatus) offers a web service mode, where you can send queries/commands as URL parameters and get the response as JSON in the body.
The trick is: Create a view in the GUI, which fits your needs. Then extract the URL of that view and add the parameter output_format=json. Now you should have the output in a parsable format.
For example, this URL should give you a JSON list of all services:
check_mk/view.py?view_name=allservices&output_format=json
You can try:
1) MK Livestatus http://mathias-kettner.de/checkmk_livestatus.html
it's not web service but it can give current data without any complicated action. All you need redirect this data.
2)status-json plugin http://exchange.nagios.org/directory/Addons/APIs/JSON/status-2Djson/details which return data in JSON format.
3)NagiosWS plugin but I wasn't able to get to work it yet. I think it can be done for Nagios 2.x
4)GroundWork Foundation plugin. I think I will try use it now.
I was able to get to work 1 and 2 solution now.
Otherwise you can use Icinga which can give you some JSON or XML output. Icinga is fork of Nagios and can be installed with saving all your nagios data and plugins. At least it written on Icinga's site =) They have some other solution like PHP lib.
Sorry, I cannot post only 2 link while I'm newbie on this site.
Best regards.
Worked for me - MK Livestatus http://mathias-kettner.de/checkmk_livestatus.html it's not web service but it can give current data without any complicated action. All you need redirect this data.
I want to connect to an external API from my joomla website.
The external api is a reservation system which I would like to view info and update content. They have provided a URL for testing as well as documentation of the various functions available.
Not sure what to do from here. I have built many Joomla components before but never had time to learn XML-RPC and how it works.
I have looked at mastering Joomla 1.5 extensions and framework development but couldn't get what I wanted from it. Any help appreciated.
If you have built MVC components in the past, then the hard part is done. XML-RPC is not all that different from a typical cURL request in that you build a set of parameters that are sent to a remote server that then returns a response. The main difference is that the request and response are formatted in XML. There is a pretty good overview here - http://www.phpbuilder.com/columns/luis20010329.php3?print_mode=1
If you want to connect to an external link from your joomla, you can modify the link type (menu item) to "wrapper" (Displays an iframe to wrap an external page or site into Joomla! ), when you are done, in the right side there are some Basic parameters, you can write there the link, and add the width and height to it.