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
A copy attachments content handler.
To be used to copy the attachments linked in a rich text attribute.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Content
base contentprotected CopyReport
copy reportprotected Logger
loggerprotected AmetysObjectResolver
Ametys object resolverprotected ModifiableContent
target content -
Constructor Summary
ModifierConstructorDescriptionprotected
CopyAttachmentsHandler
(ContentHandler contentHandler, Content baseContent, ModifiableContent targetContent, CopyReport copyReport, AmetysObjectResolver resolver, Logger logger) Ctor -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.void
startElement
(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
_baseContent
base content -
_targetContent
target content -
_copyReport
copy report -
_resolver
Ametys object resolver -
_logger
logger
-
-
Constructor Details
-
CopyAttachmentsHandler
protected CopyAttachmentsHandler(ContentHandler contentHandler, Content baseContent, ModifiableContent targetContent, CopyReport copyReport, AmetysObjectResolver resolver, 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 Details
-
startElement
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classContentHandlerProxy
- Throws:
SAXException
-
_copyIfAttachment
Copy the linked resource to the new content if it is an attachment.- Parameters:
href
- link href attribute
-
_copyAttachment
Copy an attachment- Parameters:
baseResource
- The resource to copyrelPath
- The path where to copy
-