https://www.zkoss.org/_w/index.php?title=Small_Talks/2009/November/Building_Content_Management_Systems_With_Jease&feed=atom&action=historySmall Talks/2009/November/Building Content Management Systems With Jease - Revision history2024-03-29T08:55:38ZRevision history for this page on the wikiMediaWiki 1.35.1https://www.zkoss.org/_w/index.php?title=Small_Talks/2009/November/Building_Content_Management_Systems_With_Jease&diff=8047&oldid=prevTmillsclare: /* Content View */2010-09-27T07:36:54Z<p><span dir="auto"><span class="autocomment">Content View</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 07:36, 27 September 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l133" >Line 133:</td>
<td colspan="2" class="diff-lineno">Line 133:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>And last but not least we can define a JSP-Template which is responsible to render our Events nicely on our website. Please note: Jease doesn't make any assumptions about the view-technology. If you don't like JSPs, you don't have to use them. Any other technology will do also.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>And last but not least we can define a JSP-Template which is responsible to render our Events nicely on our website. Please note: Jease doesn't make any assumptions about the view-technology. If you don't like JSPs, you don't have to use them. Any other technology will do also.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><source lang="<del class="diffchange diffchange-inline">html4strict</del>"></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><source lang="<ins class="diffchange diffchange-inline">html</ins>"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><%</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><%</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Event event = (Event) request.getAttribute("Node");</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Event event = (Event) request.getAttribute("Node");</div></td></tr>
</table>Tmillsclarehttps://www.zkoss.org/_w/index.php?title=Small_Talks/2009/November/Building_Content_Management_Systems_With_Jease&diff=7356&oldid=prevElton776: moved Small Talks/Building Content Management Systems With Jease to Small Talks/2009/November/Building Content Management Systems With Jease2010-09-20T07:23:28Z<p>moved <a href="/wiki/Small_Talks/Building_Content_Management_Systems_With_Jease" class="mw-redirect" title="Small Talks/Building Content Management Systems With Jease">Small Talks/Building Content Management Systems With Jease</a> to <a href="/wiki/Small_Talks/2009/November/Building_Content_Management_Systems_With_Jease" title="Small Talks/2009/November/Building Content Management Systems With Jease">Small Talks/2009/November/Building Content Management Systems With Jease</a></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 07:23, 20 September 2010</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Elton776https://www.zkoss.org/_w/index.php?title=Small_Talks/2009/November/Building_Content_Management_Systems_With_Jease&diff=5456&oldid=prevElton776: Created page with '{{Template:Smalltalk_Author| |author=Maik Jablonski (maik dot jablonski (at) gmail dot com)<div> <br /><div style="border:solid 1px; padding:5px; height:100px;width:600px" > <div…'2010-09-10T03:12:34Z<p>Created page with '{{Template:Smalltalk_Author| |author=Maik Jablonski (maik dot jablonski (at) gmail dot com)<div> <br /><div style="border:solid 1px; padding:5px; height:100px;width:600px" > <div…'</p>
<p><b>New page</b></p><div>{{Template:Smalltalk_Author|<br />
|author=Maik Jablonski (maik dot jablonski (at) gmail dot com)<div><br />
<br /><div style="border:solid 1px; padding:5px; height:100px;width:600px" ><br />
<div style="float:left;padding-bottom:15px;padding-right:10px;border:0 none;vertical-align:middle;">[[Image:Maik_Jablonski.jpg]]</div>Maik Jablonski, designs, develops and maintains various content-managment-systems and lots of web-applications on top of object-databases since 1999 at the University of Bielefeld (Germany).<br />
</div><br />
<br /><br />
|date=November 21, 2009<br />
|version=Jease 0.2<br />
}}<br />
<br />
==Abstract==<br />
This smalltalk introduces you into the world of [http://www.jease.org/ Jease] - a Java-based Content-Management-Framework built on top of [http://www.zkoss.org/ ZK] and an popular open-source object-database of your choice (you can select between [http://www.db4o.com db4o], [http://www.neodatis.org NeoDatis] and [http://www.mcobject.com/perst Perst]). Jease is an open-source framework to ease the widespread pains developing content- & database-driven web-applications with Java. Out of the box Jease provides a fully Ajax-driven Content-Management-System (CMS) as a best-practice-showcase which can easily be tailored to your specific requirements.<br />
<br />
----<br />
<br />
[[Image:jease.gif]]<br />
<br />
== Quickstart ==<br />
<br />
=== Prerequisites ===<br />
<br />
* Download and install a recent Java SE Development Kit (Java SE JDK). Please note: You'll need a full Java Development Kit (JDK), a simple Java Runtime Environment (JRE) won't work.<br />
* Check your environment-variables: JAVA_HOME needs to point to the root-directory of your JDK.<br />
<br />
=== Install ===<br />
<br />
* [http://jease.org/download/latest Download the latest binary release.]<br />
* Unzip the downloaded package.<br />
<br />
=== Start ===<br />
<br />
* '''Linux:''' Open a terminal and enter: ''jease/bin/catalina.sh run''<br />
* '''Windows:''' Navigate to "jease -> bin" and double-click: ''startup'' (= startup.bat)<br />
<br />
=== Setup ===<br />
<br />
* Open your browser and call: http://localhost:8080/cms/setup<br />
* Choose a name, login and password for the administration account.<br />
* Now you're redirected to the login-page. Enter the login and password for the newly created administrator.<br />
* Have fun...<br />
<br />
== Create a new Content-Type ==<br />
<br />
Jease makes the creation of custom content-types (or any other user-defined data-structures) very easy and straightforward. All you have to know is a little bit Java... the use of an good IDE (like Eclipse) is strongly recommended.<br />
<br />
# Write a simple Pojo as '''content-definition''' (no SQL or XML or whatever needed for this task, just declare your class in Java and you're done... kudos to the idea behind object databases for this fantastic feature)<br />
# Write (better to say: programmatically declare) an appropriate '''content-editor''' which can use the wealth of existing und upcoming ZK-components<br />
# Write a '''content-view''' for the website (this is optional and only needed if you want to run a public website)<br />
<br />
Jease takes care of all the boring rest (persistence, gui, search engine, navigation, ...). <br />
<br />
So lets start right away building a content-type to store, edit and display '''Events''' for our customized content-management-system.<br />
<br />
----<br />
<br />
[[Image:Jease_event.gif]]<br />
<br />
<br />
=== Content Definition ===<br />
<br />
First we have to write a Pojo which mainly declares the fields which get persisted automatically.<br />
<br />
<source lang="java"><br />
public class Event extends Content {<br />
<br />
private String announcement;<br />
private String location;<br />
private Date start;<br />
private Date end;<br />
<br />
// getter & setter<br />
}<br />
</source><br />
<br />
That's easy as it is! <br />
<br />
=== Content Editor ===<br />
<br />
Now we can start right away to "programmatically declare" the appropriate content-editor for Events:<br />
<br />
<source lang="java"><br />
public class EventEditor extends ContentEditor<Event> {<br />
<br />
RichTextarea announcement = new RichTextarea();<br />
Textfield location = new Textfield();<br />
Datetimefield start = new Datetimefield();<br />
Datetimefield end = new Datetimefield();<br />
<br />
public EventEditor() {<br />
}<br />
<br />
public void init() {<br />
add("Announcement", announcement);<br />
add("Location", location);<br />
add("Start", start);<br />
add("End", end);<br />
}<br />
<br />
public void load() {<br />
announcement.setText(getNode().getAnnouncement());<br />
location.setText(getNode().getLocation());<br />
start.setDate(getNode().getStart());<br />
end.setDate(getNode().getEnd());<br />
}<br />
<br />
public void validate() {<br />
if (announcement.isEmpty()) {<br />
addError("Announcement is required");<br />
}<br />
<br />
if (location.isEmpty()) {<br />
addError("Location is required");<br />
}<br />
<br />
if (start.isEmpty() || end.isEmpty()<br />
|| start.getValue().after(end.getValue())) {<br />
addError("Date is invalid");<br />
}<br />
}<br />
<br />
public void save() {<br />
getNode().setAnnouncement(announcement.getText());<br />
getNode().setLocation(location.getText());<br />
getNode().setStart(start.getDate());<br />
getNode().setEnd(end.getDate());<br />
}<br />
<br />
}<br />
</source><br />
<br />
=== Content View ===<br />
<br />
And last but not least we can define a JSP-Template which is responsible to render our Events nicely on our website. Please note: Jease doesn't make any assumptions about the view-technology. If you don't like JSPs, you don't have to use them. Any other technology will do also.<br />
<br />
<source lang="html4strict"><br />
<%<br />
Event event = (Event) request.getAttribute("Node");<br />
%><br />
<h1><%=event.getTitle()%></h1><br />
<table><br />
<tr><br />
<td><b>Where:</b></td><br />
<td><%=event.getLocation()%></td><br />
</tr><br />
<tr><br />
<td><b>Start:</b></td><br />
<td><%=Dates.YYYY_MM_DD_HH_MM.format(event.getStart())%></td><br />
</tr><br />
<tr><br />
<td><b>End:</b></td><br />
<td><%=Dates.YYYY_MM_DD_HH_MM.format(event.getEnd())%></td><br />
</tr><br />
</table><br />
<div><%=event.getAnnouncement()%></div><br />
</source><br />
<br />
== Conclusion == <br />
<br />
If you want to develop content- or database-driven web-applications with ZK, Jease helps a lot by providing a rich infrastructure which makes development very easy. All you have to know is a little bit of Java. Have fun!<br />
<br />
== More Information ==<br />
<br />
You can find more detailed documentation, screencasts, demos & support on the Jease-Homepage: http://www.jease.org/<br />
<br />
<br />
<comment>http://docs.zkoss.org/wiki/Building_Content_Management_Systems_With_Jease</comment><br />
<br />
{{Template:Smalltalk_Footer|<br />
|name=Maik Jablonski<br />
}}</div>Elton776