Interface ProjectResource

    • Field Detail

      • PLATFORM_MODULE_ID

        static final java.lang.String PLATFORM_MODULE_ID
        The id used for moduleId when the resource type belongs to the Ignition platform.
        See Also:
        Constant Field Values
      • LEGACY_FOLDER_RESOURCE_TYPE

        @Deprecated
        static final java.lang.String LEGACY_FOLDER_RESOURCE_TYPE
        Deprecated.
        See Also:
        Constant Field Values
    • Method Detail

      • getProjectName

        java.lang.String getProjectName()
        Get the name of the Project this resource belongs to.
        Returns:
        the name of the Project this resource belongs to.
      • getResourceName

        default java.lang.String getResourceName()
      • getFolderPath

        default java.lang.String getFolderPath()
      • getDocumentation

        @Nullable
        java.lang.String getDocumentation()
      • getData

        @Nullable
        default byte[] getData()
      • getData

        @Nullable
        byte[] getData​(java.lang.String key)
      • getDataKeys

        @Nonnull
        com.google.common.collect.ImmutableSet<java.lang.String> getDataKeys()
        Get an immutable view of the data key set.
        Returns:
        an immutable view of the data key set.
      • getAttributes

        @Nonnull
        java.util.Map<java.lang.String,​com.inductiveautomation.ignition.common.gson.JsonElement> getAttributes()
        Get an immutable view of the attributes map.
        Returns:
        an immutable view of the attributes map.
      • getAttribute

        default java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonElement> getAttribute​(java.lang.String key)
      • getApplicationScope

        int getApplicationScope()
        Get the application scope of this resource.
        Returns:
        the application scope of this resource.
        See Also:
        ApplicationScope
      • getVersion

        int getVersion()
        Get the version of this resource.

        The version number is not intended to track mutations to the resource like the legacy edit count, but rather, its interpretation and use is for the entities this resource type belongs to and so it can be used to reason about the contents of the resource, e.g. to distinguish between serialization formats.

        Returns:
        the version of this resource.
      • isFolder

        boolean isFolder()
        Returns:
        true if this resource is a folder.
      • isModuleFolder

        default boolean isModuleFolder()
      • isResourceTypeFolder

        default boolean isResourceTypeFolder()
      • isSingletonResource

        default boolean isSingletonResource()
      • isLocked

        boolean isLocked()
        Returns:
        true if this resource is OEM locked.
      • isRestricted

        boolean isRestricted()
        Returns:
        true if this resource is restricted to users of a certain role. Formerly known as "protected".
      • isOverridable

        boolean isOverridable()
        Returns:
        true if this resource can be overridden by child projects.
      • getContentDigest

        byte[] getContentDigest()
        Get the SHA-256 digest of the content of this resource. This does not include the project name or any part of the path to this resource, but rather, it's a representation of the contents of the folder on disk.

        Any changes to any of the resource contents of that folder shall result in a change to the content digest.

        Returns:
        the SHA-256 digest of the content of this resource.
        See Also:
        getResourceSignature(), ResourceSignature
      • calculateContentDigest

        static byte[] calculateContentDigest​(ProjectResource resource)
        Calculate the SHA-256 content digest for resource.
        Parameters:
        resource - the ProjectResource.
        Returns:
        the SHA-256 content digest.
        See Also:
        getContentDigest()