Where is the best place to set the path with Application.cfc?

Hi!
When I used Application.cfm, I set many path variables here so I don't have to keep writing a full path on many of the templates repeatedly.
So I did:
<CFSET FileArchives = "/space/users/www/FileArchives/#session.Groups#/">
<CFSET GoodFiles = "/space/users/www/GoodFiles/#session.usergroup#/">
etc...
Later on I only need to refer it as: #FileArchives# in the codes instead of a full path name.
Now that I'm using Application.cfc can I also do the same thing???? should I do it within OnApplicationStart function? am I doing it correctly? (see below)
     <cffunction name="onApplicationStart" returnType="boolean" output="false">
           <cfset application.dsn = "EMBB">
          <CFSET application.FileArchives = "/space/users/www/FileArchives/#session.Groups#/">
          <CFSET application.GoodFiles = "/space/users/www/GoodFiles/#session.usergroup#/">
         <cfreturn true />
     </cffunction>

Dan Bracuk wrote:
Setting application variables in OnApplicationStart is a good idea.  However, referring to session variables in the OnApplicationStart function is not.
Indeed.  Wading through this lot - http://adamcameroncoldfusion.blogspot.co.uk/2012/08/more-on-applicationcfc-when-things-run .html - might be helpful for the OP to get a handle on when things run, and when things become available.
But the session scope is not available in onApplicationStart().
Adam

Similar Messages

  • Where is the best place to make a slideshow with pictures and music on a mac?

    Where is the best place to make a slideshow with pictures and music on Macbook Pro?

    There are many ways to produce slide shows using iPhoto, iMovie or iDVD and some limit the number of photos you can use (iDVD has a 99 chapter (slide) limitation).
    If what you want is what I want, namely to be able to use high resolution photos (even 300 dpi tiff files), to pan and zoom individual photos, use a variety of transitions, to add and edit music or commentary, place text exactly where you want it, and to end up with a DVD that looks good on both your Mac and a TV - in other words end up with and end result that does not look like an old fashioned slide show from a projector - you may be interested in how I do it. You don't have to do it my way, but the following may be food for thought!
    Firstly you need proper software to assemble the photos, decide on the duration of each, the transitions you want to use, and how to pan and zoom individual photos where required, and add proper titles. For this I use Photo to Movie. You can read about what it can do on their website:
    http://www.lqgraphics.com/software/phototomovie.php
    (Other users here use the alternative FotoMagico:  http://www.boinx.com/fotomagico/homevspro/ which you may prefer - I have no experience with it.)
    Neither of these are freeware, but are worth the investment if you are going to do a lot of slide shows. Read about them in detail, then decide which one you feel is best suited to your needs.
    Once you have timed and arranged and manipulated the photos to your liking in Photo to Movie, it exports the file to iMovie  as a DV stream. You can add music in Photo to Movie, but I prefer doing this in iMovie where it is easier to edit. You can now further edit the slide show in iMovie just as you would a movie, including adding other video clips, then send it to iDVD 7, or Toast,  for burning.
    You will be pleasantly surprised at how professional the results can be!
    To simply create a slide show in iDVD 7 onwards from images in iPhoto or stored in other places on your hard disk or a connected server, look here:
    http://support.apple.com/kb/HT1089

  • The best place to put the global parameter

    hello:
    i am now studying the petstore1.3,and find that the global parameters are kept in the servlet context,i wonder if it is a good solution.in my project,i seldom use the servlet context,session context etc,i feel more like to put the global parameter in a singleton that is loaded when the app is started. i don't know where is the best place to put the global parameter,servlet context or singleton?

    thanks for your answer.
    1 do your mean that the singleton can be shared among the different "war"
    packages if both of them are within the same jvm?if yes,must they be in the
    same "ear" package?
    2 if my app is deployed in the weblogic cluster environment,which one can be
    shared? singleton or servlet context?

  • Where is the best place to buy the new ipad? Please help

    I am ready to buy a new ipad.  There is no apple store in my town but I will be close to one in a couple of days.  My town has Best Buy, Target, and Walmart.  Assuming I can find what I want... in case I have issues with it, where is the best place to purchase from??  (as far as ease of return, etc). Please advise.

    Dah*veed ..... I do not disagree with what you said about the AppleCare+ protection plan as it does state on the website that proof of purchase is required - IF ... You purchase over the phone. Actually, I did not expect to be able to do this over the phone, but as I said I received the paperwork today via email.
    I copied this from the website and I'm typing this on my new iPad so it may come out a little distorted but you can read the sentence at the bottom that says it can be done over the phone with proof of purchase. I gave the rep my serial number, confirmed my address and CC details and the deal was done. I even called back later in the day to make absolutely certain that I did in fact purchase the AppleCare+ plan that has the two incidents of accidental damage included for a $49.00 charge. The rep did in fact confirm that I did buy the correct plan that I wanted and I am looking at the printed paperwork confirming the whole thing.
    Maybe I just got lucky!
    iPad - AppleCare+
    Every iPad comes with one year of hardware repair coverage and 90 days of telephone technical support. AppleCare+ for iPad gives you two years of repair coverage and technical support from the original purchase date of your iPad. And it adds coverage for up to two incidents of accidental damage due to handling of your iPad, each subject to a $49 service fee.1
    How to get AppleCare+
    You must buy AppleCare+ within 30 days of your iPad purchase.
    There are three ways to buy:
    From the Apple Online Store: When you order the new iPad or iPad 2, you’ll have the option to add AppleCare+ to your cart before you check out.
    At an Apple Retail Store (requires a Genius Bar appointment, inspection of the iPad, and proof of purchase).
    By calling 1-800-275-2273 (requires proof of purchase).
    Learn more

  • Where is the best place to buy the iPhone in Los Angeles?

    I don't know where else to post this message. Did anyone wait in a short line to get an iPhone? Is there a store in Los Angeles that does not have a long line? I would love to buy an iPhone today however I am not willing to wait more than a half an hour in line. Anyone have any luck beating the line?
    Thanks

    Can't be done yet. Figure 2-3 hours minimum or wait a week.

  • What is the best way to set up itunes with 2 different ipods on same desktop?

    I have a new computer, was able to transfer itunes fine.  now having probs figuring out how to set up 2 ipods.  older ones - 2gb nano and a 30gb classic.  wld like to use same library.  thought about setting up 3 itunes - one main, one for each ipod.  everything i've read for homesharing is for networks.  any ideas??????

    How to use multiple iPods, iPads, or iPhones with one computer

  • Where is the best place to put custom functions?

    Hi,
    I have a composition which has a number of symbols. I have to call some custom methods externally and was wondering where is the best place to put the custom methods?
    I have seen posts that I should put the code in the CompositionReady event of the stage but I would like to put it a bit closer to the symbol.
    Is this the best place?
    Sham.

    Here is a case:
    It's a good idea if you well understand global and local variables.
    About complete event, you are right.

  • What is the best way to set up multiple Apple devices ?

    Lime many of us here I have quite a few apple devices and I just wondered whet the best way to set them up with itunes / Apple
    my Apple gear:
    Mac mini 2.53 with Mountain Lion
    Mac Mini 1.6 duo Snow Leopard
    Iphone 5c (mine) running 8
    Iphone 5c (wifes) running 8
    iPad 2 (old)  64 GB  running 8
    iPad Mini 2 retina  32 GB running 7
    g3 iMac (running Tiger) Juke box (semi retired ;-) now)
    At the moment all devices (apart from new Mac mini 2 and the old G3) are set up under my Apple ID ... (1 Apple ID for all devices) ... obviously this has problems : my wife downloads an App it will appear on my phone; we have had to disable some of the messaging systems as at one point my wife was getting my messages et ... is there a better way to do this? 

    cosmiconion wrote:
    one drawback of same Apple ID for store is that what she downloads will automatically appear on all devices
    Do you mean the visibility of the purchase in the App Store (under purchases) or the installation of the app automatically on the other devices?
    In the App Store on the device (under iOS 8 at least on the iPad, I couldn't get it to work on my iPhone 5 under iOS 8), you can hide purchases...just swipe it to the left in the Purchased list. You can then unhide the hidden purchase(s) if desired by using iTunes on the PC/Mac under your iTunes account.
    Auto App updates (Automatic Downloads) can be controlled under: Settings/iTunes & App Store, scroll down to Automatic Downloads and disable those that you do not want.

  • Where is the best place to put cfqueries?

    Where is the best place to put cfqueries, in the <head> </head> or before the html tag? Thanks

    So before the doctype tag? Thanks
    I just doesn't really matter.  the doctype, head, body, etc only matter to the browser; the CF tags only matter to CF.  The browser doesn't see the CFML, and CF doesn't care about the mark-up one bit: it just ignores it.
    The best place - as I said - is not in the same file at all.  But if you insist on slapping your business logic in with your display logic, then the only consideration is that you need to set your variables before you use them.  Other than that: it simply doesn't matter.
    One consideration you might make is - even if it's all thrown into the same one file - at least separate the file itself into sections: have all your CFML code that gets your data at the top, and try to limit the CFML you have mixed in with the mark-up, eg: limit it to stuff like loops and conditionals.
    But, seriously, separate your concerns.  Dan's pretty much just wrong when he said it's over-engineering. It's just sloppy to not to write tidy, well-maintained, well-organised code.
    Adam

  • Where is the best place to buy memory card?

    Where is the best place to buy a memory card for my nokia n73?
    And what is the best brand to buy. Do 1gb memory cards work well for a nokia n72?
    Please reply,
    Thanks.

    Bought all my memory cards from mobymemory.com. Got a 1gb sandisk ultra II for £23. Next day delivery for orders before 3 too. Never had any problems and even ordered cards for friends phones. All very happy with price and quality.
    P.S. buy the name you know and one size bigger than you think you need. My 1gb has enough room for 300 mp3's or nearer 900 in nokia's format. If pictures are your thing should easy hold over 800 images on the highest setting.

  • I need an Apple SuperDrive 8X Part No. 661-4279 for my MacBook Pro.  Where is the best place to order one?

    I need an Apple SuperDrive 8X Part No. 661-4279 for my MacBook Pro.  Where is the best place to order one?

    Some sites to check out.
    http://www.powerbookmedic.com/Apple-SuperDrive-DVD-Burner-Drive-8x---Macbook-Pro -p-16916.html
    http://www.macpartsonline.com/661-4279-superdrive-8x-double-layer-pata-15inch-2- 2-2-4-2-6ghz-macbook-pro-a1226.html
    http://www.dvwarehouse.com/661-4279-DVD-R/CD-RW-SuperDrive-8x-Dual-Layer-PATA-fo r-MacBook--MacBook-Pro---NEW-p-37374.html
    http://www.welovemacs.com/6614091r.html

  • Where's the Best Place....

    Hello once again,
    I have yet to purchase my MBP, and I am wondering from all of your experiences, where is the best place to buy a 1gig 3rd party RAM. Paying all that money for Apple's RAM isn't that way I want to go, but if there's no recommended 3rd party companies, I may need to cough over the bucks...
    thanks,

    Fair enough. I wasn't actually suggesting buying from Crucial.The best source for the 1gb Crucial was Newegg.com at $150 - but this is also for a chip that Apple are supplying as original ram so it's not a bad price. I didn't know Crucial sold Samsung - seems a bit odd as they are owned by Micron who also supply Apple as OEM. Business makes for strange bedfellows:)
    OWC sell their own branded ram for $112 or so and Samsung M470T295CZ3-CE6 (as also supplied by Apple) for $170. What I was saying was that this Samsung chip,
    http://eshop.macsales.com/item/Samsung/53SDR2SAM1GB/
    can be found for as little as $120 - so OWC are a tad expensive for this particular chip if that is the one you were thinking of buying.
    It sounds like you're going for the OWC own brand, so I can't recommend a cheaper source for that and they know a thing or two about ,macs so there's no reason to not trust their judgement.
    Best of luck
    Cheers.

  • Where is the best place for suggestiong requesting features?

    Where is the best place for suggesting/requesting features?
    If something like this already exists, please let me know.
    I often wish when I select a word to right click and choose dictionary to to find out the meaning of the word. Currently I have to copy, go to a dictionary web page, paste and search. And I spent a lot of time for that. I'm not that technically oriented to suggest how this can be achieved but just as an idea, may be Mozilla can partner with dictionary web sites by making a plug ins or include a dictionary with Firefox itself

    I am sure there are Extensions that do this.
    DictionarySearch - https://addons.mozilla.org/en-US/firefox/addon/68/
    Add-on search for Dictionary - https://addons.mozilla.org/en-US/firefox/search/?q=dictionary&cat=all&lver=any&pid=1&sort=&pp=20&lup=&advanced=
    Feedback - http://hendrix.mozilla.org/

  • Where's the best place to store email templates?

    Hi all;
    In a web app I store all my email templates in a files folder in the web app. Can't do that with a worker in a cloud service - no files. So where's the best place to store them? In a BLOB? And if so, is there a way to have files in my project get automatically
    written to BLOB entries when I publish?
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    Hi,
    I think we could use azure blob to save files.
    >>is there a way to have files in my project get automatically written to BLOB entries when I publish?
    If you choose azure cloud service, you could write the upload code at role onstart method. If you choose Azure website, please consider use azure webjob to do this, refer to
    http://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-webjobs-sdk-get-started/ for more details about webjob.
    Regards

  • Where is the best place to implement business logic in ADF application?

    I am using jdeveloper 11g R2 , JSF Facelet
    Where is the best place to implement business logic in ADF application?
    I mean something like service layer in Spring
    Appreciate your comments
    Regards
    Mohsen

    Depends on what your logic does and what data it deals with, but in general business logic is in the ADF BC layer.
    Some goes into entity objects - for things like attribute or row validation.
    Some goes into view objects - for things like calculation.
    Some goes into AM - for things like service methods for UI clients.

Maybe you are looking for