You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by "Nesbert Hidalgo (JIRA)" <ji...@apache.org> on 2012/07/27 19:05:33 UTC

[jira] [Created] (OODT-478) Balance: New hook for hooks.php

Nesbert Hidalgo created OODT-478:
------------------------------------

             Summary: Balance: New hook for hooks.php
                 Key: OODT-478
                 URL: https://issues.apache.org/jira/browse/OODT-478
             Project: OODT
          Issue Type: New Feature
          Components: balance
            Reporter: Nesbert Hidalgo
            Priority: Minor


I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.

<?php
// Additional callback for hooks.php

/**
 * hook_before_all
 *
 * This is the first hook called for both views and scripts (*.do).
 */
function hook_before_all() {}

?>

Please see attached patch...

Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (OODT-478) Balance: New hook for hooks.php

Posted by "Andrew Hart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Hart resolved OODT-478.
------------------------------

    Resolution: Fixed

resolved in r1367341, patch applied to trunk. Thanks Nesbert!
                
> Balance: New hook for hooks.php
> -------------------------------
>
>                 Key: OODT-478
>                 URL: https://issues.apache.org/jira/browse/OODT-478
>             Project: OODT
>          Issue Type: New Feature
>          Components: balance
>    Affects Versions: 0.4
>            Reporter: Nesbert Hidalgo
>            Assignee: Andrew Hart
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: BalanceHookBeforeAll.patch.diff, BalanceHookBeforeAll20120730.patch.diff
>
>
> I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.
> <?php
> // Additional callback for hooks.php
> /**
>  * hook_before_all
>  *
>  * This is the first hook called for both views and scripts (*.do).
>  */
> function hook_before_all() {}
> ?>
> Please see attached patch...
> Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OODT-478) Balance: New hook for hooks.php

Posted by "Andrew Hart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425065#comment-13425065 ] 

Andrew Hart commented on OODT-478:
----------------------------------

Hey Nesbert, first off: thanks very much for this issue & patch!

I looked at the patch, and I like what you're proposing. The only implication, if I understand the patch correctly, is that some hooks (e.g.: hook_before_all) will run for both scripts and views, while others (hook_before_header, hook_before_view, hook_before_footer) will run only for views. 

Interestingly, this *should* already have been the case. Concretely, there's nothing in the existing 'hook_before_send' and 'hook_after_send' hooks (invoked in the ApplicationResponse's "send" function) that is specific to view requests, and yet these hooks will never get run for script requests as the current initialization code only includes the hooks file for view requests. I've never had to implement either of these hooks so it has personally not come up, but I can imagine it would certainly cause some confusion. 

So, +1(!) for this change, both because I like the idea of a pre-processor hook, and because it incidentally resolves a latent issue with hook processing for script requests. 

One minor request, though, to make this complete: check out the sample hooks.php file in trunk/balance/etc/skel/hooks.php. It lists the currently defined hooks along with a little context about what they each do. Would you consider adding a similar doc block for your hook to this file? That way people will better know it exists and how to use it. Feel free to attach an updated patch to this issue with the change + documentation.

Thanks a lot!
                
> Balance: New hook for hooks.php
> -------------------------------
>
>                 Key: OODT-478
>                 URL: https://issues.apache.org/jira/browse/OODT-478
>             Project: OODT
>          Issue Type: New Feature
>          Components: balance
>            Reporter: Nesbert Hidalgo
>            Priority: Minor
>         Attachments: BalanceHookBeforeAll.patch.diff
>
>
> I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.
> <?php
> // Additional callback for hooks.php
> /**
>  * hook_before_all
>  *
>  * This is the first hook called for both views and scripts (*.do).
>  */
> function hook_before_all() {}
> ?>
> Please see attached patch...
> Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OODT-478) Balance: New hook for hooks.php

Posted by "Nesbert Hidalgo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nesbert Hidalgo updated OODT-478:
---------------------------------

    Attachment: BalanceHookBeforeAll20120730.patch.diff

Updated patch with new hook_before_all plus documentation.

I agree that the existing 'hook_before_send' and 'hook_after_send' hooks could also be used for both types of requests. But like you said would require updating the ApplicationResponse's "send" method as it currently only checks & executes these hooks for view requests.

I too have not used either of these hooks :)
                
> Balance: New hook for hooks.php
> -------------------------------
>
>                 Key: OODT-478
>                 URL: https://issues.apache.org/jira/browse/OODT-478
>             Project: OODT
>          Issue Type: New Feature
>          Components: balance
>    Affects Versions: 0.4
>            Reporter: Nesbert Hidalgo
>            Assignee: Andrew Hart
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: BalanceHookBeforeAll.patch.diff, BalanceHookBeforeAll20120730.patch.diff
>
>
> I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.
> <?php
> // Additional callback for hooks.php
> /**
>  * hook_before_all
>  *
>  * This is the first hook called for both views and scripts (*.do).
>  */
> function hook_before_all() {}
> ?>
> Please see attached patch...
> Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OODT-478) Balance: New hook for hooks.php

Posted by "Nesbert Hidalgo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nesbert Hidalgo updated OODT-478:
---------------------------------

    Attachment: BalanceHookBeforeAll.patch.diff

Org_Apache_Oodt_Balance_Core_ApplicationResponse update
                
> Balance: New hook for hooks.php
> -------------------------------
>
>                 Key: OODT-478
>                 URL: https://issues.apache.org/jira/browse/OODT-478
>             Project: OODT
>          Issue Type: New Feature
>          Components: balance
>            Reporter: Nesbert Hidalgo
>            Priority: Minor
>         Attachments: BalanceHookBeforeAll.patch.diff
>
>
> I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.
> <?php
> // Additional callback for hooks.php
> /**
>  * hook_before_all
>  *
>  * This is the first hook called for both views and scripts (*.do).
>  */
> function hook_before_all() {}
> ?>
> Please see attached patch...
> Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OODT-478) Balance: New hook for hooks.php

Posted by "Andrew Hart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Hart updated OODT-478:
-----------------------------

    Affects Version/s: 0.4
        Fix Version/s: 0.5
    
> Balance: New hook for hooks.php
> -------------------------------
>
>                 Key: OODT-478
>                 URL: https://issues.apache.org/jira/browse/OODT-478
>             Project: OODT
>          Issue Type: New Feature
>          Components: balance
>    Affects Versions: 0.4
>            Reporter: Nesbert Hidalgo
>            Assignee: Andrew Hart
>            Priority: Minor
>             Fix For: 0.5
>
>         Attachments: BalanceHookBeforeAll.patch.diff
>
>
> I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.
> <?php
> // Additional callback for hooks.php
> /**
>  * hook_before_all
>  *
>  * This is the first hook called for both views and scripts (*.do).
>  */
> function hook_before_all() {}
> ?>
> Please see attached patch...
> Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (OODT-478) Balance: New hook for hooks.php

Posted by "Andrew Hart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Hart reassigned OODT-478:
--------------------------------

    Assignee: Andrew Hart
    
> Balance: New hook for hooks.php
> -------------------------------
>
>                 Key: OODT-478
>                 URL: https://issues.apache.org/jira/browse/OODT-478
>             Project: OODT
>          Issue Type: New Feature
>          Components: balance
>            Reporter: Nesbert Hidalgo
>            Assignee: Andrew Hart
>            Priority: Minor
>         Attachments: BalanceHookBeforeAll.patch.diff
>
>
> I would like to recommend adding an additional hook "hook_before_all" to Balance. Currently, the hooks (hook_before_header, hook_before_view, hook_before_footer, hook_before_send) if defined are called for views only. In my case I would like a callback to be executed for both views and scripts. This will allow us to execute the same logic for both views and scripts.
> <?php
> // Additional callback for hooks.php
> /**
>  * hook_before_all
>  *
>  * This is the first hook called for both views and scripts (*.do).
>  */
> function hook_before_all() {}
> ?>
> Please see attached patch...
> Cheers & Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira