Class ModuleLibrary
- java.lang.Object
-
- com.inductiveautomation.ignition.common.script.ModuleLibrary
-
public class ModuleLibrary extends java.lang.ObjectClass for project resource Python script libraries
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCODE_DATA_KEYstatic java.lang.StringLEGACY_PROJECT_MODULEstatic java.lang.StringLEGACY_SHARED_MODULEstatic java.lang.StringMODULE_IDstatic ResourceTypeRESOURCE_TYPEstatic intSCOPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringdeserializeScript(ProjectResource r)static voidinstall(CommonContext ctx, Project project, ScriptManager manager)static voidinstall(CommonContext ctx, java.util.List<ProjectResource> scripts, ScriptManager manager)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, java.lang.String newValue)Checks whether a given name is legal to be inserted at the target location.
-
-
-
Field Detail
-
MODULE_ID
public static final java.lang.String MODULE_ID
- See Also:
- Constant Field Values
-
RESOURCE_TYPE
public static final ResourceType RESOURCE_TYPE
-
SCOPE
public static final int SCOPE
- See Also:
- Constant Field Values
-
CODE_DATA_KEY
public static final java.lang.String CODE_DATA_KEY
- See Also:
- Constant Field Values
-
LEGACY_SHARED_MODULE
public static final java.lang.String LEGACY_SHARED_MODULE
- See Also:
- Constant Field Values
-
LEGACY_PROJECT_MODULE
public static final java.lang.String LEGACY_PROJECT_MODULE
- See Also:
- Constant Field Values
-
-
Method Detail
-
install
public static void install(CommonContext ctx, Project project, ScriptManager manager)
-
install
public static void install(CommonContext ctx, java.util.List<ProjectResource> scripts, ScriptManager manager)
-
deserializeScript
public static java.lang.String deserializeScript(ProjectResource r)
-
validatePackageName
public static boolean validatePackageName(@Nonnull org.python.core.PyStringMap modules, @Nonnull ResourcePath destination, @Nonnull java.lang.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
public static boolean validateFullPath(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.- 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.
-
-