Class ProjectResourceURIResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.AbstractURIResolver
-
- 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 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 projectprotected String
_getSiteName(Resource resource)
Get the site name from resourceI18nizableText
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
getRealPrefix, getResourcePath, service
-
Methods inherited from class org.ametys.cms.transformation.ResourceURIResolver
_resolve, checkLink, contextualize, resolveImageAsBase64
-
Methods inherited from class org.ametys.cms.transformation.AbstractURIResolver
resolve, resolveBoundedImage, resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImage, resolveImageAsBase64
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
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
.
-
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.
-
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
-
_getSiteName
protected String _getSiteName(Resource resource)
Description copied from class:ResourceURIResolver
Get the site name from resource- Overrides:
_getSiteName
in classResourceURIResolver
- Parameters:
resource
- the resource- Returns:
- the site name
-
_getProject
protected Project _getProject(AmetysObject resource)
Retrieves parent project- Parameters:
resource
- The resource which belongs to a project- Returns:
- The parent project
-
-