Package org.ametys.cms.content
Class CopyContentComponent.CopyAttachmentsHandler
- java.lang.Object
-
- org.apache.excalibur.xml.sax.ContentHandlerProxy
-
- org.ametys.cms.content.CopyContentComponent.CopyAttachmentsHandler
-
- All Implemented Interfaces:
ContentHandler
- Enclosing class:
- CopyContentComponent
protected static class CopyContentComponent.CopyAttachmentsHandler extends ContentHandlerProxy
A copy attachments content handler. To be used to copy the attachments linked in a rich text metadata.
-
-
Field Summary
Fields Modifier and Type Field Description protected Content_baseContentbase contentprotected CopyReport_copyReportcopy reportprotected org.slf4j.Logger_loggerloggerprotected AmetysObjectResolver_resolverAmetys object resolverprotected ModifiableContent_targetContenttarget content
-
Constructor Summary
Constructors Modifier Constructor Description protectedCopyAttachmentsHandler(ContentHandler contentHandler, Content baseContent, ModifiableContent targetContent, CopyReport copyReport, AmetysObjectResolver resolver, org.slf4j.Logger logger)Ctor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_copyAttachment(AmetysObject baseResource, String relPath)Copy an attachmentprotected void_copyIfAttachment(String href)Copy the linked resource to the new content if it is an attachment.voidstartElement(String uri, String loc, String raw, Attributes attrs)-
Methods inherited from class org.apache.excalibur.xml.sax.ContentHandlerProxy
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
-
-
-
-
Field Detail
-
_baseContent
protected Content _baseContent
base content
-
_targetContent
protected ModifiableContent _targetContent
target content
-
_copyReport
protected CopyReport _copyReport
copy report
-
_resolver
protected AmetysObjectResolver _resolver
Ametys object resolver
-
_logger
protected org.slf4j.Logger _logger
logger
-
-
Constructor Detail
-
CopyAttachmentsHandler
protected CopyAttachmentsHandler(ContentHandler contentHandler, Content baseContent, ModifiableContent targetContent, CopyReport copyReport, AmetysObjectResolver resolver, org.slf4j.Logger logger)
Ctor- Parameters:
contentHandler- The content handler to delegate to.baseContent- The content to copytargetContent- The content where to copycopyReport- The report of the copyresolver- The ametys object resolverlogger- A logger to log informations
-
-
Method Detail
-
startElement
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classContentHandlerProxy- Throws:
SAXException
-
_copyIfAttachment
protected void _copyIfAttachment(String href)
Copy the linked resource to the new content if it is an attachment.- Parameters:
href- link href attribute
-
_copyAttachment
protected void _copyAttachment(AmetysObject baseResource, String relPath)
Copy an attachment- Parameters:
baseResource- The resource to copyrelPath- The path where to copy
-
-