Package ro.sync.ecss.extensions.dita
Class DITAExternalObjectInsertionHandler
- java.lang.Object
-
- ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler
-
- ro.sync.ecss.extensions.dita.DITAExternalObjectInsertionHandler
-
- All Implemented Interfaces:
Extension
,ExternalObjectInsertionSources
- Direct Known Subclasses:
DITAMapExternalObjectInsertionHandler
@API(type=INTERNAL, src=PUBLIC) public class DITAExternalObjectInsertionHandler extends AuthorExternalObjectInsertionHandler
Dropped URLs handler
-
-
Field Summary
-
Fields inherited from interface ro.sync.ecss.extensions.api.ExternalObjectInsertionSources
DND_DB_TREE, DND_DITA_COMPONENTS_TAB, DND_DITA_KEYS_VIEW, DND_DITA_MAPS_MANAGER, DND_DITA_MEDIA_TAB, DND_EXTERNAL, DND_IMAGE_PREVIEW, DND_PROJECT_TREE, PASTE
-
-
Constructor Summary
Constructors Constructor Description DITAExternalObjectInsertionHandler()
Default constructorDITAExternalObjectInsertionHandler(ContextKeyManagerProvider contextKeyManagerProvider)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.xml.transform.stream.StreamSource
getFilterContentOfOutputStylesheet()
Gets an XSLT stylesheet that can filter non text content from the output XML.protected java.lang.String
getImporterStylesheetFileName(AuthorAccess authorAccess)
Get the file name of the main Author paste stylesheet.protected javax.xml.transform.stream.StreamSource
getOnlyTextContentStylesheet(AuthorAccess authorAccess)
Gets an XSLT stylesheet that can extract the entire text content (and only the text content) from any input XML.void
insertURLs(AuthorAccess authorAccess, java.util.List<java.net.URL> urls, int source)
A list of URLs need to be inserted at the caret position, probably as links.void
insertURLs(AuthorAccess authorAccess, java.util.List<java.net.URL> urls, java.util.List<ReferenceType> types, int source)
A list of URLs need to be inserted at the caret position, probably as links.-
Methods inherited from class ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler
acceptSource, acceptURLs, checkImportedXHTMLContentIsPreservedEntirely, containOnlyBinaryResources, containOnlyImages, createImporterStylesheetSource, getBaseURLAtCaretPosition, getClassStylesheetResource, getContextPathNamesAndUris, getDescription, insertImportedContent, insertXHTMLFragment, setParametersToTransform, simpleTransform, simpleTransform
-
-
-
-
Constructor Detail
-
DITAExternalObjectInsertionHandler
public DITAExternalObjectInsertionHandler()
Default constructor
-
DITAExternalObjectInsertionHandler
public DITAExternalObjectInsertionHandler(ContextKeyManagerProvider contextKeyManagerProvider)
Constructor- Parameters:
contextKeyManagerProvider
- The context key manager provider
-
-
Method Detail
-
insertURLs
public void insertURLs(AuthorAccess authorAccess, java.util.List<java.net.URL> urls, java.util.List<ReferenceType> types, int source) throws AuthorOperationException
Description copied from class:AuthorExternalObjectInsertionHandler
A list of URLs need to be inserted at the caret position, probably as links.
Thesource
of the insertion can be a paste event or a drag and drop event.
This call back is received ifAuthorExternalObjectInsertionHandler.acceptURLs(AuthorAccess, List, int)
returnedtrue
for the samesource
andurls
list.
You can use it to link to those specific files/URLs.- Overrides:
insertURLs
in classAuthorExternalObjectInsertionHandler
- Parameters:
authorAccess
- The author accessurls
- The list of URLs.types
- The type of the URL reference - if null, the type will be inferred.source
- The source of the URLs, one of theAuthorExternalObjectInsertionHandler
constants.- Throws:
AuthorOperationException
- See Also:
AuthorExternalObjectInsertionHandler.insertURLs(ro.sync.ecss.extensions.api.AuthorAccess, java.util.List, java.util.List, int)
-
insertURLs
public void insertURLs(AuthorAccess authorAccess, java.util.List<java.net.URL> urls, int source) throws AuthorOperationException
Description copied from class:AuthorExternalObjectInsertionHandler
A list of URLs need to be inserted at the caret position, probably as links.
Thesource
of the insertion can be a paste event or a drag and drop event.
This call back is received ifAuthorExternalObjectInsertionHandler.acceptURLs(AuthorAccess, List, int)
returnedtrue
for the samesource
andurls
list.
You can use it to link to those specific files/URLs.- Overrides:
insertURLs
in classAuthorExternalObjectInsertionHandler
- Parameters:
authorAccess
- The author accessurls
- The list of URLs.source
- The source of the URLs, one of theAuthorExternalObjectInsertionHandler
constants.- Throws:
AuthorOperationException
- See Also:
AuthorExternalObjectInsertionHandler.insertURLs(ro.sync.ecss.extensions.api.AuthorAccess, java.util.List, int)
-
getImporterStylesheetFileName
protected java.lang.String getImporterStylesheetFileName(AuthorAccess authorAccess)
Description copied from class:AuthorExternalObjectInsertionHandler
Get the file name of the main Author paste stylesheet. It will be resolved in the context of the current class loader.- Overrides:
getImporterStylesheetFileName
in classAuthorExternalObjectInsertionHandler
- Parameters:
authorAccess
- The author access API.- Returns:
- the file name of the main Author paste stylesheet. It will be resolved in the context of the current class loader.
- See Also:
AuthorExternalObjectInsertionHandler.getImporterStylesheetFileName(ro.sync.ecss.extensions.api.AuthorAccess)
-
getOnlyTextContentStylesheet
protected javax.xml.transform.stream.StreamSource getOnlyTextContentStylesheet(AuthorAccess authorAccess)
Gets an XSLT stylesheet that can extract the entire text content (and only the text content) from any input XML.- Overrides:
getOnlyTextContentStylesheet
in classAuthorExternalObjectInsertionHandler
- Parameters:
authorAccess
- The author access- Returns:
- The XSLT stylesheet that keeps only the text content of input.
-
getFilterContentOfOutputStylesheet
protected javax.xml.transform.stream.StreamSource getFilterContentOfOutputStylesheet()
Description copied from class:AuthorExternalObjectInsertionHandler
Gets an XSLT stylesheet that can filter non text content from the output XML.- Overrides:
getFilterContentOfOutputStylesheet
in classAuthorExternalObjectInsertionHandler
- Returns:
- The XSLT stylesheet that can filter non text content from the output XML.
- See Also:
AuthorExternalObjectInsertionHandler.getFilterContentOfOutputStylesheet()
-
-