Currently I am involved in different projects using mainly Java Spring and PHP Laravel. In my work place (ASP.NET based technologies) it is common to use this approach of retrieving the content from the CMS and I could see all the beneficts that it provides so I would like to make something similar but in Java Spring (optionally if it works for Laravel, that would be awesome, but it is just optional).
What I desire:
A CMS based webpage just to upload the content for different projects in a well organised way.
The content is going to be mostly "Strings", HTML and pictures.
From different projects, I am able to connect to the CMS and retrieve this content in the views.
If it is possible, open source or free solution.
I already searched for different options, but I was not able to find any good solution or some tutorial of how to actualy do it and not just the ideas...
Thank you so much in advance.
Best regards.
Jose Lara.
Take a look at Spring Content. It was designed to be paired with Spring Data to allow you to build bespoke headless CMS very quickly and easily. Moreover, unlike most other CMS's on the market you can choose what component to build it with so you can choose newer cloud-native databases and storage.
Related
i'm working on a project which needs to support internationalization.
the solution we thought of is:
create HTML templates with placeholders for language (i.e. home.html).
create an i18n directory with files such as: "language_en_GB.json".
on the build process have them merged together to create an output HTML. the output file will sit on a language based directory (such as "views/en_GB/home.html" or "views/fr_CA/home.html").
so basically this:
<h1>{{i18n_welcome}}</h1>
<h2>{{userName}}</h2>
merged with this:
{
welcome:"Welcome!"
}
will become this during a build proccess:
<h1>Welcome!</h1>
<h1>{{userName}}</h1>
i have a few question and appriciate your input.
is this a good approach for i18n?
do you know of a templating engine that does that i18n process well?
is there a solution for client side "baking". i would like a UI developer to be able to bake localy as well.
There are several frameworks that support i18n out of the box depending on your needs and what you are currently using in your code. As a pure templating engine, you can take a look at Velocity or Freemarker. For a more complete framework, you can look at Spring and Spring example and Struts and Struts2 example.
There are, of course, numerous other options as well. I'm just listing four of the most popular that I've seen people use.
Basically, for any of the frameworks, you create resource bundles for each language (named using the language for the specific bundle. Ex: language_en_GB.properties). So your thought process is pretty much in line. Basically you start with your html file and include your placeholder. In your resource bundle for each language, you specify what the string is supposed to be. After that, the framework does the merging on the fly for you, using the appropriate resource bundle for the language in question.
So you're pretty much on the right track - it all becomes a question of integrating properly with your framework and leveraging it to do the merging instead of doing it during your build pipeline.
You failed to provide the necessary details, so I can't really answer your question. I can only say that what you plan seems to be another wheel re-invention (but not as round as original one).
There are certain i18n best practices. In Java world it usually mean using Resource Bundles (in form of properties files) and some mechanism like JSTL to translate them when the page is being rendered. This is the best approach, as you won't need to re-compile anything to introduce the support for another language.
If you care about providing support for client-side scripts, it is usually done by writing out some array from the web page and accessing it on the client side. I think this is the most common solution. Another would be having some web service to provide you with translations and read it via XHR (i.e. AJAX), but that may be problematic. Anyway, you need to push the translations from the server side to the client side somehow.
And of course you need to read them from resource bundles.
From what you wrote it seems that you want to build some kind of static web page, backed by the application server (thus static web pages compilation). If I guessed correctly, honestly using Java for it is a bit overkill. You'd better go with some CMS software like Joomla, Drupal or jEase.
I am planning to build a simple document management system. Preferably built around the java platform. Are there are best practices around this? The requirements are :
Ability to upload documents
Ability to Tag documents
Version the documents
Comment on documents
There are a couple of options that I am currently considering. The first option would be a simple API on top of SVN or CVS and use a DB backend to track tags, uploader, comments etc
Another option is to use the filesystem. Version the documents as copies in a versions folder and work with filenames.
Or, if there is an Open non GPL'ed doc management system, we could customize it to our needs and package it in our application. Does anybody have any experience building something like this?
You may want to take a look at Content repository API for Java and the several implementations (some of them free).
Take a look at the many Document Oriented Database systems out there. I can't speak about MongoDB or any of the others, but my experience with Couchdb has been fantastic.
http://couchdb.apache.org/
best part of it is that you communicate with it via a REST protocol.
The best way is to reuse the efforts of others. This particular wheel has been invented quite a bit of times.
Who will use this and for what purpose?
Is it possible to develop an application easily available on the web that also can be distributed on DVD (installer or started from the dvd)?
For the moment, we use static html (frameset!) pages (generated by xml files), with one difference: pdf's are only on the DVD version, the web version only shows a preview of these files.
Can this be done with JavaFX, OpenLaszlo or are there better options?
(for example: turbogears, and using tg2exe for DVD version)
I think if you design it correctly to begin with, a JavaFX app can be interchanged between web-app and desktop-app relatively easily. However, I've only done this with very simple apps (specifically, Tic-Tac-Toe!), so I'm sure there might exist some caveats that I am unaware of (thus the "design it correctly" catch-all). ;)
Why don't you just provide the PDFs in your current web version, rather than redeveloping everything? I'm not aware of any browsers that don't support in-browser PDF reading anymore.
Yes JavaFX or Flash applications can be used to develop applications that run in different contexts.
However, it's not clear from your question why these would be preferable over your current solution.
If the information your sharing is primarily text and you're using DVD because your audience is primarily located in area with bad Internet connectivity, then you're current approach probably makes more sense. JavaFX or Flash might be more fun to write for developers but maybe doesn't serve your audience.
I would suggest that if you are shipping DVD and are looking for ways to make the DVD more useful than as a PDF delivery system would be to add video to the DVDs. And then maybe it would make more sense to use JavaFX or Flash to drive the UI.
Yes, it is possible. If you use JavaFX you will be allowed use multiple deployments. For example, NetBeans 6.7.1 with JavaFX creates several possible deployments from one project. Then you can publish this application on web, DVD, etc. You will need to slightly customize standalone deployment for DVD to be able e.g. start it as autorun if necessary. JavaFX is good choice.
This seems like a job for flex, however I know better little about it to give a better answer.
I have recently written a Hello World application using SmartGWT and noticed that the size of the application is huge. In my case it is over 600kb just for that application.
I think that size is obscene so I narrowed the culprit down to two core libraries, ISC_Core and ISC_Foundation which combine for a total size of 649kb. Is there anyway to reduce the bloat of these libraries?
Any help would be appreciated.
SmartGWT is not designed for Hello World applications, but for sophisticated enterprise applications that work with lots of entities and have lots of screens. In that use case, the final delivered size of a SmartGWT application is comparable to, if not smaller than the size you would get working with any other technology.
Basically if you tackle a larger-scale application with a flyweight technology, you end up with application code that re-creates the features that are already in SmartGWT. There's no bloat - SmartGWT is very compact on a features-per-byte basis - there's just more features.
If you really have an ultra-lightweight use case - say, adding minor interactivity to a web site that consists mostly of static content - then JQuery and other ultra-lightweight frameworks are the way to go. A lot of enterprises use a mixture of JQuery and SmartGWT/SmartClient, each for different purposes.
Unfortunately you cannot, as SmartGWT have already stated here the size will remain constant or even increase. I tried SmartGWT but because of this issue and 3rd party framework integration problems I chose another framework.
A possible solution to their problem would be to introduce a dynamic JavaScript loader like is present in ZK. I have used it in my enterprise projects and it works very well.
Nowadays for smaller applications I tend to use jQuery directly.
As Charles stated you have to keep in mind that you actually build a rich client on a single HTML page, so it's loaded just once. You can preload the libraries on a login page where nobody notices it while he is entering the credentials.
Take a look at http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#group..networkPerformance
If the foot print is really important to you, you might consider Ext GWT. Ext GWT has everything done in Java (and compiled with GWT). It techincally could remove the codes that your application doesn't count on.
After seeing some of the benefits of GWT, my partner and I decided that it would be a good front end for the web app we hope to build. A main part of this web app will be content management. We were hoping to use a CMS framework and put GWT on the front end, but all the open source CMS systems we find seem to be very tied to their front end.
Does anybody know of a CMS that would work well with GWT?
I think it all depends on how much integration you want, specifically, what you want to do with GWT. We have successfully integrated GWT with Documentum + Java on the back end.
With that said, our integration is fairly light. The site is largely a content oriented website, but we use GWT to:
Implement certain more dynamic widgets (e.g., text box with intelligent auto completion, font size changers).
Enhance content in the CMS to make it more animated (for instance, instead of displaying lots of content in a single screen, we use GWT's tab panel to display chunks at a time, while still allowing content authors to manage our content).
Implement "mini-apps" within the site.
Unfortunately, since this is something I do for a client, I cannot specifically mention the site by name in public, but if you're interested, I can share some details with you via e-mail.
No, but I can tell you that using a Java based CMS will make your life much much easier. GWT lives on RPC calls, and while translation / JSON overlays are possible, you're much better off with a Java backend.
You mind find this difficult, though, because when you want to use GWT you're doing a massive amount of work on the front end, leaving the backend mostly data processing and storage. Since very few CMSs are designed to do nothing more than processing and storage, you might be better off building your own.
That said, you might find it very easy if you're open to using App Engine. The GWT + App Engine stack works really well, now has a great Eclipse plugin dedicated to it, and is free to get started with.
Try the Nuxeo CMS/EMS, which is implemented in Java. Search google for "nuxeo", and also search for "nuxeo gwt" for a variety of tutorials on integrating GWT with Nuxeo.