Interface ProjectsRpc
public interface ProjectsRpc
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.inductiveautomation.ignition.common.gson.Gson
static final String
static final String
static final ProtoRpcSerializer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMonitor
(String projectName, int scope) Add the session monitor that watches for project changesboolean
canSaveProject
(String projectName) boolean
canViewProject
(String projectName) void
create
(String newProjectName, ResourceCollectionManifest manifest, List<Resource> resources) Creates a new project with the given name, or throws a GatewayFunctionException if a project with that name already exists.static com.inductiveautomation.ignition.common.gson.GsonBuilder
customizeGson
(com.inductiveautomation.ignition.common.gson.GsonBuilder builder) byte[]
getGlobalProps
(String projectToLoad) Retrieves theGlobalProps
data for the supplied projectGet info about all projectsRetrieves project metadata for all projectsinsertResources
(List<String> targetProjectNames, List<Resource> resources) This is the Gateway-side functionality of the Designer's "Send to" context menu for windows and templates.loadProject
(String projectToLoad) Note - loads synchronouslyRetrieves the latest changes from the current session's projectvoid
push
(List<ChangeOperation> diffs) Pushes changes to the current session's projectsaveAs
(String newProjectName, ResourceCollectionManifest manifest, List<Resource> resources) Save the current session project under a new name and switch to the new projectvoid
setProject
(String projectName, boolean audit) This should only be used by the designer when first loading a project, or when switching from one project to another (i.e.
-
Field Details
-
GSON
static final com.inductiveautomation.ignition.common.gson.Gson GSON -
SERIALIZER
-
PROJECT_CHANGED_MESSAGE_TYPE
- See Also:
-
PROJECT_DELETED_MESSAGE_TYPE
- See Also:
-
-
Method Details
-
getValidProjectManifests
Map<String,ResourceCollectionManifest> getValidProjectManifests()Retrieves project metadata for all projects- Returns:
- the map of project names to
manifest metadata
-
getProjectInfos
List<ProjectsRpc.ProjectInfo> getProjectInfos()Get info about all projects -
saveAs
String saveAs(String newProjectName, ResourceCollectionManifest manifest, List<Resource> resources) throws GatewayAuthException, ResourceCollectionNotFoundException, IOException Save the current session project under a new name and switch to the new project- Parameters:
newProjectName
- the name of the new projectmanifest
- themanifest metadata
for the new projectresources
- the set of resources to save to the new project- Returns:
- the name of the newly recreated resource collection (project)
- Throws:
GatewayAuthException
- if the user lacks sufficient authorization to create the new projectResourceCollectionNotFoundException
- if the current project can not be foundIOException
- if there is an error saving the new project
-
pull
Retrieves the latest changes from the current session's project- Parameters:
snapshots
- the list ofSnapshot
to compare against- Returns:
- the list of
ResourceCollectionDiff
representing new changes - Throws:
PullException
- if there is an error pulling the changes
-
push
void push(List<ChangeOperation> diffs) throws PushException, ResourceCollectionNotFoundException, GatewayAuthException Pushes changes to the current session's project- Parameters:
diffs
- the collection ofChangeOperation
to apply- Throws:
PushException
- if there is an error applying the changesResourceCollectionNotFoundException
- if the project can not be foundGatewayAuthException
- if the user lacks sufficient authorization to edit the target resources
-
create
void create(String newProjectName, ResourceCollectionManifest manifest, List<Resource> resources) throws ResourceCollectionInvalidException, ResourceCollectionNotFoundException, NameInUseException, IOException, GatewayAuthException Creates a new project with the given name, or throws a GatewayFunctionException if a project with that name already exists.- Parameters:
newProjectName
- the name of the new projectmanifest
- the manifest for the new projectresources
- the resources to add to the new project- Throws:
ResourceCollectionInvalidException
- if the manifest is invalidResourceCollectionNotFoundException
- if the manifest references a missing resourceNameInUseException
- if a resource name is already in useIOException
- if there is an error saving the projectGatewayAuthException
- if the user does not have the required roles to create a project
-
setProject
This should only be used by the designer when first loading a project, or when switching from one project to another (i.e. File > Open Project).- Parameters:
projectName
- the name of the project to bind the session toaudit
- whether to audit the project switch
-
loadProject
RuntimeResourceCollection loadProject(String projectToLoad) throws ResourceCollectionNotFoundException, ResourceCollectionInvalidException Note - loads synchronously- Parameters:
projectToLoad
- the name of the project to load- Returns:
- the RuntimeResourceCollection for the project
- Throws:
ResourceCollectionNotFoundException
- if the project does not existResourceCollectionInvalidException
- if the project is invalid
-
insertResources
ResourceInsertionResponse insertResources(List<String> targetProjectNames, List<Resource> resources) This is the Gateway-side functionality of the Designer's "Send to" context menu for windows and templates. It merges the resources into the target projects, creating folders if necessary. It also checks if the resources to be sent are protected and if the user doing the sending has the required Protected Resource roles. It also checks if the user has the required save roles.- Parameters:
targetProjectNames
- the list of project names to send the resources toresources
- the resources to send- Returns:
- a ResourceInsertionResponse object that contains the results of the insertion
-
addMonitor
Add the session monitor that watches for project changes- Parameters:
projectName
- the name of the project to monitorscope
- theApplicationScope
of the monitor
-
getGlobalProps
Retrieves theGlobalProps
data for the supplied project- Parameters:
projectToLoad
- the name of the project to load- Returns:
- the raw byte array
-
canViewProject
- Parameters:
projectName
- the name of the project to check- Returns:
- True if the project is viewable
-
canSaveProject
- Parameters:
projectName
- the name of the project to check- Returns:
- True if the project is savable
-
customizeGson
static com.inductiveautomation.ignition.common.gson.GsonBuilder customizeGson(com.inductiveautomation.ignition.common.gson.GsonBuilder builder)
-