Created
June 1, 2012 01:35
-
-
Save sigmaprojects/2847936 to your computer and use it in GitHub Desktop.
get handler and events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void function generateAllPossibleNonExistentRules() event=false { | |
var configStruct = getSettingsBean().getConfigStruct(); | |
var HandlersInvocationPath = configStruct.HandlersInvocationPath; | |
var RegisteredHandlers = configStruct.RegisteredHandlers; | |
var HandlerEvents = {}; | |
for(var i = 1; i<=ListLen(RegisteredHandlers);i++) { | |
var thisHandler = listGetAt(RegisteredHandlers,i); | |
var thisHandlerPath = HandlersInvocationPath & '.' & thisHandler; | |
var md = GetComponentMetaData( thisHandlerPath ); | |
var eventsArray = []; | |
if(ArrayLen(md.functions)) { | |
for(var y = 1; y <= ArrayLen(md.functions);y++) { | |
var func = md.functions[y]; | |
// This is important, just grab everything not marked with event=false on the function | |
if(!StructKeyExists(func,'event')) { | |
ArrayAppend(eventsArray,func.name); | |
} | |
} | |
} | |
if(ArrayLen(eventsArray)) { | |
HandlerEvents[thisHandler] = eventsArray; | |
} | |
} | |
securityRuleService.importFromOnAppInit(HandlerEvents); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment