Class TemplateManager
java.lang.Object
com.inductiveautomation.factorypmi.application.model.TemplateManager
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTemplateListener
(ResourcePath templateId, TemplateListener listener) void
apply
(List<? extends ChangeOperation> changes) Modifies the stored instances of the templates based on a supplied change set.static String
convertLegacyPath
(String templatePath) Detects whether the given path starts with [shared] or not.com.google.common.collect.Multimap<DataTypeEx,
String> Calculates a map of all templates that have a drop target property defined, organized by drop target typeReturns a ResourcePath using the given templatePath.getTemplateInfo
(String path) getTemplateInstance
(String templatePath) getTemplateThumbnail
(String templatePath) static void
initDeserializedTemplate
(ResourcePath path, TemplateInfo info, VisionTemplate template) boolean
isTemplateValid
(VisionTemplate template) Whether or not this template's info is mapped, possibly removed due to an updatevoid
popCache()
void
void
removeTemplateListener
(ResourcePath templateId, TemplateListener listener) void
shutdown()
Performs any necessary shutdown tasks for the TemplateManager.
-
Field Details
-
RESOURCE_TYPE
-
GLOBAL_TEMPLATE_PREFIX
- See Also:
-
-
Constructor Details
-
TemplateManager
-
-
Method Details
-
pushCache
-
popCache
public void popCache() -
addTemplateListener
-
removeTemplateListener
-
convertLegacyPath
Detects whether the given path starts with [shared] or not.- Returns:
- a modified path pointing to a parent "shared" folder
-
initDeserializedTemplate
public static void initDeserializedTemplate(ResourcePath path, TemplateInfo info, VisionTemplate template) -
getId
Returns a ResourcePath using the given templatePath. Corrects for legacy [global] paths. Will return null if the path specified doesn't exist in the project. -
apply
Modifies the stored instances of the templates based on a supplied change set. -
getTemplateInstance
public VisionTemplate getTemplateInstance(String templatePath) throws TemplateNotFoundException, SerializationException -
isTemplateValid
Whether or not this template's info is mapped, possibly removed due to an update -
getTemplateThumbnail
-
getDropTargetTemplates
Calculates a map of all templates that have a drop target property defined, organized by drop target type -
shutdown
public void shutdown()Performs any necessary shutdown tasks for the TemplateManager. -
getTemplateInfo
public TemplateInfo getTemplateInfo(String path) throws TemplateNotFoundException, SerializationException
-