Class ProjectResourceURIResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.ResourceURIResolver
-
- org.ametys.web.editor.ResourceURIResolver
-
- org.ametys.plugins.workspaces.documents.ProjectResourceURIResolver
-
- All Implemented Interfaces:
URIResolver
,PluginAware
,Contextualizable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
WebdavProjectResourceURIResolver
public class ProjectResourceURIResolver extends ResourceURIResolver implements PluginAware
URIResolver
for type "project-resource".
These links point to a file from the resources of a project.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_pluginName
plugin name-
Fields inherited from class org.ametys.web.editor.ResourceURIResolver
_webPrefixHandler
-
Fields inherited from class org.ametys.cms.transformation.ResourceURIResolver
_context, _prefixHandler, _resolver
-
-
Constructor Summary
Constructors Constructor Description ProjectResourceURIResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Project
_getProject(AmetysObject resource)
Retrieves parent projectI18nizableText
getLabel(String uri)
Get an URI label.String
getType()
Returns the type of links handled by thisURIResolver
.protected String
getUriPrefix(AmetysObject object, boolean download, boolean absolute, boolean internal)
Get the URI prefixvoid
setPluginInfo(String pluginName, String featureName, String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.-
Methods inherited from class org.ametys.web.editor.ResourceURIResolver
_getSiteName, contextualize, getRealPrefix, getResourcePath, service
-
Methods inherited from class org.ametys.cms.transformation.ResourceURIResolver
_resolve, checkLink, resolve, resolveBoundedImage, resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImage, resolveImageAsBase64, resolveImageAsBase64
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_pluginName
protected String _pluginName
plugin name
-
-
Constructor Detail
-
ProjectResourceURIResolver
public ProjectResourceURIResolver()
-
-
Method Detail
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
getType
public String getType()
Description copied from interface:URIResolver
Returns the type of links handled by thisURIResolver
.- Specified by:
getType
in interfaceURIResolver
- Overrides:
getType
in classResourceURIResolver
- Returns:
- the type of links handled by this
URIResolver
.
-
getUriPrefix
protected String getUriPrefix(AmetysObject object, boolean download, boolean absolute, boolean internal)
Description copied from class:ResourceURIResolver
Get the URI prefix- Overrides:
getUriPrefix
in classResourceURIResolver
- Parameters:
object
- The objectdownload
- true if the pointed resource is to be downloaded.absolute
- true to get an internal URI.internal
- true if the url must be absolute- Returns:
- the URI prefix
-
getLabel
public I18nizableText getLabel(String uri)
Description copied from interface:URIResolver
Get an URI label.- Specified by:
getLabel
in interfaceURIResolver
- Overrides:
getLabel
in classResourceURIResolver
- Parameters:
uri
- the uri which label to get.- Returns:
- the label.
-
_getProject
protected Project _getProject(AmetysObject resource)
Retrieves parent project- Parameters:
resource
- The resource which belongs to a project- Returns:
- The parent project
-
-