100% found this document useful (1 vote)
9 views

OpenCms 7 Development Extending and customizing OpenCms through its Java API 1st Edition Liliedahl pdf download

The document is a guide to developing and customizing OpenCms using its Java API, authored by Dan Liliedahl. It covers setting up development environments, creating modules, and implementing features such as user registration and site search, all while building a sample blog site. The book serves as a practical tutorial for Java developers looking to extend OpenCms functionalities.

Uploaded by

pokkumafumi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
9 views

OpenCms 7 Development Extending and customizing OpenCms through its Java API 1st Edition Liliedahl pdf download

The document is a guide to developing and customizing OpenCms using its Java API, authored by Dan Liliedahl. It covers setting up development environments, creating modules, and implementing features such as user registration and site search, all while building a sample blog site. The book serves as a practical tutorial for Java developers looking to extend OpenCms functionalities.

Uploaded by

pokkumafumi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

OpenCms 7 Development Extending and customizing

OpenCms through its Java API 1st Edition


Liliedahl pdf download

https://ebookname.com/product/opencms-7-development-extending-
and-customizing-opencms-through-its-java-api-1st-edition-
liliedahl/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Embedded Android Porting Extending and Customizing 1st


Edition Karim Yaghmour

https://ebookname.com/product/embedded-android-porting-extending-
and-customizing-1st-edition-karim-yaghmour/

Web API Development for the Absolute Beginner A Step by


step Approach to Learning the Fundamentals of Web API
Development with NET 7 1st Edition Irina Dominte

https://ebookname.com/product/web-api-development-for-the-
absolute-beginner-a-step-by-step-approach-to-learning-the-
fundamentals-of-web-api-development-with-net-7-1st-edition-irina-
dominte/

Open Source Messaging Application Development Building


and Extending Gaim 1st Edition Sean Egan

https://ebookname.com/product/open-source-messaging-application-
development-building-and-extending-gaim-1st-edition-sean-egan/

Advances in Marine Biology Vol 53 1st Edition David W.


Sims (Ed.)

https://ebookname.com/product/advances-in-marine-biology-
vol-53-1st-edition-david-w-sims-ed/
Contemporary Social Psychological Theories 1st ed
Edition Peter J. Burke

https://ebookname.com/product/contemporary-social-psychological-
theories-1st-ed-edition-peter-j-burke/

A Companion to Greek Religion 1st Edition Daniel Ogden


(Ed.)

https://ebookname.com/product/a-companion-to-greek-religion-1st-
edition-daniel-ogden-ed/

Designing Audio Effect Plugins in C For AAX AU and VST3


with DSP Theory 2nd Edition Will C. Pirkle

https://ebookname.com/product/designing-audio-effect-plugins-in-
c-for-aax-au-and-vst3-with-dsp-theory-2nd-edition-will-c-pirkle/

Franklin s Passage 1st Edition David Solway

https://ebookname.com/product/franklin-s-passage-1st-edition-
david-solway/

Risk Assessment and Management in Mental Health Nursing


1st Edition Phil Woods

https://ebookname.com/product/risk-assessment-and-management-in-
mental-health-nursing-1st-edition-phil-woods/
Proceeding International Conference on Democracy and
Accountabilty ICoDA 2015 1st Edition Nanang Haryono
(Ed.)& Irfa Puspitasari (Ed.)

https://ebookname.com/product/proceeding-international-
conference-on-democracy-and-accountabilty-icoda-2015-1st-edition-
nanang-haryono-ed-irfa-puspitasari-ed/
www.it-ebooks.info
OpenCms 7 Development

Extending and customizing OpenCms through its


Java API

Dan Liliedahl

BIRMINGHAM - MUMBAI

www.it-ebooks.info
OpenCms 7 Development

Copyright © 2008 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: April 2008

Production Reference: 1160408

Published by Packt Publishing Ltd.


32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.

ISBN 978-1-847191-05-2

www.packtpub.com

Cover Image by Karl Moore ([email protected])

www.it-ebooks.info
Credits

Author Project Manager


Dan Liliedahl Abhijeet Deobhakta

Reviewer Indexer
Olli Aro Rekha Nair

Senior Acquisition Editor Proofreader


Douglas Paterson Angie Butcher

Development Editor Production Coordinator


Nikhil Bangera Shantanu Zagade

Technical Editor Cover Work


Himanshu Panchal Shantanu Zagade

Editorial Team Leader


Mithil Kulkarni

www.it-ebooks.info
About the Author

Dan Liliedahl is the founder and CTO of eFoundry Corporation, a premier


consulting company with expertise in selecting, specifying, and delivering Open
Source and commercial content management portal and collaboration systems. Since
starting eFoundry in 1998, he has architected and developed Web solutions for
Fortune 500 companies such as JPMorganChase, Disney, Sirius Satellite Radio, and
AMTRAK. Prior to starting eFoundry, Dan was a principal consultant and architect
with FutureTense, a start up commercial CMS product vendor, and Open Market,
whose products continue to have a strong market presence under a new company
name. In addition to his full-time work, Dan frequently donates his marketplace
and technical expertise to selected non‑profit organizations. He holds a degree in
Electrical Engineering and Computer Science from the University of New Hampshire
and has over 20 years of industry experience. In his spare time, he enjoys alpine
skiing, ice hockey and coaching his kids' soccer.

www.it-ebooks.info
I would like to thank the people at Packt who have helped me
along the way with this book, especially Douglas Paterson, Senior
Acquisition Editor for his initial guidance and ongoing support.
Thanks also to Abhijeet Deobhakta for his patience and for putting
up with many delays and missed deadlines. Many thanks to Olli
Arro and Himanshu Panchal for their time, comments, and helpful
suggestions. It is great people like these who have made this book
enjoyable to write and seem to go by quickly.

I also would like to thank Alexander Kandzior and his OpenCms


team. Beside building an outstanding product, they have always
been available for questions and help, despite their busy schedules.
I know their schedules are busy because they came out with four
versions of the software before this book was completed! Alex's
focus, diligence, obsession with quality, and professionalism has
made OpenCms and his company great.

Special thanks to my wife for her support and encouragement and


for keeping me going on those days I didn't want to. And of course,
to my three children for making me laugh and for tolerating the
times I couldn't spend with them.

www.it-ebooks.info
About the Reviewer

Olli Aro hails from Finnish Lapland, but is based now in the north of England.
Olli Aro has over 10 years experience in the area of innovation and development of
software and web-based applications. In his current role as head of technology and
product development for Clicks and Links Ltd, Olli has been responsible for the
company's portfolio of Open Source-based solutions. He has been involved in the
OpenCms project since 2001 (version 4), contributing various open source modules
and bug fixes to the project. Olli was also involved in reviewing the previous version
of the OpenCms book. Prior to Clicks and Links, Olli worked for organizations such
as Nokia, eMobile Ltd, and CCC Systems Oy. In his spare time, he works on his own
social networking site, Breakaway Republix.

www.it-ebooks.info
Table of Contents
Preface 1
Chapter 1: Overview 7
The Site Design 8
Required Developer Skills 12
Basic Site Development 12
Sites Requiring Custom Content Types 13
Sites Requiring Custom Features 14
Bespoke Site Development 14
OpenCms Application Overview 14
The OpenCms Directory Structure 15
The Real File System Layout 15
The Virtual File System Layout 18
OpenCms Architecture 19
Extensibility through Modules 20
The OpenCms Web Request Process 20
OpenCms Web Application Packaging 21
Building a Complete Site with OpenCms 21
Summary 22
Chapter 2: Developing in OpenCms 23
Developing Basic Site Content 23
Setting Up an Environment for Creating JSP Code 24
Editing Files Using File Synchronization 26
Using WebDAV for Editing 28
Debugging JSP Code in OpenCms 30
Setting Up an Eclipse Environment to Build OpenCms 33
Tools Needed to Build OpenCms in Eclipse 33
Step 1: Checkout the Project Source from CVS 34
Step 2: Setting the Classpath for Compilation 40
Step 3: Using Ant to Build a Distribution Package 41
Building OpenCms outside of Eclipse Using Ant 44
Debugging OpenCms in Eclipse 45

www.it-ebooks.info
Table of Contents

Setting Up an Eclipse Environment without Building OpenCms 46


Summary 47
Chapter 3: Our First Module 49
Understanding OpenCms Modules 50
Common Module Types 50
Module Events 51
Exporting and Importing Modules 51
Creating a Module 52
Creating a BlogEntry Content Type 55
Registering the Content Type 59
Additional Schema Features 66
Field Mappings 66
Field Validations 67
Default Field Values 67
Localization 68
Content Relationships 68
Content Previewing 69
Creating Content Using a Model 70
User Interface Widgets 70
Nested Content Definitions 80
Editing Configuration Files with Validating Editors 84
Organizing the Content 87
Summary 87
Chapter 4: Developing Templates 89
Review of the Page Layout 89
Templates in OpenCms 94
Creating the Templates 94
The Homepage Template 95
The Blog Content Loop 97
The Sidebar and Footer 99
Common Code Elements 100
Header Code 101
Search Form 102
Advertisements 102
Blog Archives 103
RSS Client and RSS Feeds 105
Footer Section 106
The Supporting Java Bean Class 106
The Blog Template 112
The Content and Template Loading Process 113
Expressions in JSP Templates 115
Using the Tag Library from JSP 115

[ ii ]

www.it-ebooks.info
Table of Contents

Combining Expressions with JSTL 116


Accelerating Template Development Using WebDAV 117
Install the Eclipse WebDAV Plug-in 118
Create a Site Within Eclipse for the Server 120
Import Content into the Project 122
Summary 124
Chapter 5: Adding Site Search 125
A Quick Overview of Lucene 125
Search Indexes 125
Search Queries 127
Configuring OpenCms Search 127
Field Configurations 128
Creating a Field Configuration 130
Creating an Index Source 133
Additional Search Settings 136
Introducing Luke – a Visual Index Tool 137
Writing the Search Code 140
A Simple Search Example 140
Subclassing the CmsSearch Bean 143
The Search.jsp Template 145
Summary 151
Chapter 6: Adding User Registration and Comment Support 153
Understanding OpenCms Security 153
User, Groups, Roles, and Permissions 154
Organizational Units 157
Setting up Security for Our Site 158
Organization Unit and Group Setup 159
Adding the Users 163
Resource Permissions 166
User Login and Registration Code 169
Adding Comment Support 178
Adding the Comments to the XML Content 181
Publishing the Comments 183
Summary 184
Chapter 7: Providing Site Customization Features 185
What is RSS? 185
Creating the Module 186
The RSS Client Code 187
Displaying the RSS Feed in the Template 189
Adding User Preferences to Accounts 190

[ iii ]

www.it-ebooks.info
Table of Contents

Updating the Java Code 191


Updating the JSP Templates 193
Hooking up the Account Management Page 196
Summary 198
Chapter 8: Extending OpenCms: Developing a Custom Widget 199
Designing a Custom Widget 199
Designing the Widget 201
The Widget Code 202
Custom Source Interface and Implementations 207
Using OpenCms Message Strings for Localization 212
Registering the Widget with OpenCms 213
Summary 214
Chapter 9: Extending OpenCms: Adding RSS Feed Support 215
RSS Feed Design 215
The RSS Feed Content Type 218
Creating a Supporting Widget 223
The RSS Feed Template and Java Classes 226
Content Wrapper Java Classes 231
Wrapping It Up 236
Summary 238
Chapter 10: Extending OpenCms: Adding an Administration Point 239
Administrative Points 239
The Administration View 243
Hooking the Administration Point Up to the Module 245
The RSS Administration Module 246
Leveraging the OpenCms Dialog Classes 250
The Feed Manager Class 259
The New Channel Action 265
Summary 270
Index 271

[ iv ]

www.it-ebooks.info
Preface
OpenCms can be used by Java developers to create sophisticated add-ons and
customizations that extend the power of OpenCms in virtually unlimited directions.
Starting by showing how to set up a development environment for OpenCms
work, this book moves you through various tasks of increasing complexity. Some
of the common tasks covered are building OpenCms, XML asset type development,
templating, module development, user and role setup, and search integration. In
addition to these common tasks some more advanced topics are covered such as
self-registering users, RSS support, developing custom widgets, and extending the
administrative interface. All the topics include examples and are presented while
building a sample blog site.

This book is a clear, practical tutorial to OpenCms development. It will take you
through the development of an example site, illustrating the key concepts of
OpenCms development with examples at every stage.

What This Book Covers


Chapter 1 starts out by describing a sample site that will be created to demonstrate
OpenCms development concepts. It also provides a description of the developer
skills required for OpenCms development, followed by a basic overview
of OpenCms architecture. We also provide a basic description of OpenCms
configuration files and their file locations.

Chapter 2 sets the stage for coding by providing details on how to set up various
OpenCms development environments. The chapter includes a step-by-step
procedure for using Eclipse to check out and build OpenCms from the CVS
repository. The chapter describes how to build OpenCms using Ant and also how to
debug OpenCms itself.

www.it-ebooks.info
Preface

Chapter 3 begins with an explanation of OpenCms modules, including a guide for


creating a new module. The module is used to define a new content type, which is
another concept covered in the chapter. Included in the content type discussion is a
complete, step-by-step guide for designing and creating a new content type used to
contain blog entries. All aspects of content type schema files are covered, including
schema design, widget usage, field selectors, field validations, nested definitions, and
registration. At the end of the chapter, the content type may be used to create new
blog entries.

Chapter 4 continues developing the sample site by covering JSP template coding.
A set of templates is created to display the blog content, including a complete run
through of how they are put together. The example illustrates the use of custom
template coding beyond the standard OpenCms tag library by sub-classing Java
template classes. Included in the chapter is an overview of the resource and template
loading mechanism. Also relating to templates is a description of using expressions
and JSTL within template code. Lastly in the chapter is a guide to using WebDAV for
template editing in Eclipse.

Chapter 5 covers the usage of Lucene within OpenCms, beginning with an overview
of basic Lucene concepts. This is followed by an in-depth guide to creating a search
index in OpenCms. The guide provides an example of building a new search index
for the blog site example and describes a developer tool, which may be used to
perform test queries against the index. The chapter includes a walkthrough of
implementing a search form in OpenCms for simple cases and for more
advanced situations.

Chapter 6 continues the build out of the sample site by adding support for users
and commenting. It starts with an explanation of OpenCms security, including a
discussion on Roles, Groups, Users, and Organizational Units. It then proceeds with
the set up of the group and role structure for the sample, and shows how they are
used within the code.

Chapter 7 shows how easy it is to support user customizations of site pages. It then
show an example of this by adding RSS feed support to the sample site, allowing
users to specify a custom feed. Included in the chapter is a discussion of integrating
third-party libraries into OpenCms.

Chapter 8 describes the custom widget interface, and then shows how to design and
create a widget. The widget provides a pluggable data interface that is used to obtain
a list of selection values for a select list. The chapter then illustrates how to read XML
content fields by creating a list source that gets its values from any content field.
Finally, the chapter shows how to localize message strings and how to register and
use the custom widget.

[]

www.it-ebooks.info
Preface

Chapter 9 shows how RSS feeds can be generated from OpenCms content. It also
shows how wrapper classes can be used around structured content items to make
them easier to work with, and then walks through creation of an RSS feed generation
module using these concepts.

Chapter 10 discusses how administration points are created in OpenCms, and also
how to use OpenCms dialog classes. The chapter also discusses how widgets can
be used programmatically. An example administration point is created that ties
together topics from previous chapters, showing how to use widgets, dialogs, and
multiple screens.

What You Need for This Book


Tools needed and used for this book:

• MySQL database server


• Apache Tomcat web server
• OpenCms 7.0.2 version (New files might have been added in newer version
of OpenCms and some files, like jar files, might not be in the book-specified
location).
• Sun Java JDK 1.5
• Eclipse WTP 1.5.4
• Apache Ant 1.70
• Sysdeo Eclipse Tomcat Launcher plug-in
• Oracle JDBC Driver

Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles and an
explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "We can
include other contexts through the use of the include directive."

A block of code will be set as follows:


<jsp:useBean id="search" scope="request"
class="org.opencms.search.CmsSearch">
<jsp:setProperty name="search" property="*"/>
<% search.init(cms.getCmsObject()); %>
</jsp:useBean�
>

[]

www.it-ebooks.info
Preface

When we wish to draw your attention to a particular part of a code block, the
relevant lines or items will be made bold:
<mappings>
<mapping suffix=".jsp" />
<mapping suffix=".html" /> (add this line)
<mapping suffix=".htm" /> (add this line)
</mappings>

Any command-line input and output is written as follows:


>ant –propertyfile opencms.properties [target]

New terms and important words are introduced in a bold-type font. Words that you
see on the screen, in menus or dialog boxes for example, appear in our text like this:
"clicking the Next button moves you to the next screen".

Important notes appear in a box like this.

Tips and tricks appear like this.

Reader Feedback
Feedback from our readers is always welcome. Let us know what you think about
this book, what you liked or may have disliked. Reader feedback is important for us
to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to [email protected],


making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send
us a note in the SUGGEST A TITLE form on www.packtpub.com or
email [email protected].

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.

[]

www.it-ebooks.info
Preface

Customer Support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the Example Code for the Book


Visit http://www.packtpub.com/files/code/1052_Code.zip to directly
download the example code.

The downloadable files contain instructions on how to use them.

Errata
Although we have taken every care to ensure the accuracy of our contents, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in text or
code—we would be grateful if you would report this to us. By doing this you can
save other readers from frustration, and help to improve subsequent versions of
this book. If you find any errata, report them by visiting http://www.packtpub.
com/support, selecting your book, clicking on the Submit Errata link, and entering
the details of your errata. Once your errata are verified, your submission will be
accepted and the errata are added to the list of existing errata. The existing errata can
be viewed by selecting your title from http://www.packtpub.com/support.

Questions
You can contact us at [email protected] if you are having a problem with
some aspect of the book, and we will do our best to address it.

[]

www.it-ebooks.info
www.it-ebooks.info
Overview
This book is a guide for developers interested in building websites using the
OpenCms content management system. The book is intended for developers
who are familiar with Java, JSP, and building web applications based on the
Java J2EE framework.

In this book, we will develop a website designed for a blog writer. In the course of
building our site, we will go over these topics:

• The site design


• Overview of OpenCms
• Setting up an OpenCms development environment
• Creating structured content types
• Creating templates
• Utilizing search
• Extending OpenCms
• Allowing online users to contribute site content

We will go over all the steps involved in building a blog website using OpenCms.
We will start by describing the features and requirements of our website and will
then provide an overview of OpenCms. Next, we will discuss how to create a
development environment. We then will go over the steps involved in creating
structured content types, to hold our site content. After that, we will cover creation
of templates and Java code, to display the content. The site also supports search and
user comments;, so we will cover the Lucene search engine as well to show how to
provide login support. As the site additionally supports RSS clients and feeds, we
will discuss how to add new features to OpenCms.

Before we get into the development details, we will first discuss some of the skills
required to develop sites with OpenCms. This will provide us with a basis
for understanding the environment and tools, which we will need to do our
development work.

www.it-ebooks.info
Overview

The Site Design


Before the development of any site can begin, there should be an understanding of
the site's feature requirements. The feature requirements will often be driven by the
actual layout and design of the site. We will design and build a blog website named
'Deep Thoughts'. The design of the site homepage layout looks like this:

[]

www.it-ebooks.info
Chapter 1

The blog site is designed to support the following features:

• Blogs are listed in descending order of date, with the most recent blog
appearing at the top.
• Each blog entry is listed in teaser style, with a link to the full blog appearing
at the end.
• Blog entries support a list of topics attached to them.
• Archives of previous blogs appear on the righthand side, in
descending order.
• Past blog archives can be browsed.
• The site supports contents search with paginated results.
• Ads may be placed on the righthand side.
• Users may self register for the site.
• Registered users may add comments and create a customized RSS feed on
their homepage.
• Blogs may be viewed in various RSS formats.

In addition to the features seen in the mockup, we will also support:

• Direct editing of content in preview mode.


• User submitted comments.

[]

www.it-ebooks.info
Overview

There are two additional mockups for the site. The first one shows a detailed view of
a blog. This view is shown when a user clicks on a blog from the homepage:

[ 10 ]

www.it-ebooks.info
Chapter 1

The last mockup shows what the search result screen looks like. Search results are
shown in decreasing order of relevance to the search term. The pagination controls at
the bottom of the page allow for the results to be scrolled, if necessary:

[ 11 ]

www.it-ebooks.info
Overview

Required Developer Skills


The level of technology and coding skills required to do site development will
vary depending upon the requirements and features of the site. Designing and
architecting a site that properly utilizes and leverages OpenCms is an exercise
in itself, which we will not discuss in this book. However, we will discuss the
development tasks that are involved, once the architecture has been designed. In
general, we can think of four different developer levels and skills.

Basic Site Development


OpenCms may be used to manage content right after installation. One way of using
it is to import static files into the Virtual File System (VFS) and utilize the publishing
and version control features to manage them. In this scenario, files from an existing
non-content managed website may easily be content managed. Files in the VFS
may be created, edited, and previewed in the offline staging area, before they are
published to the online file system. When published, versions can be taken to allow
for roll back, if necessary.

Files in the VFS may also be exported to the Real File System (RFS) and served
statically or by a web server. In this way, the website can operate in exactly the same
way it did, prior to being placed into OpenCms, except for the fact that it is now
version controlled. The following illustration shows how OpenCms can be used in
this fashion:

Utilizing OpenCms this way is straightforward, needs little, if any development


effort, and probably doesn't require use of this book! However, it is worth
mentioning here that there are a number of sites that can take advantage of this.

[ 12 ]

www.it-ebooks.info
Chapter 1

For this developer audience, the skill levels will include the following:

• Operational understanding of the use of OpenCms


• Operational knowledge of Application, Web, and Database servers
• HTML coding capabilities

OpenCms also provides a sample site called TemplateOne, packaged as a module.


This module contains structured content types and templates. Although somewhat
complex and confusing, content types and templates provided with TemplateOne
may be used to construct sites without requiring development work. The
documentation for these templates may be downloaded from the OpenCms website
and installed into OpenCms.

Sites Requiring Custom Content Types


After looking at the TemplateOne samples, we may soon realize that it does not quite
address our site requirements. Perhaps, the template layouts are not what we desire
or the structured content types do not contain the fields necessary to hold our data.
In this case, we will want to develop our own JSP code and extend or create our own
custom content types. This level of development will require some understanding of
Java, JSPs and XML.

This type of development involves working within the framework provided by


OpenCms, to define the templates, content types, and JSPs, and also perhaps java
classes that we need. Developing, at this level, does not require us to utilize a
development environment such as Eclipse or Netbeans. But we will probably want to
use a nice editor for our JSP and XML code.

Before undertaking this task, we will want to understand the feature and content
requirements of our site in detail. This will allow us to properly design the templates
and custom content types, which our site will need. This is a design exercise which
will not be touched upon in this book. However, we will discuss the specific tasks
required in implementing templates and the custom content types once they have
been designed.

For this type of development, the developer requires first level skills plus:

• Understanding of OpenCms modules


• Basic Java and JSP coding skills
• Understanding of OpenCms configuration
• Understanding of OpenCms content types

[ 13 ]

www.it-ebooks.info
Overview

Sites Requiring Custom Features


There are different types of projects that require integration of features which are not
provided with OpenCms. For example, we may need a feature that automatically
imports data from a back office application into a structured content type. Or
perhaps we need to create a content type that we can easily use to define RSS feeds
from articles in our site. For these types of projects, we will want to code in Java,
using a development environment. We will also probably want to build OpenCms
for ourselves, so that we can step through the source and gain a better understanding
of how our own code will need to work. We will discuss how to do these, in the later
chapters of this book.

Developing custom features in OpenCms will require the second level skills, plus:

• Advanced Java coding skills


• Understanding of OpenCms Java interfaces

Bespoke Site Development


The last type of development level is custom development, where OpenCms is used
as a base framework or platform, and a custom site interface is built on top of it. This
type of development might be suitable where the Workplace Explorer is too general,
and a more task-specific user interface is required.

Developing, at this level, requires the third level skills, plus:

• Knowledge of OpenCms architecture and


• Familiarity with OpenCms code

This type of development is not covered in this book.

OpenCms Application Overview


Before undertaking development, it will be helpful to understand the basic design of
OpenCms. OpenCms is structured as a typical J2EE web application conforming to a
3-tier web application architecture:

[ 14 ]

www.it-ebooks.info
Another Random Document on
Scribd Without Any Related Topics
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like