+ var commands = {\r
+ highlightDocumentNode: function(canvasNode, origin) {\r
+ ['documentCanvas', 'nodeBreadCrumbs', 'nodeFamilyTree'].forEach(function(moduleName) {\r
+ if(!origin || moduleName != origin)\r
+ sandbox.getModule(moduleName).highlightNode(canvasNode)\r
+ });\r
+ },\r
+ dimDocumentNode: function(canvasNode, origin) {\r
+ ['documentCanvas', 'nodeBreadCrumbs', 'nodeFamilyTree'].forEach(function(moduleName) {\r
+ if(!origin || moduleName != origin)\r
+ sandbox.getModule(moduleName).dimNode(canvasNode)\r
+ });\r
+ },\r
+ selectNode: function(canvasNode, origin) {\r
+ sandbox.getModule('documentCanvas').selectNode(canvasNode);\r
+ sandbox.getModule('nodePane').setNode(canvasNode);\r
+ sandbox.getModule('nodeFamilyTree').setNode(canvasNode);\r
+ sandbox.getModule('nodeBreadCrumbs').setNode(canvasNode);\r
+ \r
+ },\r
+ resetDocument: function(document, reason) {\r
+ var modules = [];\r
+ if(reason === 'source_edit')\r
+ modules = ['documentCanvas', 'metadataEditor'];\r
+ else if (reason === 'edit')\r
+ modules = ['sourceEditor'];\r
+ else if (reason === 'revert')\r
+ modules = ['documentCanvas', 'metadataEditor', 'sourceEditor'];\r
+ \r
+ modules.forEach(function(moduleName) {\r
+ sandbox.getModule(moduleName).setDocument(document);\r
+ });\r
+ }\r