org.apache.lenya.cms.site.topicmap
Class TopicMapSiteManager

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

public class TopicMapSiteManager
extends AbstractSiteManager

Site manager to support topic maps.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lenya.cms.site.AbstractSiteManager
AbstractSiteManager.NodeComparator
 
Field Summary
 
Fields inherited from class org.apache.lenya.cms.site.AbstractSiteManager
manager
 
Fields inherited from interface org.apache.lenya.cms.site.SiteManager
ROLE
 
Constructor Summary
TopicMapSiteManager()
           
 
Method Summary
 void add(java.lang.String path, Document document)
          Adds a document to the site structure.
 boolean contains(Document resource)
          Checks if the site structure contains a certain resource in a certain area.
 boolean containsInAnyLanguage(Document resource)
          Checks if the site structure contains any language version of a certain resource in a certain area.
 void copy(Document sourceDocument, Document destinationDocument)
          Copies a document in the site structure.
 DocumentLocator getAvailableLocator(DocumentFactory factory, DocumentLocator document)
          Checks if the document does already exist.
 Document[] getDocuments(DocumentFactory map, Publication publication, java.lang.String area)
          Returns all documents in a certain area.
 DocumentLocator[] getRequiredResources(DocumentFactory map, DocumentLocator locator)
          Returns the resources which are required by a certain resource.
 SiteNode[] getRequiringResources(DocumentFactory map, SiteNode resource)
          Returns the resources which require a certain resource.
 SiteStructure getSiteStructure(DocumentFactory map, Publication publiation, java.lang.String area)
           
 boolean isVisibleInNav(Document document)
          Returns the visibility of a node in the navigation.
 void move(SiteNode source, java.lang.String destinationPath)
           
 boolean requires(DocumentFactory map, SiteNode dependingResource, SiteNode requiredResource)
          Checks if a resource requires another one.
 void set(java.lang.String path, Document document)
          Sets a document to the site structure.
 void setLabel(Document document, java.lang.String label)
           
 void setVisibleInNav(Document document, boolean visibleInNav)
          Sets the visibility of a node in the navigation.
 
Methods inherited from class org.apache.lenya.cms.site.AbstractSiteManager
check, isAntisymmetric, isIrreflexive, isTransitive, service, sortAscending
 
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
 

Constructor Detail

TopicMapSiteManager

public TopicMapSiteManager()
Method Detail

requires

public boolean requires(DocumentFactory map,
                        SiteNode dependingResource,
                        SiteNode requiredResource)
                 throws SiteException
Description copied from interface: SiteManager
Checks if a resource requires another one.

Parameters:
map - The identity map to operate on.
dependingResource - The depending resource.
requiredResource - The required resource.
Returns:
A boolean value.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.requires(org.apache.lenya.cms.publication.DocumentFactory, org.apache.lenya.cms.site.SiteNode, org.apache.lenya.cms.site.SiteNode)

getRequiringResources

public SiteNode[] getRequiringResources(DocumentFactory map,
                                        SiteNode resource)
                                 throws SiteException
Description copied from interface: SiteManager
Returns the resources which require a certain resource.

Parameters:
map - The identity map to operate on.
resource - The required resource.
Returns:
An array of resources.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.getRequiringResources(org.apache.lenya.cms.publication.DocumentFactory, org.apache.lenya.cms.site.SiteNode)

add

public void add(java.lang.String path,
                Document document)
         throws SiteException
Description copied from interface: SiteManager
Adds a document to the site structure.

Parameters:
path - The path.
document - The document to add.
Throws:
SiteException - if the document is already contained.
See Also:
org.apache.lenya.cms.site.SiteManager#add(org.apache.lenya.cms.publication.Document)

contains

public boolean contains(Document resource)
                 throws SiteException
Description copied from interface: SiteManager
Checks if the site structure contains a certain resource in a certain area.

Parameters:
resource - The resource.
Returns:
A boolean value.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.contains(org.apache.lenya.cms.publication.Document)

containsInAnyLanguage

public boolean containsInAnyLanguage(Document resource)
                              throws SiteException
Description copied from interface: SiteManager
Checks if the site structure contains any language version of a certain resource in a certain area.

Parameters:
resource - The resource.
Returns:
A boolean value.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.containsInAnyLanguage(org.apache.lenya.cms.publication.Document)

copy

public void copy(Document sourceDocument,
                 Document destinationDocument)
          throws SiteException
Description copied from interface: SiteManager
Copies a document in the site structure.

Parameters:
sourceDocument - The source document.
destinationDocument - The destination document.
Throws:
SiteException - when something went wrong.
See Also:
SiteManager.copy(org.apache.lenya.cms.publication.Document, org.apache.lenya.cms.publication.Document)

setVisibleInNav

public void setVisibleInNav(Document document,
                            boolean visibleInNav)
                     throws SiteException
Description copied from interface: SiteManager
Sets the visibility of a node in the navigation. It is meant to hide specific nodes within the "public" navigation whereas the node is visible within the info/site area.

Parameters:
document - The document.
visibleInNav - The visibility.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.setVisibleInNav(org.apache.lenya.cms.publication.Document, boolean)

getDocuments

public Document[] getDocuments(DocumentFactory map,
                               Publication publication,
                               java.lang.String area)
                        throws SiteException
Description copied from interface: SiteManager
Returns all documents in a certain area.

Parameters:
map - The identityMap to use.
publication - The publication.
area - The area.
Returns:
An array of documents.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.getDocuments(org.apache.lenya.cms.publication.DocumentFactory, org.apache.lenya.cms.publication.Publication, java.lang.String)

getSiteStructure

public SiteStructure getSiteStructure(DocumentFactory map,
                                      Publication publiation,
                                      java.lang.String area)
                               throws SiteException
Parameters:
map - The identity map.
publiation - The publication.
area - The area.
Returns:
The object that holds the site structure information.
Throws:
SiteException - if an error occurs.
See Also:
SiteManager.getSiteStructure(org.apache.lenya.cms.publication.DocumentFactory, org.apache.lenya.cms.publication.Publication, java.lang.String)

getAvailableLocator

public DocumentLocator getAvailableLocator(DocumentFactory factory,
                                           DocumentLocator document)
                                    throws SiteException
Description copied from interface: SiteManager
Checks if the document does already exist. If it does, returns a non-existing document with a similar document ID. If it does not, the original document is returned.

Parameters:
factory - The document factory.
document - The locator.
Returns:
A locator.
Throws:
SiteException - if the new document could not be built.
See Also:
org.apache.lenya.cms.site.SiteManager#getAvailableDocument(org.apache.lenya.cms.publication.Document)

isVisibleInNav

public boolean isVisibleInNav(Document document)
                       throws SiteException
Description copied from interface: SiteManager
Returns the visibility of a node in the navigation.

Parameters:
document - The document.
Returns:
A boolean value.
Throws:
SiteException - if an error occurs.

set

public void set(java.lang.String path,
                Document document)
         throws SiteException
Description copied from interface: SiteManager
Sets a document to the site structure.

Parameters:
path - The path.
document - The document to add.
Throws:
SiteException - if the document is already contained or if the path doesn't exist.

getRequiredResources

public DocumentLocator[] getRequiredResources(DocumentFactory map,
                                              DocumentLocator locator)
                                       throws SiteException
Description copied from interface: SiteManager
Returns the resources which are required by a certain resource.

Parameters:
map - The identity map to operate on.
locator - The depending locator.
Returns:
An array of resources.
Throws:
SiteException - if an error occurs.

move

public void move(SiteNode source,
                 java.lang.String destinationPath)
          throws SiteException
Throws:
SiteException

setLabel

public void setLabel(Document document,
                     java.lang.String label)
              throws SiteException
Throws:
SiteException


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