Forum Discussion

FICO's avatar
FICO
Community Manager
16 years ago

Display the SRL code in the 'Display Format' section

Display the SRL code in the 'Display Format' section

Hi All,

I was wondering whether its possible to show the SRL code being generated to the RMA user.

In my generic template, I can see the code in the comment section, but wasn't able to figure out how to show the SRL code in a read-only mode to the user.

Any pointers would be helpful.

Thanks,

Anindya

4 Replies

  • FICO's avatar
    FICO
    Community Manager

    I think you would have to just duplicate the SRL Content section yourself (but I could be wrong).

    You would also have to do some special handling of providers, as they show the display version of all values in the display section. One way to do that is to create a custom provider that simply displays the value you pass to it. Arguments are always the content value of the provider, so that would give you the "resolved" content in the display section.

    Regards, 

    Jostein 

  • FICO's avatar
    FICO
    Community Manager

    The hurdle is how to actually pass the SRL code into a provider, and what kind of a custom provider should I be using which would take the entire SRL based on the values selected on the fly present in the value-holders which are being used in the 'Display Content' section ?

    Duplicating the SRL content in the display section won't work.

  • FICO's avatar
    FICO
    Community Manager

    Well, I don't think you will be able to send the entire SRL. That's why I suggested duplicating the content section in the display section. Passing individual values from value holders isn't that difficult, though.

    That said, you could try to write a custom provider that loads the current file using the RMA/PROM API, locates the current file/ruleset, and then use the PROM API methods to extract the content. I haven't tried this, though, so I can't tell you it will work. Relevant references to the innovator API are: 

    • com.blazesoft.template.repository.NdPromProject
    • com.blazesoft.template.repository.NdPromItem
    • com.blazesoft.template.repository.NdPromItemContent
    • com.blazesoft.template.repository.objects.rules.NdPromSrlRuleset
    • com.blazesoft.template.repository.objects.rules.NdPromSrlRulesetItem
    • com.blazesoft.template.repository.objects.rules.NdPromSrlRule#getPromSrlRuleBody
    I'm not sure if this will give you the resolved content though. It could be that this just works for "regular" rules in a regular ruleset.

    Good luck :-) 

    Jostein 

  • FICO's avatar
    FICO
    Community Manager

    sure will try that....but wished there was any easier way to do this.

    Or is there a way to display the rule level comment section in RMA ?

    My requirement being, I need to show to the end user the actual code as its getting generated.

    Any way, to capture the contents of the comment section ??