public class UploadedDataHTMLEditionHandler extends AbstractHTMLEditionHandler
| Modifier and Type | Field and Description |
|---|---|
private static Pattern |
__INLINE_IMAGE_MARKER |
private AmetysObjectResolver |
_ametysResolver |
private Context |
_cocoonContext |
private Map |
_objectModel |
private SourceResolver |
_resolver |
private ModifiableRichText |
_richText |
private boolean |
_tagToIgnore |
private UploadManager |
_uploadManager |
private Set<String> |
_usedLocalFiles |
private CurrentUserProvider |
_userProvider |
_contentHandler, _context, _lexicalHandler, _manager| Constructor and Description |
|---|
UploadedDataHTMLEditionHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addDimensionAttributes(InputStream inputStream,
AttributesImpl attrs)
Add an image's width and height to the XML attributes.
|
private void |
_copyAttributes(Attributes attrs,
AttributesImpl newAttrs)
Copy the attributes.
|
private Attributes |
_getAttributesForTemp(Attributes attrs) |
protected RichText |
_getMeta(CompositeMetadata meta,
String metadataName)
Get the rich text meta
|
private StringBuilder |
_getRequestURI(Request request)
Get the cms uri
|
private String |
_handleInternalFile(String src,
AttributesImpl newAttrs,
String initialFileName) |
private String |
_handleRemoteFile(String src,
AttributesImpl newAttrs,
String initialFileName) |
protected Attributes |
_processLocal(Attributes attrs)
Process a local file.
|
protected Attributes |
_processResource(Attributes attrs)
Process a resource.
|
protected String |
_storeFile(String initialFileName,
InputStream is,
String mimeType,
Date lastModified)
Store a file as rich text data.
|
void |
contextualize(Context context) |
void |
endDocument() |
void |
endElement(String uri,
String loc,
String raw) |
void |
service(ServiceManager sManager) |
void |
startDocument() |
void |
startElement(String uri,
String loc,
String raw,
Attributes attrs) |
characters, comment, endCDATA, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, setLexicalHandler, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMappingenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate static final Pattern __INLINE_IMAGE_MARKER
private UploadManager _uploadManager
private CurrentUserProvider _userProvider
private SourceResolver _resolver
private AmetysObjectResolver _ametysResolver
private Context _cocoonContext
private boolean _tagToIgnore
private Set<String> _usedLocalFiles
private ModifiableRichText _richText
private Map _objectModel
public UploadedDataHTMLEditionHandler()
public void contextualize(Context context) throws ContextException
contextualize in interface Contextualizablecontextualize in class AbstractHTMLEditionHandlerContextExceptionpublic void service(ServiceManager sManager) throws ServiceException
service in interface Serviceableservice in class AbstractHTMLEditionHandlerServiceExceptionpublic void startDocument() throws SAXException
startDocument in interface ContentHandlerstartDocument in class AbstractHTMLEditionHandlerSAXExceptionpublic void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
startElement in interface ContentHandlerstartElement in class AbstractHTMLEditionHandlerSAXExceptionprivate String _handleInternalFile(String src, AttributesImpl newAttrs, String initialFileName) throws MalformedURLException, IOException, URISyntaxException
private String _handleRemoteFile(String src, AttributesImpl newAttrs, String initialFileName) throws MalformedURLException, IOException
MalformedURLExceptionIOExceptionprivate void _copyAttributes(Attributes attrs, AttributesImpl newAttrs)
attrs - the attributes to copy.newAttrs - the attributes to copy to.private StringBuilder _getRequestURI(Request request)
request - The requestprivate Attributes _getAttributesForTemp(Attributes attrs)
protected String _storeFile(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.protected Attributes _processLocal(Attributes attrs)
attrs - the img tag attributes.protected Attributes _processResource(Attributes attrs)
attrs - the img tag attributes.protected void _addDimensionAttributes(InputStream inputStream, AttributesImpl attrs)
inputStream - an input stream on the image.attrs - the attributes to fill.public void endElement(String uri, String loc, String raw) throws SAXException
endElement in interface ContentHandlerendElement in class AbstractHTMLEditionHandlerSAXExceptionpublic void endDocument() throws SAXException
endDocument in interface ContentHandlerendDocument in class AbstractHTMLEditionHandlerSAXExceptionprotected RichText _getMeta(CompositeMetadata meta, String metadataName)
meta - The composite metametadataName - The metadata name (with /)