Walrus is tested to run on both Windows and Linux (Unix in general) operating systems.
You will need a functioning Java installation. Download and install Java if you don't have it yet.
For basic and advanced setup options you will need a Servlet 2.4 Specification compatible container. Walrus was tested to run in Apache Tomcat and Jetty containers.
If you want to try Walrus right away, the best option for you is to download an installation bundled with Jetty servlet container.
Download Walrus installation from this location:
Unzip it to directory of your choice
Open command prompt, change to the unzipped directory and run this command: if your OS is Linux:
./bin/jetty.sh run
if your OS is Windows:
./bin/jetty.bat run
After this, point your browser to http://localhost:8180 and you will see a fresh Walrus CMS installation.
If you already have a service running on port 8180, you will need to change Jetty configuration. Please refer to Jetty documentation about how to do it.
By default Walrus comes bundled with 100% Java HyperSQL database. Depending on your needs you might want to configure Walrus to work with other database management systems, supported by Hibernate.
You just need to create a database and specify it in Walrus configuration files, there is no need to run any SQL commands - Walrus will create all necessary tables by itself.
Walrus comes with JDBC driver for PostgreSQL database.
To configure Walrus to work with PostgreSQL DB:
Open file WEB-INF/classes/conf/daoConfiguration.xml
Delete in the definition of walrusDataSource bean change database URL:
<bean id="walrusDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="net.sf.log4jdbc.DriverSpy" />
<property name="url" value="jdbc:log4jdbc:postgresql://${walrus.db.host}/${walrus.db.database}" />
<property name="username" value="${walrus.db.username}" />
<property name="password" value="${walrus.db.password}" />
</bean>
In this particular case Walrus is configured to work with specific JDBC driver wrapper DriverSpy, designed
to log SQL queries that are sent to database. If you don't need this functionality,
change property driverClassName to org.postgresql.Driver and property
url to jdbc:postgresql://${walrus.db.host}/${walrus.db.database}
In the same file change the property hibernate.dialect to org.hibernate.dialect.PostgreSQLDialect:
<bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="walrusDataSource" /> <property name="mappingResources"> <list> <value>WalrusCMS.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <value> hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.format_sql=false hibernate.query.substitutions=true 1, false 0 hibernate.hbm2ddl.auto=update </value> </property> </bean>
Open file WEB-INF/classes/walrus.properties and change these setting according to your system configuration:
walrus.db.host=your.database.hostname walrus.db.database=databaseName walrus.db.username=databaseUsername walrus.db.password=databasePassword
To use Walrus with other databases, you must download a JDBC driver for particular database and put it's jar to WEB-INF/lib directory.
Then you have to configure the walrusDataSource bean, specify the correct hibernate.dialect and configure
any other Hibernate options for specific database management system.
Walrus can send email to administrators. Email is being sent on new user creation and on password change. To configure your email settings:
Open file WEB-INF/classes/walrus.properties and change these setting according to your system configuration:
walrus.mail.smtpHost=your.smtp.host walrus.mail.smtpUsername= walrus.mail.smtpPassword=
If your SMTP server does not use authentication, you can switch ir off by editing file WEB-INF/classes/conf/mail.xml and
changing the property mail.smtp.auth to false:
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="${walrus.mail.smtpHost}"/>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
<property name="username" value="${walrus.mail.smtpUsername}"/>
<property name="password" value="${walrus.mail.smtpPassword}"/>
</bean>
A site is the main abstraction. A site holds rubric tree and boxes. One Walrus installation supports many sites - this means you can host several different sites with different hostnames and different languages in one Walrus installation.
A site is characterized by hostname and language. I.e. for every combination of hostname and language a site is created.
A rubric is the main content holder. Rubrics have title, abstract and main body, they can have unique urls, you can specify rules when content in rubric becomes visible and invisible, and, most important - rubrics have references to other rubrics, forming a tree - like structure. This structure is represented in site menus and sitemap.
A box is means to include arbitrary information to the site - things, that don't go into rubric hierachy, like footer, banner, featured links, etc.
Boxes are tied to the visual representation of the site - the templates specify where and which box appears.
For the time being it's impossible to create or delete boxes during site operation time. Boxes are defined during site creation phase and cannot be added or deleted later. Of course, you can always do this in SQL directly in database.
Walrus supports a variety of boxes:
A text box containing a title and a body. If needed, the box can be configured to be displayed without a title (for a footer for example).
A box that can contain one or more banners. Random banner is rendered every time a page loads.
A box that contains one image. You can use ImageBox for site header, logo, etc.
A box, that has a connection to some specific Rubric. This can be used in many different ways - you can extract some specific content to the first page, or show a list of rubrics child subrics (think news box).
Walrus is written in Java programming language. It's built by adhering to Model-View-Controller architectural pattern implemented using Spring framework. It uses now abandoned but generally awesome Springmodules XT ajax framework, Hybernate persistence layer and a combination of Apache Tiles and Freemarker for view layer templates.
Every site is defined by content put to some structure and a view - representation of said content and said structure. Every time you create a site it's an iterative process - you work on content, then you work on the looks, then you put your content to your design and then design has to be improved somehow, which possibly leads to revising content and structure, etc. Walrus let's you to build your site in this iterative process.
When you try to open a Walrus managed site, Walrus looks into database for a site with hostname and language you are using.
If site defined by hostname and language is not found, Walrus suggests to create such site by providing you with a specific link.
After you click a link, Walrus creates a new site, using a site defined in file WEB-INF/classes/conf/site.xml as
a template. This file is where you define your site's structure. You can just go with a Site object and just one Rubric defined and
fill all the rest by the means of Walruses WYSIWYG tools, but it's more handy to have Walrus to boostrap your basic site structure
every time you need to refine something and start clean.
Sites structure template is loceted in file WEB-INF/classes/conf/site.xml. It's an XML file,
describing Rubric structure of your site and available Boxes. The XML itself is Spring framework bean definition language.
Consider this example:
<bean id="sitePrototype" class="lt.walrus.model.Site" autowire="no"> <constructor-arg> <ref bean="r0" /> </constructor-arg> <property name="boxes"> <list> <ref bean="bannerBox"/> <ref bean="textBoxFooter"/> <ref bean="textBoxHello"/> <ref bean="imageBoxNiceness"/> <ref bean="rubricBoxNews"/> </list> </property> </bean>
Here we have a Site defined. It has a reference to root rubric of rubric hierarchy provided in a constructor and a list of box references. Note that every bean has an id - it's important for this id to be unique as it is used to reference bean in another beans.
Now let's define a ROOT rubric. Rubric takes who arguments to it's constructor - a reference to parent Rubric and a title:
<bean id="r0" class="lt.walrus.model.Rubric"> <constructor-arg><null /></constructor-arg> <constructor-arg><value>ROOT</value></constructor-arg> <property name="online"><value>true</value></property> </bean>
A root rubric is a special kind of rubric - it is not displayed in view, content is not saved to it, it's used as placeholder
for all other rubrics. A reference to root rubric is specified in definition of Site (see above).
We make a root rubric by specifying <null /> as a parent reference. This means that Rubric has no
parent. There will be just one Rubric with no parent.
Now let's add some children to our root Rubric:
<bean id="r1" class="lt.walrus.model.Rubric"> <constructor-arg><ref bean="r0"/></constructor-arg> <constructor-arg><value>Kompanija</value></constructor-arg> <property name="online"><value>true</value></property> </bean>
Note that we specify root Rubric as a parent for this rubric.
You can specify various other Rubric properties too, as you can see - we are marking rubrics online in these examples.
Other properties you can specify include:
Abstract of rubric
Text body of rubric
The date string
When false, time restrictions visibleFrom visibleTo apply
Date rubric is visible to visitors from (when visibleForever == false)
Date rubric is visible to visitors to (when visibleForever == false)
Is rubric a leaf - ie true when rubric can not have children
Rubric display mode
Special url string for rubric
Comments to the rubric
Is commenting turned on for rubric
<bean id="textBoxFooter" class="lt.walrus.model.TextBox"> <property name="boxId" value="boxFooter"/> <property name="title" value="Klientų atsiliepimai"/> <property name="body" value="Lorem ipsum dolor sit amet"/> </bean> <bean id="textBoxHello" class="lt.walrus.model.TextBox"> <property name="boxId" value="boxHello"/> <property name="title" value="Klientų atsiliepimai"/> <property name="body" value="Lorem ipsum dolor sit amet"/> </bean>
<bean id="rubricBoxNews" class="lt.walrus.model.RubricBox"> <property name="boxId" value="newsBox"/> <property name="rubric" ref="r5" /> </bean>
<bean id="bannerBox" class="lt.walrus.model.BannerBox"> <property name="boxId" value="mainAd" /> <property name="banners"> <list> <bean class="lt.walrus.model.Banner"> <property name="banner" value="/img/walrus_ad.jpg" /> <property name="url" value="http://www.walrus.lt" /> </bean> </list> </property> </bean>
<bean id="imageBoxNiceness" class="lt.walrus.model.ImageBox"> <property name="boxId" value="newsBox"/> <property name="image" ref="/img/image.jpg" /> </bean>