org.apache.lenya.cms.site
Class AbstractSiteManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.site.AbstractSiteManager
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, SiteManager
Direct Known Subclasses:
TopicMapSiteManager

public abstract class AbstractSiteManager
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements SiteManager, org.apache.avalon.framework.service.Serviceable

Abstract base class for site managers.

Version:
$Id: AbstractSiteManager.java 473861 2006-11-12 03:51:14Z gregor $

Nested Class Summary
 class AbstractSiteManager.NodeComparator
          Compares nodes according to the dependence relation.
 
Field Summary
protected  org.apache.avalon.framework.service.ServiceManager manager
           
 
Fields inherited from interface org.apache.lenya.cms.site.SiteManager
ROLE
 
Constructor Summary
AbstractSiteManager()
          Ctor.
 
Method Summary
protected  boolean check(DocumentFactory map, NodeSet set)
          Checks if the dependence relation is a strict partial order.
protected  boolean isAntisymmetric(DocumentFactory map, NodeSet set)
          Checks if the dependence relation is antisymmetric.
protected  boolean isIrreflexive(DocumentFactory map, NodeSet set)
          Checks if the dependence relation is irreflexive.
protected  boolean isTransitive(DocumentFactory map, NodeSet set)
          Checks if the dependence relation is transitive.
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 SiteNode[] sortAscending(SiteNode[] nodes)
          Sorts a set of nodes using the "requires" relation.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.lenya.cms.site.SiteManager
add, contains, containsInAnyLanguage, copy, getAvailableLocator, getDocuments, getRequiredResources, getRequiringResources, getSiteStructure, isVisibleInNav, requires, set, setVisibleInNav
 

Field Detail

manager

protected org.apache.avalon.framework.service.ServiceManager manager
Constructor Detail

AbstractSiteManager

public AbstractSiteManager()
Ctor.

Parameters:
manager - The service manager.
Method Detail

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

sortAscending

public SiteNode[] sortAscending(SiteNode[] nodes)
                         throws SiteException
Description copied from interface: SiteManager
Sorts a set of nodes using the "requires" relation.

Specified by:
sortAscending in interface SiteManager
Parameters:
nodes - The set.
Returns:
A sorted array of nodes.
Throws:
SiteException - if an error occurs.
See Also:
org.apache.lenya.cms.site.SiteManager#sortAscending(org.apache.lenya.cms.publication.util.DocumentSet)

check

protected boolean check(DocumentFactory map,
                        NodeSet set)
                 throws SiteException
Checks if the dependence relation is a strict partial order.

Parameters:
map - The identity map to operate on.
set - The document set to check.
Returns:
A boolean value.
Throws:
SiteException - when something went wrong.

isAntisymmetric

protected boolean isAntisymmetric(DocumentFactory map,
                                  NodeSet set)
                           throws SiteException
Checks if the dependence relation is antisymmetric.

Parameters:
map - The identity map to operate on.
set - The document set to check.
Returns:
A boolean value.
Throws:
SiteException - when something went wrong.

isTransitive

protected boolean isTransitive(DocumentFactory map,
                               NodeSet set)
                        throws SiteException
Checks if the dependence relation is transitive.

Parameters:
map - The identity map to operate on.
set - The document set to check.
Returns:
A boolean value.
Throws:
SiteException - when something went wrong.

isIrreflexive

protected boolean isIrreflexive(DocumentFactory map,
                                NodeSet set)
                         throws SiteException
Checks if the dependence relation is irreflexive.

Parameters:
map - The identity map to operate on.
set - The document set.
Returns:
A boolean value
Throws:
SiteException


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.