[prev in list] [next in list] [prev in thread] [next in thread] 

List:       forgerock-openidm
Subject:    [OpenIDM] JS scripts don't get reloaded upon changes
From:       andi.egloff () forgerock ! com (Andreas Egloff)
Date:       2014-02-07 13:12:14
Message-ID: CALto_tyB1G95xPRmag7DTmFA=2m0U-HSxBdkPx_LUrMB672JEg () mail ! gmail ! com
[Download RAW message or body]

Ah yes, thanks for the feedback.


On Thu, Feb 6, 2014 at 4:37 PM, Ing. Roberto Pierpaoli <
roberto.pierpaoli at pringsoft.com> wrote:

> Hi Andreas,
> it works as we expected, but there's a relevant drawback: the script
> looses its context and can not refer "logger", "openidm" and all the other
> normally available native objects anymore.
>
> I have found a tip about the call
>
> load.call(<context>, "path/to/script.js");
>
> that delivers a context to the included script, but I can not use it
> directly inside "managed.json", since "load" is not resolved there, while
> it is inside separated scripts.
>
> So it seems that the only clean way is to "touch" the relative JSON file,
> as you suggested.
>
>
>
> Roberto
>
>
>
>
> 2014-02-06 Andreas Egloff <andi.egloff at forgerock.com>:
>
> I'd expect that to work
>>
>>
>> On Thu, Feb 6, 2014 at 12:27 PM, Ing. Roberto Pierpaoli <
>> roberto.pierpaoli at pringsoft.com> wrote:
>>
>>> Thank you Laurent and Andreas,
>>>
>>> so I guess that the script included through the "load()" function
>>> behaves differently since that call (load) is executed each time the main
>>> script runs, thus the included script gets refreshed while the main one
>>> needs me to touch the managed.json file, am I right?
>>>
>>> What if I do something like this in the managed.json?:
>>>
>>> ...
>>> "onUpdate" : {
>>>       "type" : "text/javascript",
>>>       "source" : "load('path/to/my/script.js');"
>>> }
>>> ...
>>>
>>> this way the script would be re-processed any time the trigger is fired,
>>> right?
>>>
>>> I know is a ugly just-for-devel trick, but it would be comfortable and I
>>> would change it before going to production.
>>>
>>> I will try it as soon as I can, unless you don't discourage me before
>>> that time :)
>>>
>>> Thanks again,
>>>
>>>
>>>
>>> Roberto
>>>
>>>
>>> 2014-02-06 Andreas Egloff <andi.egloff at forgerock.com>
>>>
>>> The latest version of the script engine that we are working on has a
>>>> reload option, but the version you're using does not dynamically reload
>>>> scripts; the suggestion of "touching" the config file that declares the
>>>> script is the best chance in that script engine version.
>>>> HTH
>>>> Andi
>>>>
>>>>
>>>> On Wed, Feb 5, 2014 at 9:10 PM, Laurent Bristiel <
>>>> laurent.bristiel at forgerock.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> yes, scripts are indeed not reloaded live.
>>>>> What you could try is to "touch" the configuration file that use the
>>>>> script (managed.json for you)
>>>>> As configuration file changes are handled live, your script should be
>>>>> also reloaded when managed.json is.
>>>>>
>>>>> Hope this helps,
>>>>> Laurent
>>>>>
>>>>> On 05 Feb 2014, at 19:45, Ing. Roberto Pierpaoli <
>>>>> roberto.pierpaoli at pringsoft.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I am configuring a CSV connector and currently I am writing down my
>>>>> "managed.json".
>>>>> I have declared a script attached to the "onCreate" trigger.
>>>>>
>>>>> The script executes normally, but when I change something on it I
>>>>> always need to restart OpenIDM to see the modifications working.
>>>>>
>>>>> Removing the "felix-cache" folder did not have any effect.
>>>>>
>>>>> I have tried to call a "refresh" on the Rhino bundle through the Felix
>>>>> console, but so I was not able to make any call to OpenIDM anymore: error
>>>>> 404 was systematical, I needed to restart OpenIDM again.
>>>>> "stop" and "start" on the bundle (did not brake OpenIDM, but) had no
>>>>> effect.
>>>>>
>>>>> The strange thing is that my script includes another script through
>>>>> the "load()" function: if I change the included script, then I can
>>>>> appreciate the modifications immediately, without restarting...
>>>>>
>>>>> Probably I am missing something: could anyone give me a suggestion,
>>>>> please?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>>
>>>>>
>>>>> Roberto
>>>>>  _______________________________________________
>>>>> OpenIDM mailing list
>>>>> OpenIDM at forgerock.org
>>>>> https://lists.forgerock.org/mailman/listinfo/openidm
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> OpenIDM mailing list
>>>>> OpenIDM at forgerock.org
>>>>> https://lists.forgerock.org/mailman/listinfo/openidm
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> OpenIDM mailing list
>>>> OpenIDM at forgerock.org
>>>> https://lists.forgerock.org/mailman/listinfo/openidm
>>>>
>>>>
>>>
>>>
>>> --
>>>  ?  Via Antonio di Vincenzo 41, 40129 - Bologna
>>>  ?  cell. +39.347.4538377
>>>  ?  PIVA 02282080411
>>>
>>>
>>>
>>> _______________________________________________
>>> OpenIDM mailing list
>>> OpenIDM at forgerock.org
>>> https://lists.forgerock.org/mailman/listinfo/openidm
>>>
>>>
>>
>> _______________________________________________
>> OpenIDM mailing list
>> OpenIDM at forgerock.org
>> https://lists.forgerock.org/mailman/listinfo/openidm
>>
>>
>
>
> --
>  ?  Via Antonio di Vincenzo 41, 40129 - Bologna
>  ?  cell. +39.347.4538377
>  ?  PIVA 02282080411
>
>
>
> _______________________________________________
> OpenIDM mailing list
> OpenIDM at forgerock.org
> https://lists.forgerock.org/mailman/listinfo/openidm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.forgerock.org/pipermail/openidm/attachments/20140207/c75fdfa3/attachment.html>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic