Package ro.sync.ecss.imagemap
Class ImageMapFactory
java.lang.Object
ro.sync.ecss.imagemap.ImageMapFactory
Factory for image map implementations.
Builds the necessary classes from the provided texts accordingly with the specified framework.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ro.sync.ecss.imagemap.ImageMapWrapper
buildDITAWrapper
(String imageMapString, URL baseURL, AuthorAccess authorAccess, int nodeFontSize, boolean validate) Build the DITA wrapper.getImageMap
(SupportedFrameworks supportedFramework, AuthorAccess authorAccess, int nodeFontSize, URL baseURL, Map<String, String> uri2ProxyMappings, boolean validate, String... sources) Get the image map.getImageMap
(SupportedFrameworks supportedFramework, AuthorAccess authorAccess, int nodeFontSize, URL baseURL, Map<String, String> uri2ProxyMappings, String... sources) Get the image map.static ImageMapFactory
Get the image map factory instance.
-
Method Details
-
getInstance
Get the image map factory instance.- Returns:
- Returns the instance.
-
getImageMap
public IImageMapWrapper getImageMap(SupportedFrameworks supportedFramework, AuthorAccess authorAccess, int nodeFontSize, URL baseURL, Map<String, String> uri2ProxyMappings, String... sources) throws javax.xml.bind.JAXBException, ImageMapNotSuportedException, MalformedURLExceptionGet the image map.- Parameters:
supportedFramework
- The supported framework.authorAccess
- The author access.nodeFontSize
- The size of the node's font as it is used in the author page that needs the image map to be rendered.baseURL
- The base URL.uri2ProxyMappings
- The URI to proxy mappings.sources
- The sources for the image map components. Usually a single one, excepting XHTML which has two elements, one for image, one for map.- Returns:
- The image map wrapper.
- Throws:
javax.xml.bind.JAXBException
- If the UnMarshall-ing fails.ImageMapNotSuportedException
- If the image map has some arguments that are not supported by us.MalformedURLException
- If the image URL cannot be computed.
-
getImageMap
public IImageMapWrapper getImageMap(SupportedFrameworks supportedFramework, AuthorAccess authorAccess, int nodeFontSize, URL baseURL, Map<String, String> uri2ProxyMappings, boolean validate, String... sources) throws javax.xml.bind.JAXBException, ImageMapNotSuportedException, MalformedURLExceptionGet the image map.- Parameters:
supportedFramework
- The supported framework.authorAccess
- The author access.nodeFontSize
- The size of the node's font as it is used in the author page that needs the image map to be rendered.baseURL
- The base URL.uri2ProxyMappings
- The URI to proxy mappings.validate
-true
to validate the XMl structure which is loaded. if any unknown elements are encountered an exception will be thrown.sources
- The sources for the image map components. Usually a single one, excepting XHTML which has two elements, one for image, one for map.- Returns:
- The image map wrapper.
- Throws:
javax.xml.bind.JAXBException
- If the UnMarshall-ing fails.ImageMapNotSuportedException
- If the image map has some arguments that are not supported by us.MalformedURLException
- If the image URL cannot be computed.
-
buildDITAWrapper
public static ro.sync.ecss.imagemap.ImageMapWrapper buildDITAWrapper(String imageMapString, URL baseURL, AuthorAccess authorAccess, int nodeFontSize, boolean validate) throws javax.xml.bind.JAXBException, ImageMapNotSuportedException, MalformedURLException Build the DITA wrapper.- Parameters:
imageMapString
- The string with the image map, in XML format.baseURL
- The base URL (URL of the document usually).authorAccess
- The author access.nodeFontSize
- The size of the node's font as it is used in the author page that needs the image map to be rendered.validate
-true
to validate the input map.- Returns:
- The DITA wrapper
- Throws:
javax.xml.bind.JAXBException
- If the UnMarshall-ing fails.ImageMapNotSuportedException
- If the image map has some arguments that are not supported by us.MalformedURLException
- If the image URL cannot be computed.
-