public class UploadedLinksHTMLEditionHandler extends AbstractHTMLEditionHandler implements Initializable
Modifier and Type | Field and Description |
---|---|
private Context |
_cocoonContext |
private Set<String> |
_storedFileExtensions |
private boolean |
_storeFileLinks |
private boolean |
_tagToIgnore |
private CurrentUserProvider |
_userProvider |
_contentHandler, _context, _lexicalHandler, _manager
Constructor and Description |
---|
UploadedLinksHTMLEditionHandler() |
Modifier and Type | Method and Description |
---|---|
private void |
_copyLinkAttributes(Attributes attrs,
AttributesImpl newAttrs) |
void |
contextualize(Context context) |
void |
endElement(String uri,
String loc,
String raw) |
void |
initialize() |
protected boolean |
processLink(String uri,
String loc,
String raw,
Attributes attrs)
Process a link tag.
|
void |
service(ServiceManager serviceManager) |
void |
startDocument() |
void |
startElement(String uri,
String loc,
String raw,
Attributes attrs) |
protected Resource |
storeAttachment(String initialFileName,
InputStream is,
String mimeType,
Date lastModified)
Store a file as attachment.
|
protected boolean |
storeExternalFile(String fileName)
Test if the external file is to be stored as a local resource.
|
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, setLexicalHandler, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMapping
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private CurrentUserProvider _userProvider
private Context _cocoonContext
private boolean _tagToIgnore
private boolean _storeFileLinks
private Set<String> _storedFileExtensions
public UploadedLinksHTMLEditionHandler()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
contextualize
in class AbstractHTMLEditionHandler
ContextException
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class AbstractHTMLEditionHandler
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class AbstractHTMLEditionHandler
SAXException
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class AbstractHTMLEditionHandler
SAXException
public void endElement(String uri, String loc, String raw) throws SAXException
endElement
in interface ContentHandler
endElement
in class AbstractHTMLEditionHandler
SAXException
protected boolean processLink(String uri, String loc, String raw, Attributes attrs)
uri
- the namespace URI.loc
- the local name (without prefix).raw
- the qualified name (with prefix).attrs
- the element attributes.protected boolean storeExternalFile(String fileName)
fileName
- the file name.protected Resource storeAttachment(String initialFileName, InputStream is, String mimeType, Date lastModified)
initialFileName
- the initial file name.is
- an input stream on the file.mimeType
- the file mime type.lastModified
- the last modification date.private void _copyLinkAttributes(Attributes attrs, AttributesImpl newAttrs)