I noticed that the list populated for functions under viewDefenition is from a class (Viewrequirements) and hence a static list. This means that i wont be able to add functions on my own.
Is there any way out where i can add my own function and at the same time view the function name under function list in the UI
If you look in the config ini file (in examples this would be fullstack/fullstack-example.ini) there is a section, beginning on like 342 for a component called webBasics. You can optionally add a line to set a property on this component called valueRequirementNameClasses. This should contain a comma-separated (no spaces) list of fully qualified class names to scan for value requirement names. If you do provide this property, you will need to include com.opengamma.engine.value.ValueRequirementNames in the list to get the default set.
I am planning to create some functions dynamically.
Like i might add a different function for retrieving single day value for each timeseries available.
With this structure , i am not able to device a way to implement this.
There is a function called TimeSeriesFunction and it has a constructer which accepts a timeseries field value.
Now i need function each which takes the average of all values in a timeseries.
hence if there is 2 timeseries called close , open , volume , there would be 3 functions registered called as openTimeseries , closedTimeseries and volumeTimeseries.
To achieve this i will maintain a single class which accepts the timeseries field name from its constructor.
The issue here is that , as the the timeseries names are not known before , i cant decide on which all variables to declare as static in the value requirement class.