Interface DesignableProject
- 
- All Superinterfaces:
- Project,- java.io.Serializable
 - All Known Implementing Classes:
- DesignerProjectTreeImpl
 
 public interface DesignableProject extends Project Extension ofProjectwith additional functionality to support the Designer's need to model the project as a tree of resources which can be mutated and staged for push and pull operations.
- 
- 
Field Summary- 
Fields inherited from interface com.inductiveautomation.ignition.common.project.ProjectGLOBAL_PROJECT_NAME, PIPELINE_PROJECT_NAME, PROJECT_NAME_PATTERN, SFC_PROJECT_NAME
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcreateOrModify(ProjectResource resource)Create the given resource if one doesn't already exist, otherwise, modify it.default voidcreateOrModify(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer)Create the given resource if one doesn't already exist, otherwise, modify it.voidcreateResource(ProjectResource resource)Create a new resource.default ProjectResourcecreateResourceSafe(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer)Create a new resource and add it at the given path.default ProjectResourcecreateResourceSafe(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer, java.lang.String nameFormat)Create a new resource and add it at the given path.default voiddeleteResource(ProjectResourceId id)Delete the resource with the given id.voiddeleteResource(ResourcePath path)Delete the resource at a given path.booleandiscardChanges(ResourcePath path)Discards any local changes for a path.java.util.List<ChangeOperation>getChanges()java.util.Collection<ChangeOperation>getConflicts(java.util.Collection<ChangeOperation> changes)java.lang.StringgetDefiningProject(ResourcePath path)Return the project name where the given ResourcePath is actually defined.default java.util.Optional<ProjectResource>getLocalResource(ProjectResourceId id)Get a resource, but only if it is a locally defined resource.default java.util.Optional<ProjectResource>getLocalResource(ResourcePath path)Get a resource, but only if it is a locally defined resource.booleanisChanged(ResourcePath path)booleanisConflict(ResourcePath path)booleanisInherited(ResourcePath path)booleanisLocal(ResourcePath path)booleanisOverridable(ResourcePath path)booleanisOverridden(ResourcePath path)voidmodifyResource(ProjectResource resource)Modify an existing resource.default voidmodifyResource(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer)Modify an existing resource, if it exists.default booleanmodifyResourceIfLocal(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer)Modify an existing resource, if it exists.default voidrenameResource(ProjectResourceId id, java.lang.String newName)Rename a resource at the given path.voidrenameResource(ResourcePath path, java.lang.String newName)Rename a resource at the given path.- 
Methods inherited from interface com.inductiveautomation.ignition.common.project.ProjectaddProjectResourceListener, browse, getAllResources, getDescription, getManifest, getName, getParent, getProjectInheritanceStructure, getProjectSnapshots, getResource, getResource, getResources, getResourcesOfType, getSingletonResource, getTitle, hasResourcesOfType, isEnabled, isInheritable, isRunnable, removeProjectResourceListener
 
- 
 
- 
- 
- 
Method Detail- 
getLocalResourcedefault java.util.Optional<ProjectResource> getLocalResource(ProjectResourceId id) Get a resource, but only if it is a locally defined resource.
 - 
getLocalResourcedefault java.util.Optional<ProjectResource> getLocalResource(ResourcePath path) Get a resource, but only if it is a locally defined resource.
 - 
createResourcevoid createResource(ProjectResource resource) throws ResourceNamingException Create a new resource.Will also create any folders needed along the new resource's path. - Throws:
- NameInUseException- if the resource's name is is already in use by a local sibling.
- ResourceNamingException
 
 - 
createResourceSafedefault ProjectResource createResourceSafe(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer) Create a new resource and add it at the given path. If there is already a resource at the given path, then the new resource will be given a new name like "OriginalName (1)"- Parameters:
- path- The desired path for the new resource. Any needed folders along the path will be created.
- builderConsumer- Callback for setting the details of the new resource. The correct project name and resource path will already be set automatically.
- Returns:
- The resource that was created
 
 - 
createResourceSafedefault ProjectResource createResourceSafe(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer, java.lang.String nameFormat) Create a new resource and add it at the given path. If there is already a resource at the given path, then the new resource will be given a new name.- Parameters:
- path- The desired path for the new resource
- builderConsumer- Callback for setting the details of the new resource. The correct project name and resource path will already be set automatically.
- nameFormat- String format for appending a number to the end of the existing name, like " (%s)"
- Returns:
- The resource that was created
 
 - 
modifyResourcevoid modifyResource(ProjectResource resource) throws ResourceNotFoundException Modify an existing resource. Must already exist as a local resource, otherwise this will throw anResourceNotFoundException- Throws:
- ResourceNotFoundException
 
 - 
modifyResourcedefault void modifyResource(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer) throws ResourceNotFoundException Modify an existing resource, if it exists. If not, will throw anResourceNotFoundException- Throws:
- ResourceNotFoundException
 
 - 
modifyResourceIfLocaldefault boolean modifyResourceIfLocal(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer) throws ResourceNotFoundException Modify an existing resource, if it exists. If not, do nothing.- Returns:
- True if a local resource was found and modified.
- Throws:
- ResourceNotFoundException
 
 - 
createOrModifydefault void createOrModify(ProjectResource resource) Create the given resource if one doesn't already exist, otherwise, modify it.
 - 
createOrModifydefault void createOrModify(ResourcePath path, java.util.function.Consumer<ProjectResourceBuilder> builderConsumer) Create the given resource if one doesn't already exist, otherwise, modify it.
 - 
deleteResourcedefault void deleteResource(ProjectResourceId id) throws ResourceNotFoundException Delete the resource with the given id.- Throws:
- ResourceNotFoundException
 
 - 
deleteResourcevoid deleteResource(ResourcePath path) throws ResourceNotFoundException Delete the resource at a given path.- Throws:
- ResourceNotFoundException
 
 - 
renameResourcedefault void renameResource(ProjectResourceId id, java.lang.String newName) throws ResourceNamingException Rename a resource at the given path.- Throws:
- ResourceNamingException
 
 - 
renameResourcevoid renameResource(ResourcePath path, java.lang.String newName) throws ResourceNamingException Rename a resource at the given path.- Throws:
- ResourceNamingException
 
 - 
discardChangesboolean discardChanges(ResourcePath path) Discards any local changes for a path.- Returns:
- true if there were changes to discard, false if there were no changes in the first place.
 
 - 
isLocalboolean isLocal(ResourcePath path) - Returns:
- True if there is a project resource at the given path that defined in the local project.
 
 - 
isChangedboolean isChanged(ResourcePath path) - Returns:
- True if there is a resource at the given path that has been locally altered.
 
 - 
isInheritedboolean isInherited(ResourcePath path) - Returns:
- True if there is a resource at the given path that is inherited from a parent project
 
 - 
isOverridableboolean isOverridable(ResourcePath path) - Returns:
- False if there is an inherited resource that does not allow overrides. True otherwise.
 
 - 
isOverriddenboolean isOverridden(ResourcePath path) - Returns:
- True if there is a resource at the given path defined in this project that is overriding a resource from a parent project at the same path.
 
 - 
isConflictboolean isConflict(ResourcePath path) - Returns:
- True if there is a resource with a conflicting (but differently cased) name at the given path - see
 NameCollisionException
 
 - 
getDefiningProjectjava.lang.String getDefiningProject(ResourcePath path) Return the project name where the given ResourcePath is actually defined.
 - 
getChangesjava.util.List<ChangeOperation> getChanges() - Returns:
- The change operations that have occurred on this project since loaded or since the last applyChanges
 
 - 
getConflictsjava.util.Collection<ChangeOperation> getConflicts(java.util.Collection<ChangeOperation> changes) - Parameters:
- changes- Diff operations applicable to the local project
- Returns:
- a collection of the change operations from diff that conflict with local changes
 
 
- 
 
-