Class ParametersClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
org.ametys.core.ui.StaticClientSideElement
org.ametys.plugins.core.ui.parameter.files.ParametersClientSideElement
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
Component for operations on parameters files and folders
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
Field Summary
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Check if application is in normal mode, otherwise throw an exception.protected void
_checkUserRight
(String rightId, String context) Check if the user right to access the featureAdd a new folderdeleteFile
(String relPath) Remove a folder or a fileboolean
fileExists
(String parentRelPath, String name) Check if a file with same name already existrenameFile
(String relPath, String name) Rename a file or a foldersaveParameters
(String relPath, String text) Saves parameters file.void
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
ParametersClientSideElement
public ParametersClientSideElement()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
saveParameters
Saves parameters file.- Parameters:
relPath
- the relative file's path from parameters files root directorytext
- the UTF-8 file content to save- Returns:
- The result map
- Throws:
IOException
- If an error occurred while saving
-
addFolder
Add a new folder- Parameters:
parentRelPath
- the relative parent file's path from parameters files root directoryname
- The name of folder to create- Returns:
- a map containing the name of the created folder, its path and the path of its parent
- Throws:
IOException
- If an error occurred while creating folder
-
deleteFile
Remove a folder or a file- Parameters:
relPath
- the relative file's path from parameters files root directory- Returns:
- the result map
- Throws:
IOException
- If an error occurs while removing the folder
-
renameFile
Rename a file or a folder- Parameters:
relPath
- the relative file's path from parameters files root directoryname
- the new name of the file/folder- Returns:
- the result map
- Throws:
IOException
- if an error occurs while renaming the file/folder
-
fileExists
Check if a file with same name already exist- Parameters:
parentRelPath
- the path where the file will be addedname
- the name of the file- Returns:
- result the server's response in JSON
- Throws:
Exception
- if an error occurred
-
_checkUserRight
Check if the user right to access the feature- Parameters:
rightId
- The right idcontext
- The right context- Throws:
IllegalStateException
- if the user has no right
-
_checkNotSafeMode
Check if application is in normal mode, otherwise throw an exception.
-