+ var commands = {\r
+ highlightDocumentNode: function(wlxmlNode, origin) {\r
+ ['documentCanvas', 'nodeBreadCrumbs', 'nodeFamilyTree'].forEach(function(moduleName) {\r
+ if(!origin || moduleName != origin)\r
+ sandbox.getModule(moduleName).highlightNode(wlxmlNode)\r
+ });\r
+ },\r
+ dimDocumentNode: function(wlxmlNode, origin) {\r
+ ['documentCanvas', 'nodeBreadCrumbs', 'nodeFamilyTree'].forEach(function(moduleName) {\r
+ if(!origin || moduleName != origin)\r
+ sandbox.getModule(moduleName).dimNode(wlxmlNode)\r
+ });\r
+ },\r
+ selectNode: function(wlxmlNode, origin) {\r
+ sandbox.getModule('documentCanvas').selectNode(wlxmlNode);\r
+ sandbox.getModule('nodePane').setNode(wlxmlNode);\r
+ sandbox.getModule('nodeFamilyTree').setNode(wlxmlNode);\r
+ sandbox.getModule('nodeBreadCrumbs').setNode(wlxmlNode);\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