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 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 URIvoid
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
-
-
-
-
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.
-
_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
-
-