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
FieldsModifier and TypeFieldDescriptionprotected Contentbase contentprotected CopyReportcopy reportprotected org.slf4j.Loggerloggerprotected AmetysObjectResolverAmetys object resolverprotected ModifiableContenttarget content -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCopyAttachmentsHandler(ContentHandler contentHandler, Content baseContent, ModifiableContent targetContent, CopyReport copyReport, AmetysObjectResolver resolver, org.slf4j.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.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, startPrefixMappingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, 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 Details
-
startElement
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin 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
-