This discussion is archived
6 Replies Latest reply: Nov 3, 2010 10:34 AM by Patrick Wolf RSS

plugin strategy?

765625 Newbie
Currently Being Moderated
Hi all,

I am currently working on improvement of an application that we have developped last year with Apex 3.2.1.
The general application architecture is this one :

There is a main page with different regions. A main region and some other ones that fit to a defined functionnality.

For instance, there is a region to search in database. So there is a select list, a text field, a button and so on and javascript/AJAX treatments on the search result.

My boss would like to give the customer the possibility to choose what region he wants to include into the application while the install process.

So he suggested me to have a look at plugins concepts and try to turn each region into a plugin. But I am nearly sure that it shouldn't be a correct strategy. We don't want to reuse our "special" regions in other applications (what it is final plugins target if I have well understood.)
We just want to adapt one application to different customers.

So Am I right? What other way can we use to reach our target? (I know that each region can be de/activated manually in Apex, but we want to have a more common "user-like interface" while the installation.

Thanks in advance for your help.

Maxime.
  • 1. Re: plugin strategy?
    munky Guru
    Currently Being Moderated
    Hi

    You could have your installation scripts create a user preferences table and then populate this via a prompt of some kind during installation. The regions could then be created with conditional display dependent upon this table.

    You could also include a setting page where this could be modified later on. Should be pretty easy...

    Cheers

    Ben
  • 2. Re: plugin strategy?
    765625 Newbie
    Currently Being Moderated
    First thanks for the fast answer. First thought to do that too. But I want to be sure that's the best solution in terms of cost and efficiency because I will have to justify my choice.

    I forgot to ask about something anyway. Let's consider my example with the search region again.

    There will be two search mode. first mode in XML, second in SQL. First will call a javascript function that will send the XML request to a server. The second will call another javascript function that will call a process doing the PLSQL treatments.

    I would like to specify what mode will be used for the search during the installation and so, what function will be called.

    That's just an example and there will be probably other regions with parameters.

    I guess the plugin could be more useful there but I don't really like the idea to recreate all my items with code to perform this.

    Any faster alternative?

    Thanks again for helping.

    Maxime
  • 3. Re: plugin strategy?
    munky Guru
    Currently Being Moderated
    Hi

    What you have described actually backs up going down the route that I suggested. You only need one table to hold all the user preferences and make everything conditional on this table. The only difference you have now is that as well as the value of the preference, you also need to record what preference for example...
    SELECT 'X'
    FROM my_pref_table
    WHERE pref = 'SEARCH_MODE'
    AND value = 'XML'
    Small table, quick look up, default APEX conditional behaviour.

    I think that the plugin route could become a little cumbersome for what you are trying to achieve and is not, in my opinion, what it was designed for.

    Cheers

    Ben
  • 4. Re: plugin strategy?
    765625 Newbie
    Currently Being Moderated
    Yeah, but I think there is no way to specify two javascript callbacks function on a conditional button in Apex. But maybe am I wrong?

    Anyway I guess I still can specify one callback and check the preference value in a javascript function that will call one of the both next. It's not really harder.

    Ok. Seems what I understood about the plugins wasn't so wrong then.

    Thanks a lot for helping again :)

    Maxime
  • 5. Re: plugin strategy?
    munky Guru
    Currently Being Moderated
     I think there is no way to specify two javascript callbacks function on a conditional button in Apex
    But what you could do is have a hidden item that holds the value of the preference, then use this item as a parameter into the javascript function then do you conditional logic within the js function (rather than do an AJAX callback).

    Cheers

    Ben
  • 6. Re: plugin strategy?
    Patrick Wolf Employee ACE
    Currently Being Moderated
    Hi Maxime,

    sounds like you should have a look at the "Build Options" feature (Shared Components).

    1) Create a build option for each of your regions
    2) For each region, assign the build option in the "Configuration" section
    3) Enable build option prompting in "Supporting Objects"

    Regards
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points