Permalink
Browse files

Added the ability to create an empty JPublish web applications.

To build an empty JPublish web application go to the folder where you have downloaded/checkout or exported the JPublish SVN code and use ant:

$ ant empty-web-app

An empty JPublish web application containing all the required libraries and a very basic site structure will be created in: build/samples/empty.war

Copy/move/rename the empty.war and use it in your Servlet container of choice.

Few hints for the impatient :)
1. To modify the home page layout, edit the file: 
	empty.war/templates/basic.html
	
2. To modify the home page contents, edit the file: 
	empty.war/content/index.html

3. The simple CSS file is situated here: empty.war/public/styles/simple.css

4. To add and use a scripting action:
 - create a new Beanshell (bsh) or a Rhino(js) Action script in the empty.war/actions folder
 - use the new Action in the page you need by declaring the new Action in the page's specific xml file: <page-action name="the newly created action"/> 

Good luck!
  • Loading branch information...
florin.patrascu
florin.patrascu committed Jun 30, 2007
1 parent ae22426 commit 01c94bfaae26f0d05ef7eaf70d234e3563664df6
View
@@ -1,3 +1,29 @@
To build JPublish you will first need to check out the source code from
To build JPublish you will first need to check out or export the source code from
the SVN. Install the most recent version of Ant on your system. Once
Ant is installed, change into the jpublish root directory and type ant.
To build an empty JPublish web application go to the folder where you have downloaded,
checkout or exported the JPublish SVN code and use ant:
$ ant empty-web-app
An empty JPublish web application containing all the required libraries and a very basic
site structure will be created in: build/samples/empty.war
Copy/move/rename the empty.war and use it in your Servlet container of choice.
Few hints for the impatient :)
1. To modify the home page layout, edit the file:
empty.war/templates/basic.html
2. To modify the home page contents, edit the file:
empty.war/content/index.html
3. The simple CSS file is situated here: empty.war/public/styles/simple.css
4. To add and use a scripting action:
- create a new Beanshell (bsh) or a Rhino(js) Action script in the empty.war/actions folder
- use the new Action in the page you need by declaring the new Action in the page's
specific xml file: <page-action name="the newly created action"/>
Good luck!
View
@@ -96,6 +96,29 @@
</target>
<!-- ====================================================================== -->
<!-- Create an empty JPublish web application. -->
<!-- ====================================================================== -->
<target name="empty-web-app" depends="jar">
<echo message="Building an empty JPublish web applications:"/>
<echo message="... empty.war"/>
<copy todir="${build.samples}/empty.war">
<fileset dir="${samples.dir}/empty.war" includes="**/*.*"/>
</copy>
<copy todir="${build.samples}/empty.war/WEB-INF/lib">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${dist.dir}">
<include name="**/*.*"/>
</fileset>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Generate the API documentation. -->
<!-- ====================================================================== -->
@@ -0,0 +1,24 @@
This folder contains an empty JPublish web application.
Few hints for the impatient :)
1. To modify the home page layout, edit the file:
empty.war/templates/basic.html
2. To modify the home page contents, edit the file:
empty.war/content/index.html
3. The simple CSS file is situated here: empty.war/public/styles/simple.css
4. To add and use a scripting action:
- create a new Beanshell (bsh) or a Rhino(js) Action script in the empty.war/actions
folder
- use the new Action in the page you need by declaring the new Action in the page's
specific xml file:
...
<page-action name="the newly created action"/>
...
Good luck!
@@ -0,0 +1,25 @@
#
# Copyright 2004-2007 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
log4j.rootLogger=INFO, A1
log4j.logger.syslog=INFO, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
# We don't need the cache info anymore, errors only; [Florin]
log4j.logger.com.whirlycott.cache.CacheDecorator=ERROR
log4j.logger.org.apache.velocity=ERROR
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<jpublish>
<name>JPublish: empty web application</name>
<static-root>public</static-root>
<action-root>actions</action-root>
<template-root>templates</template-root>
<page-root>pages</page-root>
<page-manager classname="org.jpublish.page.filesystem.FileSystemPageManagerWithDefault"/>
<default-template>basic</default-template>
<!--Velocity renderer-->
<view-renderer classname="org.jpublish.view.velocity.VelocityViewRenderer">
<velocity-properties relative-paths="true">WEB-INF/velocity.properties</velocity-properties>
<resource-cache-enabled>true</resource-cache-enabled>
<!--seconds-->
<resource-cache-interval>15</resource-cache-interval>
</view-renderer>
<!--Comment the Velocity renderer above and un-comment the line below if you need to
enable the FreeMarker-->
<!--<view-renderer classname="org.jpublish.view.freemarker.FreeMarkerViewRenderer"/>-->
<repository name="fs_repository" classname="org.jpublish.repository.filesystem.FileSystemRepository">
<root>content</root>
<cache>default</cache>
</repository>
<cache-manager>
<jpublish.cache.provider>
<!--<implementation name="default" class="org.jpublish.util.JPublishSimpleCacheImpl"/>-->
<!--<implementation name="default" class="org.jpublish.util.JPublishWhirlyCacheImpl"/>-->
<implementation name="default" class="org.jpublish.util.JPublishCacheImpl"/>
</jpublish.cache.provider>
</cache-manager>
<character-encoding-map path="*">
<page-encoding>utf8</page-encoding>
<template-encoding>utf8</template-encoding>
<request-encoding>utf8</request-encoding>
<response-encoding>utf8</response-encoding>
</character-encoding-map>
<debug>false</debug>
</jpublish>
@@ -0,0 +1,10 @@
# the following are specified relative to the
# root of the webapp because the
# ControllerServlet will setup these
# properties with the right real path
# prepended
#
runtime.log = velocity.log
parser.pool.size = 50
input.encoding=utf-8
output.encoding=utf-8
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>jpublish</servlet-name>
<servlet-class>org.jpublish.servlet.JPublishServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>WEB-INF/jpublish.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jpublish</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jpublish</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
@@ -0,0 +1 @@
This folder contains your scripting Actions
@@ -0,0 +1 @@
Home page.
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<page>
<template>basic</template>
</page>
@@ -0,0 +1,10 @@
body {
color: #000;
background-color: #ffffff;
font: 12px Arial, Helvetica, Geneva, sans-serif;
}
h1 {
color: blue;
font: bold 15px "Lucida Grande", Lucida, Verdana, sans-serif;
}
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>JPublish: empty web application</title>
<link rel="stylesheet" href="$!request.ContextPath/styles/simple.css" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
$fs_repository.get($page.Path)
</body>
</html>

0 comments on commit 01c94bf

Please sign in to comment.