Essentials Overview Features License Installation FAQ Sample Sites Resources Todo Changes Download Binaries Source Code Supporting Projects Documentation Configuration Guide Javadocs Development Jetspeed Tutorial Portlet Catalog Components Registry Security Syndication WAP Customization Cache PSML Forwards Get Involved Contributors CVS Repository View CVS CVS Branches Coding Spec Bug Database |
Overview
The Registry stores most of dynamically configurable elements you can add to the engine. Among these elements, you'll find the list of available portlets, the layout elements definitions and the known client defintions This registry uses the pluggable Turbine service architecture so that you can select from different implementations depending on your requirements. There are currently 2 available implementations by default: a XML file based implementation an OJB based, SQL database driven implementation This document will present the different elements encountered in the registry and the base API.
Elements of the Registry
> Currently the Registry can store 7 different types of elements used within the Jetspeed engine
> Element | Description
> Portlets View XML syntax | The basic elements to store within Registry are the portlet definitions that define which components are available to be placed on the users portal pages.
> Controls View XML syntax | The controls are the elements of the global layout that decorate a portlet on a page and provides access to the portal actions defined for the portlet, like customization. Only controls defined the Registry can be used in the user pages. For more information on controls, check out the Jetspeed Layout overview.
> Controllers View XML syntax | The controllers define how the portlets are displayed on a portal page (in columns, panes , etc...) and allow more or less sophisticated customization of a user page. By default, all the controllers defined in the registry are available for users to customize their page layout. For more information on controllers, check out the Jetspeed Layout overview.
> Skins View XML syntax | The skins define the color schemes used by the portal on a specific user page (or part of a page) For more information on skins, check out the Jetspeed Layout overview.
> Media Types View XML syntax | The media-types define the different variations of markup rendering supported by this specific instance of Jetspeed. Working in conjunction with the Clients definition, it enables you to control how the different user-agents access your portal For more information on client handling, check out the Client detection.
> Clients View XML syntax | The clients definitions entries are used to describe user agent capabilities and in conjunction with Media types information define how the clients access the portal For more information on client handling, check out the Client detection.
> Security View XML syntax | The security entries define standard set of permissions that can be associated to page elements and portal actions to protect their access. For more information, check out the Security information.
Administrating the Registry
Currently, there are no complete GUI for administrating the registry elements in Jetspeed, you can only browse the contents of the different registries by using the administration console. In most case you'll currently need to use implementation specific ways to manipulate your entries, like editing the XML files directly. An effort is currently underway to create complete administration tools for registry manipulation, so watch this space !
Registry API
> The Registry system has a very simple API, based on one Turbine service and an interface based object model.
> Object Model
> > The object model API is defined in the following package:
> >     org.apache.jetspeed.om.registry
> This API defines the operations available on the different registries as well as the structure of the object stored within them. The `Registry` and `RegistryEntry` interfaces define the standard methods of a registry or an entry. For some registries, sub-interfaces declare additional methods that are only meaningful for a specific type of entry. For example the `ClientRegistry` interface adds the capacity to search for a specific entry matching a given capability. A default implementation of this object model can be found in the base subpackage of the registry object model. This implementation is used by the XML Registry service implementation.
> Registry Service
> > The `RegistryService` is a Turbine service that manages the persistence of the different registries and instantiates them. A commodity static facade is provided to simplify access to this service.
> >     Registry service package:
> >     org.apache.jetspeed.services.registry

> >     Registry service interface:
> >     org.apache.jetspeed.services.registry.RegsitryService

> >     Registry service facade:
> >     org.apache.jetspeed.services.Registry
> The `RegistryService` redefines several of the basic operations of the registry object model (add or remove entries) as a convenience to For some registries, sub-interfaces declare additional methods that are only meaningful for a specific type of entry. For example the `ClientRegistry` interface adds the capacity to search for a specific entry matching a given capability.
> Examples
> > Here are some code fragments on how to use the registry service for basic operations
> >     import org.apache.jetspeed.services.registry.Registry;
> >     import org.apache.jetspeed.om.registry.PortletRegistry;
> >     import org.apache.jetspeed.om.registry.PortletEntry;
> >     import org.apache.jetspeed.om.registry.RegistryException;
> >     import org.apache.turbine.util.Log;

> >     //create a new entry

> >     PortletEntry myEntry = (PortletEntry)Registry.createEntry(Registry.PORTLET);
> >     myEntry.setName("myEntry");
> >     myEntry.setHidden(true);
> >     myEntry.setType(PortletEntry.TYPE_INSTANCE);
> >     myEntry.setClassname("com.mycompany.myportlet");

> >     //Add it to the Registry
> >     try
> >     {
> >       Registry.addEntry(Registry.PORTLET, myEntry);
> >     }
> >     catch (RegistryException e)
> >     {
> >       Log.error("Impossible to add entry in registry" + myEntry, e);
> >     }

> >     //Retrieve it and update
> >     myEntry = (PortletEntry)Registry.getEntry(Registry.PORTLET, "myEntry");
> >     myEntry.addParameter("_control", "ClearControl");
> >     myEntry.addParameter("myParam", "myValue");

> >     //Then delete it from registry
> >     try
> >     {
> >       Registry.removeEntry(Registry.PORTLET, myEntry);
> >     }
> >     catch (RegistryException e)
> >     {
> >       Log.error("Impossible to remove entry from registry" + myEntry, e);
> >     }
> The `RegistryService` redefines several of the basic operations of the registry object model (add or remove entries) as a convenience to For some registries, sub-interfaces declare additional methods that are only meaningful for a specific type of entry. For example the `ClientRegistry` interface adds the capacity to search for a specific entry matching a given capability.
Copyright © 1999-2002, Apache Software Foundation