Conversation scope from Springfuse - spring

Has anyone tried using the Conversation scope implementation from Springfuse? JSF2 Conversation Does it work well? Any use cases where it doesn't or issues encountered?
The link to browse their projects on Github is broken, but if you use their main page to generate a Primefaces, Spring and JPA project, the Conversation code is in there.

yes. We have been Springfuse conversation for little over an year now. It is very lighweight and doesnt need Spring web flow. It may take a while to get used to it as you dont have many samples examples except the auto generated code and a blog (http://www.springfuse.com/2013/03/05/jsf2-conversation.html). But it is worth having a try.

Related

Spring Controller get Variables from a different Website

I was wondering what would be the best way to achieve the question that I have posted? So for instance if I pressed a button it would go to the controller which would go to this address https://www.premierleague.com/results and then in this address it would get the home team name and away team name. Would this be possible via Spring. Which I can then save into the database.
Is there any tutorials, that people know off that could answer this question?
Cheers Jeff
You want to perform a http-query against another REST-Service within your application, which of course can be done.
I suggests you to look into this tutorial by Spring: Spring - Consuming Rest
This one should get you started on how to use the built in http-client of Spring.
Edit: The url you posted of course serves a complete website, its not a REST-Endpoint. If the premiere league offers an API, you should use that. If not you can of course request the whole webpage and scrape it for the information you need.

Why isn't the Spring Statemachine project listed on the home page of the website?

I recently thought of deep-diving into the various Spring projects, after seeing first-hand the tremendous utility provided to a project in my workplace. We used the Spring Statemachine project to implement a shopping cart lifecycle. This was a suggestion made by one of my colleagues while looking up code samples to implement the State Pattern in Java. Additionally, I've independently used Spring for Android to implement my first Android App.
However, on visiting the Spring homepage, I wasn't able to see the Spring Statemachine project listed there. Additionally, it wasn't mentioned in the offline documentation, either, despite there being a copy of the same.
I have two questions from this:
Where could one find a full listing of all the various projects provided by Spring? I tried consulting their Github page, but (for example) a filter on repos by "Kafka" returned two different repos (FYI, the project page redirects to the second URL). I was hoping for a comprehensive source like the Wikipedia page on all Apache projects
Why isn't the Statemachine project listed on the homepage? Is there some criteria which results in some projects being listed there, and some not?
Thank You
It's on its way to the main projects page as not long ago it was still kept in incubation. We're just waiting for a logo.
You generally see all projects which have created their own page in docs->Reference Documentation reference docs

how to use signalr across multiple projects

We have a customer waiting system where a customer can report in and sit and wait. Our advisers have another part of the system where they can see the queue and pick a customer and call them up.
In our solution we have a project for the customer sign in screen. The touch screen project is mvc and has a controller action to raise a new ticket to the database.
We then have another project that is for our advisers screens. This looks at the same database and again is MVC. There is a controller action to get latest tickets from the DB.
What I want to do is use signalr to inspect when a ticket is created by the touch screen and then report that back to the connected client machines in the advisers project.
How do I structure that? Do I create a new project called signalr that has references to both projects or do I need to put my hubs etc in one or other of the existing projects? Also is this even possible across multiple projects?
I looked in to sql dependency to track changes, but we are using EF ORM and I couldn't wire that up.
many thanks
I suggest you to take a look at the following docs,
http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/introduction-to-signalr
https://github.com/SignalR/SignalR/wiki/SignalR-Client
I hope this helps.
#Dani: Those are excellent resources.
I believe what you are doing is a very plausible use case for SignalR.
To answer your first question: You don't create a SIgnalR project, per se. You add a reference to SignalR in an existing project. Therefore, it's possible to use SignalR across multiple projects.
Your project where tickets are created would probably have the full SignalR reference because it would be the one to fire off a 'broadcast' to the Advisors that are currently connected. However, the Advisors project would only need a reference to the SignalR.Client because all it would need is to connect to the SignalR hub and await new tickets.
Adding my own solution here because the current answers don't really answer how to approach setting up SignalR across projects.
I essentially had a console app that needed to talk to an MVC app, so I was confused about where to put the hub. The console can't be the hub because it doesn't have an http address that the MVC project's JavaScript can point to. The MVC project couldn't be the hub because then it would have to be referenced by the console app, which coupled the two too tightly for my liking.
The solution was to use a 3rd web api project as the hub. Example from Brad Wilson on how to do that here.I could point my JavaScript there as explained here, and the console app could make POST requests to the controller there that sends messages to the hub.

ASP.NET Web-API Help-API Generator?

I am wondering if anyone can point me to which Web-Api Help Generator I should use.
I found this post but it is already a year old and seems to be outdated.
I think ApiExplorer is now Web API Help.
The post also talks about Swagger which from some demos looks a lot nicer and seems like you can do like post requests and such but I am unsure if it still in development as it's been like a year since the last update.
Anyone have any experience with either of them?
The "Web API Help Page" package (Microsoft.AspNet.WebApi.HelpPage) is built on top of ApiExplorer.
Web API Help Page generates documentation pages and adds them to your project.
ApiExplorer gives you a lower-level API that just gives you the API descriptions, which you can use to create documentation.
See: http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages
I haven't used Swagger. From the readme, it's also built on top of ApiExplorer.

Spring.NET with MVC3 (Razor)

I'm experimenting with ASP.NET MVC3 Razor and I'm fairly impressed. This is the way we'll go.
We use Spring.NET for dependency injection in our framework and I wonder, if it is possible to use it for MVC3 projects as well?
The documentation of Spring.NET is only talking about MVC2, but I guess there will be MVC3 support in future release. Nonetheless I was trying to get it work though. With no success so far.
So my question is, if someone else found a way or workaround or trick to do dependency injection in MVC3 using Spring.NET and if so, how?
I know this is a very general question, but even a honest "sorry this is definitely not possible" or "it should work without any modifications" would help me a lot.
Thanks in advance,
Jan
Yes, even though the the latest Spring.NET release (1.3.1) has explicit support for MVC2, it can also be (pretty easily) used to support MVC3. The IDependencyResolver interface introduced with MVC3 makes IoC integration significantly more straightforward than it had been in the past (offering just one single interception/pluggability point for type resolution where previously there had been multiple places you needed to intercept type resolution calls).
See blog posts like this one: http://blog.alexkyprianou.com/2011/03/07/using-spring-net-with-mvc-3/ for more information and suggestions on how you might go about doing this (its really quite simple compared to the effort/complexity of doing so with MVC1 and MVC2.
It should work without modifications.
After some more investigation and help of colleages I found out, that Spring.NET works with MVC3 - at least as far as I can see it now. My orignal problem was a misformatted xml-file for my injection objects (I didn't post the code in the question).
Still there seem to be issues with object scopes. The scope request doesn't seem to work, since all my objects are still singletons and once created, can not handle more than one request.
I tried to add the well-known attribute singleton="false" and it worked somehow, so my objects will now be created on every request. Good!
However I found out, that Spring.NET's example Spring.MvcQuickStart.2010 also uses the singleton attribute with value false, so probably this is the correct way (and true by default).
I don't know yet, how to handle the session scope, but at least my web application works for requests (singleton="false") and application-wide (no singleton attribute) with Spring.NET and MVC3.
Best,
Jan

Resources