Class ModuleLibrary
java.lang.Object
com.inductiveautomation.ignition.common.script.ModuleLibrary
Class for project resource Python script libraries
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ModuleLibrary.ScriptHintScopestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Patternstatic final ResourceTypestatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetScope(ProjectResource resource) static voidinstall(Project project, ScriptManager manager) static voidinstall(List<ProjectResource> scripts, ScriptManager manager) static Consumer<ProjectResourceBuilder>serializeScript(String script, ModuleLibrary.ScriptHintScope scope) static booleanvalidateFullPath(org.python.core.PyStringMap modules, StringPath fullPath) Validates a StringPath of potential package names (ending with a module name) to ensure all elements are legal names.static booleanvalidatePackageName(org.python.core.PyStringMap modules, ResourcePath destination, String newValue) Checks whether a given name is legal to be inserted at the target location.
-
Field Details
-
MODULE_ID
- See Also:
-
RESOURCE_TYPE
-
SCOPE
public static final int SCOPE- See Also:
-
CODE_DATA_KEY
- See Also:
-
LEGACY_SHARED_MODULE
- See Also:
-
LEGACY_PROJECT_MODULE
- See Also:
-
HINT_SCOPE_KEY
- See Also:
-
DEFAULT_HINT_SCOPE
-
NAME_PATTERN
-
-
Method Details
-
install
-
install
-
deserializeScript
-
serializeScript
public static Consumer<ProjectResourceBuilder> serializeScript(String script, ModuleLibrary.ScriptHintScope scope) -
getScope
-
validatePackageName
public static boolean validatePackageName(@Nonnull org.python.core.PyStringMap modules, @Nonnull ResourcePath destination, @Nonnull String newValue) Checks whether a given name is legal to be inserted at the target location.- Parameters:
modules- The modules installed in the relevant context' ScriptManager; seeScriptManager.getModules()destination- The path where this resource will be inserted. Used to check for sibling conflicts.newValue- The actual name up for consideration.- Returns:
- Whether the given name (at the given location) is legal to be inserted.
-
validateFullPath
Validates a StringPath of potential package names (ending with a module name) to ensure all elements are legal names.- Parameters:
modules- The modules installed in the relevant context' ScriptManager;ScriptManager.getModules()fullPath- The StringPath to consider.- Returns:
- true only if the full path sequence is valid.
-