Package org.ametys.cms.contenttype
Class DefaultDocbookUpdateHandler
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.contenttype.DockbookUpdateHandler
-
- org.ametys.cms.contenttype.DefaultDocbookUpdateHandler
-
- All Implemented Interfaces:
LogEnabled
,Serviceable
,ContentHandler
,LexicalHandler
- Direct Known Subclasses:
WebDocbookUpdateHandler
public class DefaultDocbookUpdateHandler extends DockbookUpdateHandler implements Serviceable
This handler look for links, images or video url which make reference to a AmetysObject (content, resources, ...) in a RichText. It must be used after a copy of a Content to changes theses references if necessary.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
_logger
protected AmetysObjectResolver
_resolver
The ametys object resolver-
Fields inherited from class org.ametys.cms.contenttype.DockbookUpdateHandler
_contentHandler, _createdContent, _createdObject, _initialAOPath, _initialContent, _initialContentPath, _initialObject, _lexicalHandler
-
-
Constructor Summary
Constructors Constructor Description DefaultDocbookUpdateHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_copyAttributes(Attributes attrs, AttributesImpl newAttrs)
Copy attributesprotected Attributes
_getAttributesForLink(Attributes attrs)
Get attributes for link elementsprotected Attributes
_getAttributesForMediaObject(Attributes attrs)
Get attributes for media objects such as image, flashprotected String
_getUpdatedAmetysObjectId(String id)
Return the updated ametys object idprotected String
_getUpdatedHrefForLocalData(String href)
Returns the updated href for local datavoid
service(ServiceManager smanager)
void
startElement(String uri, String loc, String raw, Attributes attrs)
-
Methods inherited from class org.ametys.cms.contenttype.DockbookUpdateHandler
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setContentHandler, setCreatedContent, setCreatedObject, setDocumentLocator, setInitialContent, setInitialObject, setLexicalHandler, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_logger
private static org.slf4j.Logger _logger
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
-
Constructor Detail
-
DefaultDocbookUpdateHandler
public DefaultDocbookUpdateHandler()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
startElement
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDockbookUpdateHandler
- Throws:
SAXException
-
_getAttributesForLink
protected Attributes _getAttributesForLink(Attributes attrs)
Get attributes for link elements- Parameters:
attrs
- the attributes- Returns:
- the new attributes
-
_getAttributesForMediaObject
protected Attributes _getAttributesForMediaObject(Attributes attrs)
Get attributes for media objects such as image, flash- Parameters:
attrs
- the attributes- Returns:
- the new attributes
-
_copyAttributes
protected void _copyAttributes(Attributes attrs, AttributesImpl newAttrs)
Copy attributes- Parameters:
attrs
- the attributes to copynewAttrs
- the new attributes
-
_getUpdatedHrefForLocalData
protected String _getUpdatedHrefForLocalData(String href)
Returns the updated href for local data- Parameters:
href
- the href to update- Returns:
- the updated href
-
_getUpdatedAmetysObjectId
protected String _getUpdatedAmetysObjectId(String id)
Return the updated ametys object id- Parameters:
id
- the id to update- Returns:
- the updated id
-
-