How can i intergrating a website with Optaplanner (html,javascript,php)? - java

Im developing a scheduling system that the user must be able to go online login to the website and feed schedules in pdf that will be received by optaplanner which will schedule the resources and return a grid that the user will be able to interact with dynamically. My question is how can i integrate my website with planner.I will appreciate your insight?

There are numerous approaches on how to tackle this. Check out the webexamples and their source. One of the approaches for integrating OptaPlanner in a web-app could be:
create a Java EE web app (for deploying on a application server, f.e. Wildfly, Websphere, ...) with OptaPlanner as a dependency (see the docs for more info)
create a few Servlets that handle login, uploading the PDF schedules, storing them
create an EJB to convert the PDFs into a into a OptaPlanner problem description you implement on the back end (see the integration chapter in the docs and how our examples handle the problem
create another EJB to handle the actual solving (run the solver, wait for the results, notify someone)
create a few Servlets to interact with the solution
Do note, this is just a general outline: there's a lot of things left out for brevity (security, persistence details, etc.). Also, there are currently efforts to build an OptaPlanner execution server, but it's definitely not production ready yet (as of March 2016).

Related

Building Java Web-App with Vaadin in AWS

I have to write a (java) web-app, which fetches data from an AWS RDS Postgresql Instance, and renders the data using Vaadin Charts. So my two constraints are: (java) based, and using Vaadin to do so.
Thing is, I have never developped an form of web-app, and am complettely lost. I've read stuff about maven, spring, gradle , containers and am safe to say, have absolutely no clue where to start...
Could anyone point me to some complete tutorials about how to developp web aps from the ground up? everytime I google something I read something different and am completely overflown by information...
If you want to start with something working ASAP you can clone existing repos with vaadin examples. You will have existing code that builds, manages dependencies, starts webserver etc:
https://github.com/vaadin/dashboard-demo
https://github.com/vaadin/book-examples
https://github.com/vaadin/spreadsheet-demo
All the rest is probably opinion-based like should I you use maven or not? etc.

Liferay integration options

We have an existing large Java Web Application that is clustered across many servers. We currently store our Word documents within our Oracle/BLOB and would like to move to a CMS solution like Liferay. Ideally we would like to present our users a view of their directory/file within one of the pages of our existing application and implement some workflow on top of Liferay within our application.
I've been reading the Liferay documentation to get a good feel to how best integrate into an existing Liferay/CMS server and from what I can tell the only way is via Portlets and or IFrames. So the integration happens in the GUI of the application.
We were hoping to integrate with Liferay within our Server calling SOAP/REST/JSON calls and then taking the results and displaying it within our application.
Could someone educate me on if this is feasible and if it is where I could get further information regarding this?
Yes, you can integrate just at "view side", but a good choice consists in usign Liferay ServiceBuilder.
It is a well documented Liferay's framework available for any custom portlet you want to write, allowing you to:
- automatically create a ready-to-use persistence layer (db DDL, ORM, cache configuration, transaction ecc...)
- expose local (in the same VM), remote (in the same VM, or by SOAP/REST/JS API/Mobile API) functionalities
You can surely combine both functionalities together, but you are free to use just one of them.
If it was a my choice, I would create a LR service wrapping the call to your external datasource.
In this way it will be able to partecipate in a distributed transaction (simply configuring a distributed transaction manager), to configure access to resource by using LR permissions framework, to be compliant with any kind of LR taglib (as SearchContainer: it should be very useful for showing a list of item)... and everything without the necessity to configure anything.
Several ways for achieving what I said are available... with a simple Google search I immediately fiund this guide.
Hope it helps.
Liferay allows you to write your own custom document store. You will need to implement few interfaces and configure LR to use it. That should do it. You can look at com.liferay.portlet.documentlibrary.store.BaseStore and com.liferay.portlet.documentlibrary.store.DBStore to understand how it can be done.
Thanks

Viability of having a multi-page GWT app

I know MVC and MVP for GWT application, my question would be not be about creating "multipage MVP app."
My question is about the viability of creating a GWT application with multiple pages (i.e multiple HTML files) for the actual web app (app.html) and a admin app (admin.html)
In a typical GWT MVP app this can be done by just adding a "page" or "view" however this can make the nocache.js bloat and will just make the whole application load slow (based on experience)
I saw this abandoned project: gwt-multipage which allows a GWT app to be multi-paged. However I want to know if this kind of approach will also just bloat the nocache.js file?
You seem to want a separate Admin module/app.
See this StackOverflow response for an architecture to accomplish.
One way to solve your problem is to use code splitting. It allows you to have a single host page without having to download all the code at startup. You download additional code when it is needed.
I assume you know that you will lose all GWT state when you switch between those pages right?
I don't have a chance to look at the gwt-multipage project right now but what you're asking for implies also having multiple entrypoints in your GWT app (one for the users page and one for the admin page). Since each GWT module can only have one entrypoint, you'll need to create an additional module for the admin page. I know this doesn't answer your question completely but if I was you I would look further in the direction of how to define different GWT modules.

Update Center and Database Change Management for Web Application

We have a web application that uses Spring/JPA/Hibernate. Currently we are using SolidBase for database change management, which works well in a managed deployment model - however we are now migrating to a non-managed deployment model where users will be able to download the web application. We are building an "Update-Center" type functionality for the web application and are trying to figure out how we should apply database changes.
Ideally, I would like the application to apply any pending database changes at application startup and I would like this to be something that we can code pro grammatically but I don't want to rewrite Hibernate's SchemaExport functionality to do it.
Does anyone have any recommendations, patterns, or best practices on how we can best implement this functionality in to our application?
Is there any update-center application libraries that will solve our problem (I haven't been able to find a single one)?
I discovered this article while researching this
http://www.infoq.com/news/upgrade-frameworks
This led me to this post
http://www.jroller.com/mrdon/entry/transparent_sql_schema_migration_with
Which ultimately led me to rolling my own solution to this problem using Apache DdlUtils and the BeanFactory solution offered in the jroller.com blog post.
This ultimately will be a component that can be dropped in to any application, legacy or new to implement update functionality into a web application. It will use XML to apply database updates and with the use of DDL it means that the package will work against any supported database. The updater will also support updates to filesystem resources and data itself (as opposed to schema)
I do not work for BitRock.
This may not be exactly what you are looking for, but I have used InstallBuilder from Bitrock to manage these types of updates for distributed applications. This is the same installer package that the PostgreSQL team uses. It was pretty straight forward to get this working, with minimal headaches. Especially when compared to other installer programs.

What web frameworks can be used successfully on Google app engine? What about Struts/Spring?

I'm interested in porting an existing application which was written using Spring/Struts2/Hibernate to GAE. I didn't read many successful stories about that so first of all I'm wondering if it is wise to use any of them there. I want to get rid of hibernate and to use the google data store instead since it's obvious hibernate is not a good choice on GAE. So my main questions refers to Struts2(webworks)/Spring. My app uses simple JSP pages, no other template mechanism.
My question refers to the following aspects:
Currently each page has struts actions associated. Each request is taken by struts dispatcher an then it is dispatched to specific action class after which it invokes a specific jsp, according to the config file.
Everything is instantiated by Spring(actions, factories, hibernate layers,...)
The security is managed through a Spring Security(former acegi).
My first impression is that I should get rid of Spring because GAE should manage all the objects in order to work in a distributed environment. I have a few antagonistic thoughts regarding Struts. However, if I get rid of them ,I'm not sure if I should do it and in case I will, what to choose instead. Is GAE good enough to provide all the things I needed? I assume instantiation should be handled by GAE to have a truly sclalable solution. What about session management, security & user privileges? GAE provides good mechanism to manage them behind the scene or I should manually handle them like in a classic jsp solution? Will I end in having a huge web.xml?
Are there any frameworks that fits well in GAE and which can replace Spring/Struts? I would be interested to find out from someone who experienced those problems in GAE.
Here is a list of frameworks which are known to work or to have issues:
http://code.google.com/p/googleappengine/wiki/WillItPlayInJava
In general Hibernate will not work, but you could potentially use Java Persistence instead. Struts should be OK, but Spring Security is not fully compatible while other Spring parts are fine.
As far as I know, Struts is generally a layer over standard Servlet API - so it should be running without many changes. Spring also is not a problem, in fact, on the web there are many blog entries about spring on GAE. Hibernate - yeah, better use JPA.
If you want to rewrite whole app, you can always go with GWT, even with Spring ( GWT/GAE Spring IoC powered )

Categories