Interface Project
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
DesignableProject
- All Known Implementing Classes:
AbstractProject,DesignerProjectTreeImpl,RuntimeProject
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name given to the project created to hold "global" resources on upgrade to 8.0.static final StringThe name given to the project created to hold Alarm Pipelines on upgrade to 8.0.static final StringA regex representing a valid project name.static final StringThe name given to the project created to hold run-always SFCs on upgrade to 8.0. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for specific types of project resource changes.browse(ResourcePath path) Get a List of all resources in this project and all parent projects.default StringGet theProjectManifestfor this Project.getName()Gets the snapshots from the effective project, in order of project inheritance (leaf project last)default Optional<ProjectResource>Finds the resource at the given id.Finds the resource at the given path, using an effective view of the resources in this project chain.Get the effectiveProjectResources for this project.default Optional<ProjectResource>Convenience method to find a "singleton" project resource, which is a project resource that has no name or path, of which there can only exist zero or one in any given project.default StringgetTitle()booleanShort-circuiting evaluation of whether project has any resources of given type.default booleandefault booleandefault booleanvoidRemoves an existing listener.
-
Field Details
-
PROJECT_NAME_PATTERN
A regex representing a valid project name.Note: this pattern is only used to validate project names created via UI. It does not mean projects will always have a name that matches this pattern. A project can technically have any name that is valid on the filesystem, including spaces, special characters, unicode, etc...
- See Also:
-
GLOBAL_PROJECT_NAME
The name given to the project created to hold "global" resources on upgrade to 8.0.- See Also:
-
PIPELINE_PROJECT_NAME
The name given to the project created to hold Alarm Pipelines on upgrade to 8.0.- See Also:
-
SFC_PROJECT_NAME
The name given to the project created to hold run-always SFCs on upgrade to 8.0.- See Also:
-
-
Method Details
-
getName
String getName()- Returns:
- the name of this Project.
-
getManifest
ProjectManifest getManifest()Get theProjectManifestfor this Project.- Returns:
- the
ProjectManifestfor this Project.
-
getTitle
- Returns:
- the title of this Project, or the name of the project if the title is not set.
-
getDescription
- Returns:
- the description of this Project.
-
getParent
- Returns:
- the name of the parent Project, if one exists.
-
isEnabled
default boolean isEnabled()- Returns:
trueif this Project is enabled.
-
isInheritable
default boolean isInheritable()- Returns:
trueif this Project is inheritable.
-
isRunnable
default boolean isRunnable()- Returns:
trueif this Project is "runnable", i.e. it's enabled and not inheritable (abstract).
-
getResource
Finds the resource at the given id.- Parameters:
id- Not null- Returns:
- The matching project resource or empty if not found.
-
getResource
Finds the resource at the given path, using an effective view of the resources in this project chain.- Parameters:
id- Not null- Returns:
- The matching project resource or empty if not found.
-
getSingletonResource
Convenience method to find a "singleton" project resource, which is a project resource that has no name or path, of which there can only exist zero or one in any given project. Shortcut for getResource(new ProjectResourceId(type, null, getName())) -
getResources
List<ProjectResource> getResources()Get the effectiveProjectResources for this project.This includes inherited resources from parent projects, recursively, except where resources in child projects override resources by the same name from parent projects. In other words, for any given
ResourcePath, only the resource "closest" to this project in the inheritance chain will be included in this list.Note that depending on the
ResourceFilterused to load this project instance, this may not include all resource types that are actually part of this project.- Returns:
- the effective
ProjectResources for this project.
-
getResourcesOfType
Get all non-folderProjectResources of typetypebelonging to the module identified bymoduleId.Resource types belonging to the Ignition platform are identified by module id "ignition".
- Parameters:
type- the resource type.- Returns:
- all non-folder
ProjectResources of typetypebelonging to the module identified bymoduleId. - See Also:
-
hasResourcesOfType
Short-circuiting evaluation of whether project has any resources of given type.- Parameters:
type- the resource type.- Returns:
trueif the project contains at least one resource of the given type.See also:
ProjectLifecycleFactory#getProjectFilter()- See Also:
-
getAllResources
Map<ProjectResourceId,ProjectResource> getAllResources()Get a List of all resources in this project and all parent projects.This includes resources belonging to parent projects in the inheritance chain if this is a "stack" of projects. This means that there may be multiple resources for any given
ResourcePath.This project instance may not contain all resources that exist for the project on disk, depending on the
ResourceFilterused to load it.- Returns:
- all the resources belonging to this project instance, including resources from parent projects.
-
getProjectInheritanceStructure
List<NamedManifest> getProjectInheritanceStructure()- Returns:
- A list of all of the projects and their manifests that comprise the inheritance chain of this project. This list is ordered in ascending inheritance order, from leaf project first to super-most project last.
-
getProjectSnapshots
List<ProjectSnapshot> getProjectSnapshots()Gets the snapshots from the effective project, in order of project inheritance (leaf project last)- Returns:
- A list of ProjectSnapshots, one per project represented in the effective project.
-
browse
- Parameters:
path- the resourcePath of the folder to browse- Returns:
- an empty optional if the given path was not found or is not browseable, otherwise its direct children
-
addProjectResourceListener
Adds a listener for specific types of project resource changes.- Parameters:
listener- theProjectResourceListenerto add.
-
removeProjectResourceListener
Removes an existing listener. If not added, no-op.- Parameters:
listener- theProjectResourceListenerto remove.
-