Class AbstractGetFilesAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.core.ui.parameter.files.AbstractGetFilesAction
-
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetExtractionResultFilesAction
,GetParameterFileAction
,GetTempSkinResourcesAction
public abstract class AbstractGetFilesAction extends ServiceableAction implements Contextualizable
Abstract action for getting child files/folders of a local application folder
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_cocoonContext
The cocoon contextprotected SourceResolver
_srcResolver
The source resolver-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description AbstractGetFilesAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
_collection2JsonObject(TraversableSource folder, TraversableSource root)
Convert collection to JSON objectprotected String
_getRelativePath(TraversableSource root, TraversableSource file)
Get the relative path from root directoryprotected Map<String,Object>
_resource2JsonObject(TraversableSource file, TraversableSource root)
Convert file to JSON objectMap
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
void
contextualize(Context context)
protected abstract String
getRootURI(Request request)
Get the URI of root directory such as 'context://WEB-INF/param'protected boolean
isIgnoredSource(TraversableSource source)
Test if the source has to be ignoredvoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_cocoonContext
protected Context _cocoonContext
The cocoon context
-
_srcResolver
protected SourceResolver _srcResolver
The source resolver
-
-
Constructor Detail
-
AbstractGetFilesAction
public AbstractGetFilesAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
-
getRootURI
protected abstract String getRootURI(Request request)
Get the URI of root directory such as 'context://WEB-INF/param'- Parameters:
request
- the request- Returns:
- The root URI
-
isIgnoredSource
protected boolean isIgnoredSource(TraversableSource source)
Test if the source has to be ignored- Parameters:
source
- The source- Returns:
- true if the source has to be ignored
-
_collection2JsonObject
protected Map<String,Object> _collection2JsonObject(TraversableSource folder, TraversableSource root)
Convert collection to JSON object- Parameters:
folder
- the folderroot
- the root directory- Returns:
- JSON object
-
_resource2JsonObject
protected Map<String,Object> _resource2JsonObject(TraversableSource file, TraversableSource root)
Convert file to JSON object- Parameters:
file
- the fileroot
- the root directory- Returns:
- JSON object
-
_getRelativePath
protected String _getRelativePath(TraversableSource root, TraversableSource file)
Get the relative path from root directory- Parameters:
root
- The root directoryfile
- The file- Returns:
- The relative path
-
-