Cocoon Project

 
SourceForge.net Logo

Description
Data Persistence
UI Components
Screenshots (not available)
Tutorial (not available)
API (not available)
Download (not available)
CVS (not available)
1. Description

This project tries to add new functionality to Echo or Echo point by developing a set of components that are linked to the database. They are transparently populated , saved and updated from/into the database.

2. Data Persistence

In order to make the database access as simple as possible, I have created an API for accessing data in the database as simple as possible. This API is composed of:

  • Cocoon.Persistence. that contains

PersistenceService - an interface used as a service for creating, updating , querying data from the the database and PersistenceServiceFactory - a factory for PersistenceService instances so that the implementation is transparent to the user.

A summary of PersistenceService whould be:

public Object create(Object object, Class objectClass);
public Collection createCollection(Collection objects, Class objectClass);

public Object update(Object object, Class objectClass, Object objectId);
public Collection updateCollection(Collection objects, Class objectClass, Collection objectIds);

public void delete(Object object, Class objectClass);
public void delete(Class objectClass, Object objectId);
public void deleteCollection(Class objectClass, Collection tobeDeleted);

public Object findByPK(Class objectClass, Object ObjectId, boolean includeSubclasses);

public Object getId(Object O);
public String getIdAsString(Object O);
public long getIdAsLong(Object O);


public QueryHandler newQuery(HashMap parameterMap);
public QueryHandler newQuery(Class objectClass, boolean containSubclasses, boolean isTransactional);
public QueryHandler newQuery(Class objectClass, String filter, boolean containSubclasses, boolean isTransactional);
public QueryHandler newQuery(Class objectClass, String filter, String ordering, boolean containSubclasses, boolean isTransactional);

e.t.c

The only implementation that is provided is using  JDO (Java Data Objects). Of course this can be extended and implemented using JDBC, EJB or other persistence frameworks. This implementation is made in Cocoon.Persistence.impl package that contains a query handler as well QueryHandler.

3. UI Components

Using this persistence framework, me and Sanci , have developed a few components that are directly liked to the database, such as:

Cocoon.UI.

DataTable - a table that is being populated directly from the database, and can be updated to the database.

DataTree - a tree that is being populated directly from the database.

DataPane - a for implemetation that can be used to create or update objects in the database in a transparent manner.