Loading ...
Sorry, an error occurred while loading the content.

Re: [fusebox5] Fusebox Out of Web Root With No CF Admin Mapping

Expand Messages
  • Peter Boughton
    ... Eh? That (should) work fine - it does in Railo. I downloaded the skeleton app and modified the Application.cfc like this:
    Message 1 of 16 , Nov 17, 2012
    View Source
    • 0 Attachment
      > I think there's a snag, though: I tried it out, but from what I can tell,
      > you can't use a mapping within the Application.cfc that defines it.
      >
      > If I dump expandPath("/myMapping"), it's just tacks that onto the current
      > directory.

      Eh?

      That (should) work fine - it does in Railo.


      I downloaded the skeleton app and modified the Application.cfc like this:


      Only done a quick test, with Railo 3.3, but it appears to work.
    • Jamie Jackson
      Hi Peter, Maybe this is a difference between Railo and Adobe CF (9,0,1,274733). Would you mind running the following distilled test case, and see you get
      Message 2 of 16 , Nov 19, 2012
      View Source
      • 0 Attachment
        Hi Peter,

        Maybe this is a difference between Railo and Adobe CF (9,0,1,274733).

        Would you mind running the following distilled test case, and see you get different results than I do? (You'll have to change the mapping path, obviously.)

        For me, it doesn't seem to be able to find the mapping-based path to the component.


        Thanks,
        Jamie

        On Sat, Nov 17, 2012 at 3:45 AM, Peter Boughton <boughtonp@...> wrote:
         

        > I think there's a snag, though: I tried it out, but from what I can tell,
        > you can't use a mapping within the Application.cfc that defines it.
        >
        > If I dump expandPath("/myMapping"), it's just tacks that onto the current
        > directory.

        Eh?

        That (should) work fine - it does in Railo.


        I downloaded the skeleton app and modified the Application.cfc like this:


        Only done a quick test, with Railo 3.3, but it appears to work.


      • Jamie Jackson
        Never mind, it seems that one needs to use the mappings within an app.cfc * function *(as you had it), in order for it to work. I ll play with this some more.
        Message 3 of 16 , Nov 19, 2012
        View Source
        • 0 Attachment
          Never mind, it seems that one needs to use the mappings within an app.cfc function (as you had it), in order for it to work.

          I'll play with this some more.

          Thanks,
          Jamie

          On Mon, Nov 19, 2012 at 9:44 AM, Jamie Jackson <jamiejaxon@...> wrote:
          Hi Peter,

          Maybe this is a difference between Railo and Adobe CF (9,0,1,274733).

          Would you mind running the following distilled test case, and see you get different results than I do? (You'll have to change the mapping path, obviously.)

          For me, it doesn't seem to be able to find the mapping-based path to the component.


          Thanks,
          Jamie


          On Sat, Nov 17, 2012 at 3:45 AM, Peter Boughton <boughtonp@...> wrote:
           

          > I think there's a snag, though: I tried it out, but from what I can tell,
          > you can't use a mapping within the Application.cfc that defines it.
          >
          > If I dump expandPath("/myMapping"), it's just tacks that onto the current
          > directory.

          Eh?

          That (should) work fine - it does in Railo.


          I downloaded the skeleton app and modified the Application.cfc like this:


          Only done a quick test, with Railo 3.3, but it appears to work.



        • Jamie Jackson
          Peter, your mods to get FB without a mapping are working for me. Thanks for that! However, there s one last thing for me to fix. My app
          Message 4 of 16 , Nov 19, 2012
          View Source
          • 0 Attachment
            Peter, your mods to get FB without a mapping are working for me. Thanks for that!

            However, there's one last thing for me to fix. My app code is out of the web root, in a directory "app," right next to fusebox5 (core files).

            I suspect there's something I need to set FUSEBOX_APPLICATION_PATH, or something, in order to have the app work out of the web root. Here's what I tried, but it doesn't work. (I'm not sure what FUSEBOX_APPLICATION_PATH even does, because I get the same behavior with and without.)

            For some reason, in the parsed wwwroot/parsed/c.home.cfm fuseaction, the fuse includes are pathed correctly, but the plugins are not.

            Do you have any idea how to fix that?

            Thanks again,

            Jamie


            On Sat, Nov 17, 2012 at 3:45 AM, Peter Boughton <boughtonp@...> wrote:
             

            > I think there's a snag, though: I tried it out, but from what I can tell,
            > you can't use a mapping within the Application.cfc that defines it.
            >
            > If I dump expandPath("/myMapping"), it's just tacks that onto the current
            > directory.

            Eh?

            That (should) work fine - it does in Railo.


            I downloaded the skeleton app and modified the Application.cfc like this:


            Only done a quick test, with Railo 3.3, but it appears to work.


          • Peter Boughton
            Yeah, that s a similar thing to extends - the mapping isn t available at that point. All the This.Special bits are effectively just variables inside the
            Message 5 of 16 , Nov 19, 2012
            View Source
            • 0 Attachment
              Yeah, that's a similar thing to extends - the mapping isn't available at that point.

              All the This.Special bits are effectively just variables inside the pseudo-constructor (the name of the code outside of any functions); they are not applied until the moment before the onXStart functions are called.

              Just to re-iterate for clarity: there is an important distinction there versus "within an app.cfc function" - you can't just create any function in app.cfc for evaluating the mapping. It's a question of being called after the point when the values have taken effect, which occurs before the first of on(Application|Session|Request)Start but after the pseudo-constructor code has been executed.

              Hopefully that makes sense?
            • Jamie Jackson
              Yup, got it now, thanks.
              Message 6 of 16 , Nov 19, 2012
              View Source
              • 0 Attachment
                Yup, got it now, thanks.

                On Mon, Nov 19, 2012 at 12:10 PM, Peter Boughton <boughtonp@...> wrote:
                 

                Yeah, that's a similar thing to extends - the mapping isn't available at that point.

                All the This.Special bits are effectively just variables inside the pseudo-constructor (the name of the code outside of any functions); they are not applied until the moment before the onXStart functions are called.

                Just to re-iterate for clarity: there is an important distinction there versus "within an app.cfc function" - you can't just create any function in app.cfc for evaluating the mapping. It's a question of being called after the point when the values have taken effect, which occurs before the first of on(Application|Session|Request)Start but after the pseudo-constructor code has been executed.

                Hopefully that makes sense?


              • Peter Boughton
                Well you re right to conclude that FUSEBOX_APPLICATION_PATH doesn t apply to plugins. Plugins are expected to be within the fusebox5 directory, alongside
                Message 7 of 16 , Nov 19, 2012
                View Source
                • 0 Attachment
                  Well you're right to conclude that FUSEBOX_APPLICATION_PATH doesn't apply to plugins.

                  Plugins are expected to be within the fusebox5 directory, alongside lexicons and errotemplates (rather than as part of your app).

                  There might be a way to change that, by overriding the this.pluginsPath variable used in fuseboxApplication.cfc - something like:

                  application[variables.FUSEBOX_APPLICATION_KEY].pluginsPath = '../app/plugins'

                  That's only from a brief look - not tested and possible it needs more than that.
                • Peter Boughton
                  Argh, looks like I was incorrect with that last message. Was getting various interruptions and mis-read the code rather than checking things properly. :( ...
                  Message 8 of 16 , Nov 19, 2012
                  View Source
                  • 0 Attachment
                    Argh, looks like I was incorrect with that last message. Was getting
                    various interruptions and mis-read the code rather than checking
                    things properly. :(

                    The skeleton app has a plugins dir inside the app directory, and states:

                    > If you use any plugins, be sure to put them in a sub-directory off the root
                    > of your apps called "plugins". Fusebox will look for them here. If you use
                    > many plugins, then you can consider putting them in sub-directories below
                    > the "plugins" dir, being careful to specify the path to them in your
                    > application's fusebox.xml relative to the "plugins" dir.


                    Will test the actual behaviour of that in a moment.


                    Are you intending for the parsed directory to be in wwwroot/parsed or
                    in app/parsed - you currently have both?
                  Your message has been successfully submitted and would be delivered to recipients shortly.