Simple CMS functionality like wordpress - java

I need to develop simple CMS functionality, it supports multiple pages with static HTML ( with WYSIWYG editor)
To keep it simple, I can save the content in DB and give an ID to the page and permalink.
For every request, take the permalink ( from URL) and serve the content read from the DB.
While this is not efficient, I can think of following approach,
In the start-up and while editing, load the content and push it to the CDN server with permalink path. But, it increases the development efforts.
I have following questions based on above
1) Is it good practice to save the HTML content in DB, if not what are the alternatives ?
2) How does the Wordpress does this, So I can take design clues ?
3) Is there any very simple CMS product that I can customize, I cannot use wordpress because it has too many features, It would be better to develop the CMS rather than maintain the wordpress huge code base ?

Saving HTML in DB is perfectly fine and AFAIK WordPress does it that way.
If you would do it by yourself you can provide some cache in files (e.g. for content visible on main page).
Anyway I would prefer WordPress, since it has e.g. anti-spam filters, sitemap generations and so on. And you have all updates for free, what is really important.

As seen, saving HTML in the DB works. But definitely not the neatest approach for saving an entire page/template.
You should check out CouchCMS. The developers made use of #stacker's approach. They introduced custom tags which can be used to declare variables within templates and then the content of the variables are automatically detected and can be saved in the database using the CMS.

Related

Using Java Spring with Headless/Decoupled CMS

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.

Which is preferred in professional java applications SQL in jstl or in the servlets only

Okay Guys, just a little of a professional question here.
I am building a web application for a small company. The language I am using is java for a couple of reasons, one because it is my home language, two because of the amount of data and scalability that the application will need in the future.
My question has nothing to do with my language choice but more with the implementation of a few ideas. I am building an appointments calendar, and current events table, as well as a Data Driven bar, bubble, and plot graph for the amount of traffic that current events are getting.
I will be using long polls to keep the view current with the database.
My question is in doing this should I build a class to take care of the query and just reload the entire page every (N seconds) to get the updated data, or should I build the long polling into the div using jstl sql query to keep the data current and only reload the div every (N Seconds).
I understand if this is considered a weak question, but I am honestly learning this as I go and you guys have always been a great source of information.
So Far I have tried passing to a servlet to reload a page instead of reloading directly on the page by just reloading the div, I like this approach because it allows me to separate out the processes and leave the web stuff with the web stuff and the data in the model, what I am not liking about this is that you can see the flicker of the page load when you update the information.
I haven't tried the use of this technique in the calendar yet or with the bar graphs because honestly I have been racking ideas on how to approach the issue first, I want to try just refreshing the div instead of the entire page but if I am using a servlet to do that I won't be able to do so I will have to reload the entire page. I therefore would be using the jstl query tags to accomplish this, but I am not 100% sure that this is the practical and professional approach.
SQL does not belong in JSTL or any other view.
I don't think SQL belongs in servlets either, unless you package and deploy them as separate REST services. They should stand on their own and not be tied to any web UI.
User interfaces come and go; services and back end data evolve more slowly.
The current fashion would make web user interfaces using HTML5, CSS3, JavaScript, and jQuery as the basis. (You can layer on top any framework you like.) The back end would be REST services.

Using GWT with CMS (like Vosao)

I have a working website built completely with GWT. I want to test it to be used in a CMS; since using a CMS is likely to be the way for easier maintainance in the future instead of having to rewrite code so much.
Here's the reason why I use GWT:
Don't want to write JS code and manipuate pages using JS.
Most importantly I want to reuse my dynamic widgets, like the Flextable I use to populate the products page, instead of dealing with CSS and template (and stuff like that)
Bottleneck with this is that is quite not easy to use with a CMS (like Vosao)
What is the proper strategy on using GWT with a CMS?
When your site begin to grow in size and complexity.
Page counts number in the hundreds, rather than the few.
The CMS begins to become more of an application platform to achieve specific communications and informational objectives.
See this also for more discussions :GWT with a Content Management System

Create HTML Reports with JBoss?

Are there any libraries (built-in or third party) for writing .html reports with JBoss apps quickly and easily?
I have a list of entities in a database that I want to display in different tables. There will need to be things like links within the report to go from some parts of the report to other parts, sorting/paging, and some nice CSS to make the report pretty would be nice.
I have an existing application that produces the .html and .css programmatically, but due to the huge size of the data (124Mb in some cases), the writing of the .html takes way too long (40+ minutes) and often freezes up the browser. So I am looking for an alternative.
I guess one solution is to write JSF forms that fill rich tables with bean data, but I am not sure if this is the best approach.
Replies highly valued! Thanks
Have you looked into JQuery? It offers large number of plug-ins to achive pagination, tables, sorting etc. and it sound like it might be a good fit for your case.
JasperReports is open source, flexible, and perfect for my needs (I am reporting using xml data, and a simple transformation will be perfect to JSXML format to produce reports in this way).

newbie: how to access content from a shop/catalog like website?

I like to access some data from web pages that are arranged like a catalog/shop from an android app.
For a concrete example: This is the URL for Amazons listing on Mark Twains books:
http://www.amazon.com/s/ref=nb_sb_noss/180-5768314-5501168?url=search-alias%3Daps&field-keywords=mark+tain&x=0&y=0#/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=mark+twain&rh=i%3Aaps%2Ck%3Amark+twain
1) If I have the above URL how do I obtain e.g.
the number of entries and
for each entry the line with the title (and maybe the image)? Which probably includes how to iterate through all the follow-up pages and access each entry.
What is the best (correct + compatible + efficient) way to do this?
I got the impression that jquery might be of use. But so far my knowledge of HTML and Javascript is just about basic.
2) How to query for the URL for all of Mark Twains books?
3) Any suggested readings for this and similar kind of topics?
Thanks for your time and have a good day!
Thomas
You would be very well advised to not "screen scrape" other web sites. Besides being difficult to maintain (as the web site changes, etc.) - this will actually be against the terms of use / service (TOS) for many web sites.
Instead, see if the desired web sites offer a web service that you can use. These will return data in a much more consumable format, such as JSON or XML. You'll usually also get your own developer key (to track requests against), as well as other possible features that you wouldn't get if going directly against the HTML.
Amazon, in particular, certainly offers this. See https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html for details. (Don't be confused by the naming of "advertising".)

Categories

Resources