+qx.Class.define("org.argeo.security.ria.components.NaturesManager",{\r
+ extend : qx.core.Object,\r
+ properties : {\r
+ detectedNatures : {\r
+ check : "Map"\r
+ }\r
+ },\r
+ construct : function(){\r
+ this.base(arguments);\r
+ this.detectNatures();\r
+ },\r
+ members : {\r
+ detectNatures : function(){ \r
+ var natures = {};\r
+ for (var key in qx.Bootstrap.$$registry) {\r
+ if (qx.Class.hasInterface(qx.Bootstrap.$$registry[key], org.argeo.security.ria.components.INaturePane)) {\r
+ // FILTER BY ROLE HERE!\r
+ var klass = qx.Bootstrap.$$registry[key];\r
+ natures[klass.NATURE_TYPE] = klass;\r
+ }\r
+ }\r
+ this.setDetectedNatures(natures);\r
+ },\r
+ detectNaturesInData : function(userNaturesList){\r
+ var detected = this.getDetectedNatures();\r
+ var userDetected = [];\r
+ for(var i = 0;i<userNaturesList.length;i++){\r
+ var type = userNaturesList[i].type;\r
+ if(detected[type]){\r
+ userDetected.push({\r
+ NATURE_CLASS : detected[type],\r
+ NATURE_DATA : userNaturesList[i]\r
+ });\r
+ }\r
+ }\r
+ return userDetected;\r
+ }\r
+ }\r
+});
\ No newline at end of file