Package org.ametys.plugins.odfweb
Class OdfURIResolver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.odf.OdfURIResolver
-
- org.ametys.plugins.odfweb.OdfURIResolver
-
- All Implemented Interfaces:
URIResolver
,LogEnabled
,Contextualizable
,Serviceable
public class OdfURIResolver extends OdfURIResolver implements Contextualizable
URIResolver
for a ODF Content.
-
-
Field Summary
Fields Modifier and Type Field Description private Context
_context
private OdfPageHandler
_odfPageHandler
private OdfPageResolver
_odfPageResolver
private URIPrefixHandler
_prefixHandler
private RenderingContextHandler
_renderingContextHandler
private SiteManager
_siteManager
-
Fields inherited from class org.ametys.odf.OdfURIResolver
_resolver
-
-
Constructor Summary
Constructors Constructor Description OdfURIResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_getContentURI(Content content, String siteName, RenderingContext context, boolean absolute, boolean internal)
Get the content URIprivate Page
_getCoursePage(Course course, Page odfRootPage, String[] paths)
private Page
_getSubProgramPage(SubProgram subProgram, Page odfRootPage, String[] paths)
void
contextualize(Context context)
String
resolve(String uri, boolean download, boolean absolute, boolean internal)
Resolves a link URI for rendering purposes.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.odf.OdfURIResolver
checkLink, getLabel, getType, resolveBoundedImage, resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImage, resolveImageAsBase64
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_siteManager
private SiteManager _siteManager
-
_odfPageResolver
private OdfPageResolver _odfPageResolver
-
_renderingContextHandler
private RenderingContextHandler _renderingContextHandler
-
_prefixHandler
private URIPrefixHandler _prefixHandler
-
_odfPageHandler
private OdfPageHandler _odfPageHandler
-
-
Constructor Detail
-
OdfURIResolver
public OdfURIResolver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classOdfURIResolver
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
resolve
public String resolve(String uri, boolean download, boolean absolute, boolean internal)
Description copied from interface:URIResolver
Resolves a link URI for rendering purposes.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.- Specified by:
resolve
in interfaceURIResolver
- Overrides:
resolve
in classOdfURIResolver
- Parameters:
uri
- the link URI.download
- true if the pointed resource is to be downloaded.absolute
- true if the url must be absoluteinternal
- true to get an internal URI.- Returns:
- the path to the resource.
-
_getSubProgramPage
private Page _getSubProgramPage(SubProgram subProgram, Page odfRootPage, String[] paths)
-
_getCoursePage
private Page _getCoursePage(Course course, Page odfRootPage, String[] paths)
-
_getContentURI
protected String _getContentURI(Content content, String siteName, RenderingContext context, boolean absolute, boolean internal)
Get the content URI- Parameters:
content
- The contentsiteName
- The site namecontext
- The rendering contextabsolute
- true if the url must be absoluteinternal
- true to get an internal URI.- Returns:
- the content URI
-
-