Package hec.clientapp.script
Class ScriptManagerImpl
java.lang.Object
hec.clientapp.script.ScriptManagerImpl
- All Implemented Interfaces:
ScriptConstants,ScriptManager
Class for managing the storing and retrieving of scripts. possible places for
storing scripts are:
.../CWMS/All/scripts .../CWMS//scripts
at some point these locations will also be supported: ...//All/scripts
...///scripts
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassextension of Hashtable for some added functionality -
Field Summary
FieldsFields inherited from interface hec.script.ScriptConstants
ALL_MODULES, ALL_WORKSPACES, BASE, CACHE_DIR_PROP, CLIENT_MODULE, CURRENT_MODULES, CURRENT_WORKSPACE, DSS_IMPORT, JAVA_IMPORT, ROOT, SCRIPT_ZIPFILE, SCRIPTS_CONF, SCRIPTS_DIR, STD_IMPORT, SYSTEM, USERFields inherited from interface hec.script.ScriptManager
BG_COLOR, DESCRIPTION, DISPLAY_IN_MENU, DISPLAY_IN_SELECTOR, DISPLAY_TO_USER, GROUP, ICON_NAME, NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigChangeListener(hec.event.ConfigChangeListener listener) static voidbuildSortedVector(Vector src, Vector dest) checkLockedBy(String scriptPath) voidclose()remove the callbacks to the rmi files when the workspace closes.static booleandebug()booleanbooleandeleteScript(ScriptIdentifier sid, boolean notify) booleandeleteScript(ScriptIdentifier sid, boolean notify, boolean warnUser) If notify is false, only the cache removal of the script identifier will occur.booleandownLoadModule(String moduleName) download the script from the remote workspace to the local drivebooleanflushIds()flush all the script id cache'sgetCache()get the identifier for the script file.getPathFromTreePath(String treePath) given a treepath return the directory where the script file resides.getScriptIds(Vector paths) get all the scriptIdsgetScriptIdsForMode(String moduleName) get all the script ids for a module gets scripts from the following locations .../CWMS/All/script/ .../CWMS/All/scripts/modules/.../CWMS/ /scripts .../CWMS/ /scripts/modules/ getScriptIdsForObject(String scriptIdPath) booleanbooleanisUniqueScriptName(String s, Hashtable cache) protected booleanloadScript(Script newScript, Identifier id) read the script text from and Identifier id and store it in newScriptprotected booleanloadScript(Script newScript, Identifier id, ScriptIdentifier sid) read the script text from the Identifier id and store it in newScriptprotected booleanloadScripts(Vector v, Identifier dirId, String scriptTreePath) find all the .py files in the directory and return Vector of ScriptIdsbooleanlockScriptFile(boolean lock, String scriptPath) lock the script config filevoidnotifyListeners(String file, int changeType, String otherInfo) voidvoidremoveConfigChangeListener(hec.event.ConfigChangeListener listener) booleansaveScript(ScriptIdentifier sid, Script script) protected booleansaveScriptIds(Vector list, Identifier fileId) save the list script ids out to diskvoidvoid
-
Field Details
-
GLOBAL
- See Also:
-
WORKSPACE
- See Also:
-
-
Constructor Details
-
ScriptManagerImpl
public ScriptManagerImpl(hec.clientapp.client.ClientWorkspace wksp)
-
-
Method Details
-
debug
public static boolean debug() -
getScript
- Specified by:
getScriptin interfaceScriptManager
-
loadScript
read the script text from the Identifier id and store it in newScript -
loadScript
read the script text from and Identifier id and store it in newScript -
saveScript
- Specified by:
saveScriptin interfaceScriptManager
-
saveScriptIds
save the list script ids out to disk -
flushIds
public boolean flushIds()flush all the script id cache's -
getIdFromScriptId
get the identifier for the script file.- Specified by:
getIdFromScriptIdin interfaceScriptManager
-
getPathFromTreePath
given a treepath return the directory where the script file resides.- Specified by:
getPathFromTreePathin interfaceScriptManager
-
getScriptIdsForMode
get all the script ids for a module gets scripts from the following locations .../CWMS/All/script/ .../CWMS/All/scripts/modules/.../CWMS/ /scripts .../CWMS/ /scripts/modules/ - Specified by:
getScriptIdsForModein interfaceScriptManager
-
getScriptIds
get all the scriptIds -
getScriptIdsForObject
- Specified by:
getScriptIdsForObjectin interfaceScriptManager
-
loadScripts
find all the .py files in the directory and return Vector of ScriptIds -
deleteScript
- Specified by:
deleteScriptin interfaceScriptManager
-
deleteScript
- Specified by:
deleteScriptin interfaceScriptManager
-
deleteScript
If notify is false, only the cache removal of the script identifier will occur.- Specified by:
deleteScriptin interfaceScriptManager
-
isUniqueScriptName
- Specified by:
isUniqueScriptNamein interfaceScriptManager
-
isUniqueScriptName
- Specified by:
isUniqueScriptNamein interfaceScriptManager
-
downLoadModule
download the script from the remote workspace to the local drive- Specified by:
downLoadModulein interfaceScriptManager
-
lockScriptFile
lock the script config file- Specified by:
lockScriptFilein interfaceScriptManager- Parameters:
lock- whether to lock or unlock the script, true to lock, false to unlockscriptPath- path to script file
-
checkLockedBy
- Specified by:
checkLockedByin interfaceScriptManager
-
addConfigChangeListener
public void addConfigChangeListener(hec.event.ConfigChangeListener listener) - Specified by:
addConfigChangeListenerin interfaceScriptManager
-
removeConfigChangeListener
public void removeConfigChangeListener(hec.event.ConfigChangeListener listener) - Specified by:
removeConfigChangeListenerin interfaceScriptManager
-
notifyListeners
-
close
public void close()remove the callbacks to the rmi files when the workspace closes.- Specified by:
closein interfaceScriptManager
-
buildSortedVector
-
setFileManager
public void setFileManager() -
scriptAdded
- Specified by:
scriptAddedin interfaceScriptManager
-
reloadScript
- Specified by:
reloadScriptin interfaceScriptManager
-
getCache
- Specified by:
getCachein interfaceScriptManager
-