cloudCMS Guide

 

  1. cloudCMS Overview

  2. Installing cloudCMS

  3. Page Editor and Design Help

  4. Custom Page Output Format

  5. Freemarker page Variables

  6. Custom FreeMarker directives

  7. Building Web Application

  8. Security

  9. Best Practices


cloudCMS Overview

What is cloudCMS

cloudCMS Terminology

cloudCMS Components

How cloudCMS Works

 

Top


 

Installing cloudCMS

Deploying WAR

Configuring Site specific settings

Configuring VFS (Virtual File System)

Create first Page

 

Top


 

Page Editor and Design Help

Template design

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).

 "default" template -

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.

 

"dynamic" template  -

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.

 

Design HTML pages

Design BBCODE pages

Design FreeMarker pages

 

Top


 

Custom Page Output Format

XML

CSV

CSS

 

Top


 

Freemarker page Variables

-wbpage

wbpage attribute reference the active Freemarker page.

-wbrequest

A FreeMarker hashset to access HTTP request parameters.

-wbsession

A FreeMarker hashset to access HTTP session parameters.

-wbheader

A FreeMarker hashset to access HTTP header parameters.

-wbuser

A FreeMarker variable which represents the loggedin User.

 

Top


 

Custom FreeMarker directives

1) Page specific directives :

- <includepage />

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 />

 

- <listpage />

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>

 

2) App Engine Entity related directives :

 - <listEntity />

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>

 

 - <storeEntity />

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 />

 

 

  - <deleteEntity />

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 />

 

 - <filterEntity />

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" />

 

 - <sortEntity />

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" />

3) Other directives

     - <email />   

    - <bbcode />

    - <codec />

    - <xml />

    - <url />

 

 

Top


 

Building Web Application

Design and Architecture

Design Data Model

Create FreeMarker page(s)

 

Top


 

Security

Group level security

Configuration

Access Control

Secuirty tips

 

Top


 

Best Practices

FreeMarker tip

HTML tip

Page Composition / Site Layout tip

 

Top