Building Web Application
Security
Best Practices
What is cloudCMS
cloudCMS Terminology
cloudCMS Components
How cloudCMS Works
Deploying WAR
Configuring Site specific settings
Configuring VFS (Virtual File System)
Create first Page
cloudCMS has most simplest form of template to define layout of your site/page-groups. cloudCMS output is rendered through a single JSP file (/WEB-INF/template/<template-name>/view.jsp).
Following is example code of "default" template's view.jsp.
<html>
<head>
<title>${wbpage.description}</title>
<includepage name="JS" group="${pageGroup}"/>
</head>
<body>
<includepage name="header" group="${pageGroup}" />
<!--Page content goes here-->
${wbpage.content}
<includepage name="sidebar" group="${pageGroup}" />
<includepage name="footer" group="${pageGroup}" />
</body>
</html>
So any group which is using "default" template will be rendered using above JSP.
According to above template definition, for every page include <pageGroup>.JS, <pageGroup>.header, <pageGroup>.sidebar and <pagGgroup>.footer in output.
This is another template which gets all its content "dynamically" from cloudCMS pages ("no <html> tags").
<includepage group="${pageGroup}" name="header" />{wbpage.content}<includepage group="${pageGroup}" name="footer" />
According to above template definition, for every page include <pageGroup>.header and <pagGgroup>.footer in output.
Note : since there is no HTML tags in "dynamic" template so "header" and "footer" should include HTML start and end tags.
You can create any number of templates. Just create a file /WEB-INF/template/<template-name>/view.jsp and use <template-name> at Site level or Group level.
XML
CSV
CSS
wbpage attribute reference the active Freemarker page.
A FreeMarker hashset to access HTTP request parameters.
A FreeMarker hashset to access HTTP session parameters.
A FreeMarker hashset to access HTTP header parameters.
A FreeMarker variable which represents the loggedin User.
Use includepage directive to include content of other cloudCMS pages. This is most useful directive for building reusable pages and cms layout. You can include page with any content type (HTML, BBCODE, FTL) inside FreeMarker page.
Example :
<@includepage name=pagename group=pagegroup />
use listpage directive to retrieve wbpage variable for given group(optional).
Example :
<@listpage limit=wbrequest.limit group="test" ;page, index >
<li> ${index} - ${page.name} ${page.owner!'None'} - ${page.modifyDate?datetime}</li>
</@listpage>
Use listEntity directive to list datastore entities.
Following output variables (defined after ;) are available inside directive
row - The current entity retrieved from datastore. You can use row.<property-name> access datastore property.
index - Index of current row
count - total retrieved rows
Example :
<@listEntity kind="test_GuestBook" limit=25 offset=10 ; row, index, count>
${row.guestname} wrote at ${row.dateAdded?datetime}:
${row.message?html}
</@listEntity>
Example with filter and sort -
<@filterEntity name="_fp1" propertyName="group" value="test" operator="EQUAL" />
<@filterEntity name="_fp2" propertyName="modifyDate" value=dt operator="GREATER_THAN" />
<@sortEntity name="_sp1" propertyName="name" direction="ASCENDING" />
<@sortEntity name="_sp2" propertyName="modifyDate" direction="DESCENDING" />
<@listEntity kind="test_GuestBook" filter=[_fp1,_fp2] sort=[_sp1,_sp2] ; row> </@listEntity>
Use storeEntity directive to insert/update entity row. If entity's Kind does not exist it will be created in app engine's datastore. The directive parameters will be the properties of entity.
Example:
This will add new row to "test_GuestBook" with three properties (guestname<type String>, message<ype String) and dateAdded<type Date>) .
<#assign guestname = (wbrequest.guestname)!wbuser.nickName />
<#assign currDate = "com.sheelapps.ftl.TodayDate"?new()>
<@storeEntity kind="test_GuestBook" guestname=guestname message=wbrequest.guestmsg dateAdded=currDate />
Use deleteEntity directive to delete row(s) from any Kind. Prove entity key as a string to delete entity.Use filter parameter to delete matched entities only.
Example -
<@deleteEntity kind="largeEntity" key=row.keyAsString filter=_fp1 />
Example - Delete first 100 rows starting from first rows.
<@deleteEntity kind="largeEntity" limit=100 offset=0 />
Use filterEntity to define filter on entities. It can be used with listEntity and deleteEntity directives.
Example -
<@filterEntity name="_fp1" propertyName="group" value="test" operator="EQUAL" />
<@filterEntity name="_fp2" propertyName="modifyDate" value=dt operator="GREATER_THAN" />
Use sortEntity to define sort predicates on entities. It can be used with listEntity to define sort order of returned rows.
Example
<@sortEntity name="_sp1" propertyName="name" direction="ASCENDING" />
<@sortEntity name="_sp2" propertyName="modifyDate" direction="DESCENDING" />
- <email />
- <bbcode />
- <codec />
- <xml />
- <url />
Design and Architecture
Design Data Model
Create FreeMarker page(s)
Group level security
Configuration
Access Control
Secuirty tips
FreeMarker tip
HTML tip
Page Composition / Site Layout tip