Jahia in English > Attach a custom...

0 (0 Good)
0 (0 Bad)

Attach a custom event handler

by  faras »  2015/12/16 08:39

Hi,

Is there a way to attach a custom event handler when sources have been modified?
I plan to launch frontend tasks (e.g. Gulp or Grunt) when javascript or less files have been modified while I'm working in dev mode, but I don't know how?  

I already looked at external-provider and jaxrs-osgi-extender, but I found nothing helpful.

Please, could you give me a way to start? frown

Thanks in advance,
Best regards

  • Attach a custom event handler
    2015/12/16 08:39

    faras <p>Hi,</p> <p>Is there a way to attach a custom event handler when sources have been modified?<br /> I plan to launch frontend tasks (e.g. Gulp or Grunt) when javascript or less files have been modified while I&#39;m working in dev mode, but I don&#39;t know how?&nbsp;&nbsp;</p> <p>I already looked at&nbsp;<a href="https://github.com/Jahia/external-provider" itemprop="name codeRepository">external-provider</a>&nbsp;and&nbsp;<a href="https://github.com/Jahia/jaxrs-osgi-extender" itemprop="name codeRepository">jaxrs-osgi-extender</a>, but I found nothing helpful.</p> <p>Please, could you give me a way to start?&nbsp;<img alt="frown" src="https://www.jahia.com/modules/ckeditor/javascript/plugins/smiley/images/confused_smile.png" title="frown" /></p> <p>Thanks in advance,<br /> Best regards</p>

  • Number of messages  1
    Registration date Dec 16, 2015
    0 (0 Good)
    0 (0 Bad)

    Re: Attach a custom event handler

    by  kevan »  2016/02/15 09:23

    Hi,

    It's currently not possible to listen on external nodes modification using the external provider. The nodes related to the module sources are provide by the external data provider "module provider" that's why it's not possible to attach listener on the sources nodes.

    But if the need is to watch on less files in order to recompile then automatically, I find some resources on internet that talk about that:

    http://blog.netgloo.com/2015/06/30/compiling-automatically-less-with-grunt/

     

    Best regards,

    Kevan.

    Number of messages  4
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: Attach a custom event handler

    by  faras »  2016/02/15 09:58

    Thank you Kevan,

    It's currently not possible to listen on external nodes modification using the external provider. The nodes related to the module sources are provide by the external data provider "module provider" that's why it's not possible to attach listener on the sources nodes.

    I don't want to watch less/sass by starting Grunt/Gulp watchers. 

    Think about that workflow:

    1. You start Digital Factory in dev mode
    2. You edit files in studio (or in your favorite IDE)
    3. Files have been modified then data-provider Jahia module launch npm scripts or gulp or grunt or ...
    4. Generated files are saved in /target/classes/css or /target/classes/javascript in order to not be commited

    That is what I'm imagined and my first idea was to deploy like it's done by OSGi implement with your external data provider module. 

    faras
    Number of messages  1
    Not registered
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page