Sets metadata for the diagram currently loaded in the editor.
.setDiagramMetadata(/* String */ name, /* Object */ value)
The name of a diagram metadata object that is to be set for the current diagram.
The following string names have meaning internal to the editor and should therefore not be used.
The value to be set for the metadata item. This can be any type of javascript object.
If you wish to remove a metadata item call set using the name you wish to remove with a
value of undefined
or null
. See the example below.
This method can only be used after the startup method has been called.
Also, keep in mind this only sets the metadata for the current diagram. If you load a new diagram into the editor you will have to set it's metadata as well.
editor = new ESDWeb(null, 'editorNode'); editor.startup(...); // Using a string as the value editor.setDiagramMetadata("item1", "item1Val"); // Using an array as the value editor.setDiagramMetadata("item2", ["one", "two", "three"]); // Remove "item1" from the metadata editor.setDiagramMetadata("item1", undefined);