#1 2020-12-04 09:52:25

unsi_2
Member
Registered: 2020-06-24

send to hook and scheduling bug

i have created a hook for adding a send to option, but it adds to scheduling options also in spite of configuring it not to, as the documentation says:

supportsScheduling: { -> return false }

i use this sento option
sendTo : { compiledReport, report, format, values, execConfig ->


other problem it produce: when you try to modify a current schedule, it gives an error.

regards

Last edited by unsi_2 (2020-12-04 16:29:24)

Offline

#2 2020-12-10 08:42:29

unsi_2
Member
Registered: 2020-06-24

Re: send to hook and scheduling bug

any update on this please? can you confirm it is a bug?

thanks

Offline

#3 2020-12-10 09:24:27

eduardo
Administrator
Registered: 2016-11-01
Website

Re: send to hook and scheduling bug

Hi unsi_2,

can you please modify a minimal script that reproduces this issue ? Please delete everything unnecessary, so that the result is a minimal working example. It doesn't have to export anything, it just has to show the error you mention.

Regards,
Eduardo

Offline

#4 2020-12-10 11:04:18

unsi_2
Member
Registered: 2020-06-24

Re: send to hook and scheduling bug

it would be something like:

import net.datenwerke.rs.core.service.sendto.hooks.SendToTargetProviderHook
import net.datenwerke.rs.core.service.sendto.hooks.adapter.SendToTargetProviderHookAdapter
import net.datenwerke.rs.core.client.sendto.SendToClientConfig
import net.datenwerke.rs.utils.zip.ZipUtilsService
import net.datenwerke.security.service.authenticator.AuthenticatorService
import net.datenwerke.rs.core.service.mail.MailService

def HOOK_NAME = "TEST_ZIP_SENDTO"


mailService = GLOBALS.getInstance(MailService.class)

def callback = [
  consumes : { report ->

    def config = new SendToClientConfig();
    config.setTitle("Send zipped via email");
    config.setIcon("file-archive-o");
    config.setSelectFormat(true);
    def user = GLOBALS.getRsService(AuthenticatorService.class).getCurrentUser();
config.setForm("""   
    {
     "width": 600,
        "height": 300,
        "form" : {
                "labelAlign": "left",
                "fields": [{
                        "id": "email",
                        "type": "string",
                        "label": "Email",
                        "value":"""+"\""+ user.getEmail()+"\""+"""
                       
                       
                          }]
                 }
    }
""")
    return config;
  },
  getId : { ->
    return "whatever"
  },
  //sendTo : { report, values, execConfig ->
   sendTo : { compiledReport, report, format, values, execConfig ->
  //....

       return "Sent the zipped report via email."
  },

  supportsScheduling: { -> return false }
] as SendToTargetProviderHookAdapter

GLOBALS.services.callbackRegistry.attachHook(HOOK_NAME, SendToTargetProviderHook.class, callback)

Last edited by unsi_2 (2020-12-10 17:53:53)

Offline

#5 2020-12-11 16:08:13

unsi_2
Member
Registered: 2020-06-24

Re: send to hook and scheduling bug

the 2 problems seem to be:

- the new hook appears available in scheduling although it shouldn't  supportsScheduling: { -> return false }
- when you modify a schedule, the second window appears blank when there is a send to hook with a form

please, verify when you can

thanks in advance

Offline

#6 2020-12-11 16:50:33

eduardo
Administrator
Registered: 2016-11-01
Website

Re: send to hook and scheduling bug

Hi unsi_2,

we will look into these issues in these tickets:
RS-4545 and RS-4546

I will write here when we have more information.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB