Interface Project

    • Field Detail

      • PROJECT_NAME_PATTERN

        static final java.lang.String 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:
        Constant Field Values
      • GLOBAL_PROJECT_NAME

        static final java.lang.String GLOBAL_PROJECT_NAME
        The name given to the project created to hold "global" resources on upgrade to 8.0.
        See Also:
        Constant Field Values
      • PIPELINE_PROJECT_NAME

        static final java.lang.String PIPELINE_PROJECT_NAME
        The name given to the project created to hold Alarm Pipelines on upgrade to 8.0.
        See Also:
        Constant Field Values
      • SFC_PROJECT_NAME

        static final java.lang.String SFC_PROJECT_NAME
        The name given to the project created to hold run-always SFCs on upgrade to 8.0.
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        java.lang.String getName()
        Returns:
        the name of this Project.
      • getTitle

        default java.lang.String getTitle()
        Returns:
        the title of this Project, or the name of the project if the title is not set.
      • getDescription

        default java.lang.String getDescription()
        Returns:
        the description of this Project.
      • getParent

        default java.util.Optional<java.lang.String> getParent()
        Returns:
        the name of the parent Project, if one exists.
      • isEnabled

        default boolean isEnabled()
        Returns:
        true if this Project is enabled.
      • isInheritable

        default boolean isInheritable()
        Returns:
        true if this Project is inheritable.
      • isRunnable

        default boolean isRunnable()
        Returns:
        true if this Project is "runnable", i.e. it's enabled and not inheritable (abstract).
      • getResource

        default java.util.Optional<ProjectResource> getResource​(ProjectResourceId id)
        Finds the resource at the given id.
        Parameters:
        id - Not null
        Returns:
        The matching project resource or empty if not found.
      • getResource

        java.util.Optional<ProjectResource> getResource​(ResourcePath id)
        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

        default java.util.Optional<ProjectResource> getSingletonResource​(ResourceType type)
        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

        java.util.List<ProjectResource> getResources()
        Get the effective ProjectResources 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 ResourceFilter used 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.
      • hasResourcesOfType

        boolean hasResourcesOfType​(ResourceType type)
        Short-circuiting evaluation of whether project has any resources of given type.
        Parameters:
        type - the resource type.
        Returns:
        true if the project contains at least one resource of the given type.

        See also: ProjectLifecycleFactory#getProjectFilter()

        See Also:
        getResourcesOfType(ResourceType)
      • getAllResources

        java.util.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 ResourceFilter used to load it.

        Returns:
        all the resources belonging to this project instance, including resources from parent projects.
      • getProjectInheritanceStructure

        java.util.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

        java.util.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

        java.util.Optional<java.util.List<ProjectResource>> browse​(@Nonnull
                                                                   ResourcePath path)
        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