Display remote content - Joomla - json

I have a spring MVC app and a joomla "showcase web site".
How can I display data from spring MVC in my joomla showcase site?
My first attempt was to create a simple joomla module with inside jqgrid. But I discovered that many browser deny JSON cross domain and that this attempt is not good.
I also tried with an IFrame.. but I don't like this approach..
The current attempt is to export data from MVC app in RSS. I've installed an rss module in joomla and it works. But it's limited in search and sorting operation.
It would be great to find a way that permit to filter and sort data using some existent and open joomla module.
Does anyone have suggestion on proper export data tecnology and a related module?

#mserioli
You should use the php curl, and in your module you make the request using the GET or POST method to retrieve data (json/xml) from your MVC app

Related

Create a QR generator API for Ruby (2.2.2) on Rails

I have a main Ruby on Rails app, which generates links and associated PDF files. What I want is to generate a QR code for each one of the links, so I can paste them in the PDF files.
I know the rqrcode gem, but my problem is that the app is in Ruby 2.2.2, and the gem works from version 2.3 on. I can´t update the Ruby version for irrelevant reasons, so that´s not an option. So I want to create an API to which I pass the link, and it returns me the QR code via JSON. This API will be in Ruby 3.1.2 so I can use the rqrcode gem. The thing is that in every RoR API tutorials, they configure the storage and many other things that I think are not necessary in my case. I want to make this API as minimal as possible, and I don't know where to start.

Angular 4 app rendering JSON as Server

I made an Angular app and I wondering if its possible that Angular send JSON information like a server.
For exemple I'd like that when we access an URL of my app 'localhost:4200/test', the answer is an JSON and not a HTML page.
In other words, I want to be able to collect data with POSTMAN when I request an route of my Angular 4 app.
Thank for any informations.
P.S: I'm not sure that "RENDER" is the right term because when I look for "Angular render JSON" it's always about display a JSON in an HTML page :/
I could be wrong, but to my knowledge this is not possible. You want your client/browser application to behave like a server. This is not possible as you cannot setup a socket listener in a browser.
If you host your application in a shell like electron it would be possible to start a nodejs server on the local machine. However technically this isn't your angular application any longer.

Need to serve both GSPs and JSON from a Grails 3.1.5 app

I wanted my Grails 3.1.5 app to serve both JSON data using the *.gson format AND, for some pages/URLs I wanted to continue to use GSPs.
I built an app using the rest-api profile.
Then I copied over controllers and views from an other app that I'd built using the web-api.
In doing so, and to be consistent, I also moved index.gson to a different location.
Now I get a:
Could not resolve view with name 'index' in servlet with name 'grailsDispatcherServlet'
Started digging into the viewResolvers that are available in the 3.1.5 code base. It is possible that the rest-api profile configures a viewResolver to look for *.gson files in a certain location.
Is there anyway to configure maybe a CompositeViewResolver that looks for both the views, *.gson and *.gsps?
If so, how can I do this?
Thanks!
I've managed to resolve this issue by adding this plugin to build.gradle:
compile 'org.grails:grails-plugin-gsp'
and with both
profile 'org.grails.profiles:web'
profile 'org.grails.profiles:rest-api'
and apply plugins
apply plugin: 'org.grails.grails-web'
apply plugin: 'org.grails.grails-gsp'
apply plugin: 'org.grails.plugins.views-json'
Apparently, they remove it when you're using REST profile, to reduce overhead, as you rarely render HTML on REST service side.

Creating a server / service client

I have been developing an app that has to access a DB and return data has charts in a web page. since it is to be added to another software i had to create it as a local server / servce, using self host web api, returning the data as json so i can read it in my html file and create the charts.
The server / service works, but my problem remains on the client. I don't know if i have to create another project for my html or if i just add a folder with my html and all css and javascript.
Basically when i run it i have to display my html file.
I have been looking the web for examples / solutions but i can't seem to find one that will help me, i've checked:
creating help pages with T4, but it includes all my css and js files in my html and when i want to change something i have to remove the include, debug and include it again;
create a web app but when i run it it creates me 2 servers, the one i've created and the web page server, although my web page will access it using angularjs, i can't have the second server;
I'm a little lost on how i will do it.
Can someone give me some help?
I'm using VS2010, self-host WebApi, console app, entity framework, angularjs, nvd3 and d3.
thk
If you have developed your project using MVC4 you can create view/controller related to report in webapi project.Point add html files to this view.This won't create 2 servers.

How do I get a largely HTML site generated from a rails app?

I would like to create a Rails 4 app, where some data is entered into the db via a form and when it is published, any changes on the site are compiled and the entire consumer facing site is just a bunch of flat HTML files.
That way, on each request there isn't a db request done and just a simple HTML file is sent.
This is similar to the way Octopress operates, where you write a blog post locally and when you do a deploy it basically compiles the entire site into a large set of connected HTML files that are then pushed to your host(gh-pages for instance).
Is there a way to use extensive caching or something similar to get the same effect in Rails 4 or should I go about it another way in Rails or should I just try to customize Octopress for my needs?
Have a look at page caching, it has been moved from Rails to a separate gem
https://github.com/rails/actionpack-page_caching
It saves the generated HTML files to a specified directory which you should be able to deploy separately from the rest of the application.