Best Practice for managing variables for multiple environments

I am very new to Java WebDynPro and have a question
concerning our deployments to Sandbox, Development, QA,
and Production environments.
What is the 'best practice' that people use so that if
you have information specific to each environment you
don't hard-code it in your Java WebDynPro code.
I could put the value in a properties file, but how do I
make that variant?  Otherwise I'd still have to make a
change for each environment to the property file and
re-deploy.  I know there are some configurations on the
Portal but am not sure if that will work in my instance.
For example, I have a URL that varies based on my
environment.  I don't want to hard-code and re-compile
for each environment.  I'd prefer to get that
information on the fly by knowing which environment I'm
running in and load the appropriate URL.
So far the only thing I've found that is close to
telling me where I'm running is by using a Parameter Map
but the 'key' in the map is the URL not the value and I
suspect there's a cleaner way to get something like that.
I used Eclipse's autosense in Netweaver to discover some
of the things available in my web context.
Here's the code I used to get that map:
TaskBinder.getCurrentTask().getWebContextAdapter().getRequestParameterMap();
In the forum is an example that gets the IP address of
the site you're serving from. It sounds like it is going
to be or has been deprecated (it worked on my system
right now) and I would really rather have something like
the DNS name, not something like an IP that could change.
Here's that code:
String remoteHost = TaskBinder.getCurrentTask().getWebContextAdapter().getHttpServletRequest().getRemoteHost();
Thanks in advance for any clues you can throw my way -
Greg

Hi Greg:
     I suggest you that checks the "Software Change Managment Guide", in this guide you can find an explication of the best practices to work with a development infrastructure.
this is the link :
http://help.sap.com/saphelp_erp2005/helpdata/en/83/74c4ce0ed93b4abc6144aafaa1130f/frameset.htm
Now if you can gets the ip of your server or the name of your site you can do the next thing:
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
String server_name = request.getServerName();
String remote_address =     request.getRemoteAddr()
String remote_host = request.getRemoteHost()
Only you should export the servlet.jar in your project properties > Build Path > Libraries.
Good Luck
Josué Cruz

Similar Messages

  • Best Practice for Multiple iTunes and One Account?

    My wife and I share our account for our iPhone Applications and Songs in iTunes.
    Can someone point me to a topic that covers a best practice for multiple iTunes syncing?
    I travel a lot and keep my iPhone synced to my Macbook Pro while she uses the workstation at home to sync to. We keep the addresses and contacts and calendars synced through MobileMe, however, I'm trying to find the best way of pushing applications and songs I've bought over to the other PC so they're still around while I'm traveling for her to sync with.
    Thoughts?

    Hi Steve,
    Might be trying for solution for a long time, If i understood your question clear let me clarify you few points.
    You are trying to access the bex query which is designed with the exit's in the background based on the logic and trying to call the entire dimensions and key-figures in a single connection. Then you are trying to map those data in the charts.
    Steve, try to make more connections based upon the logic and split them. use the same query but split them by sales per customer group, sales per day, sales per week by making three different connections and try. You can merge the prompts from all connections.
    Hope this Helps!!!
    Sorry if i misunderstood your question.
    --SumanT

  • Best Practices for multiple authors using single project?

    We are having many issues, particularly with moving, renaming, and multiple check out warnings.  We have a single project with many authors and it seems like RH is not designed to work that way. There is an article in the RH devnet-archive in an article entitled "Sharing RoboHelp Project Among Multiple Authors" that says"
    "At first there may be the temptation to let every author work on every file in a project.  This is certainly not a best practice. Regardless of source contraol, it is always best to designate certain authors as owning certain content-related sections, folders, or topics within a project -particulary at the folder level."
    This statement, and our experience seems to indicate that RH is not a true CMS as we had envisioned.  What are the best practices for this scenario to avoid stepping on each others toes and having problems with source control.

    I have moved this to the source control forum for the gurus there to answer.
    Meantime I must admit I read that statement the same way as you first time. However, on rereading I think what the author is saying is not that what you want cannot be done, rather it is best practice to guide authors to work in discrete areas.
    I will leave it to the author or another guru to give you a more complete answer.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Best practice for multiple instances of the same BEX query

    Hi there,
    I'm wondering what's the best way to use multiple instances of the same BEX query. Let me explain what I mean:
    I have a dashboard with different queries feeding different period of time such as: week to date, month to date and so on. One query for each since it is based on a user exit.
    For each query I want to show different data in different sections of my dashboard. Per example: sales per directors or sales per customer group, sales per day, sales per week and the like.I tried to connect a simple bar chart via a direct connection but with no success due to the multiple lines generated by the addition of the sales director, customer group, week number and so on.
    My question is about the way to connect the different queries efficiently in order to show the different data while avoiding multiple useless lines.
    The image above shows the query browser where, per example, for a Month to date query there will be mutiple line for each week as well as one line for each director. If, for two different components, I want to show data per week and data per director or other representation what is the best practice:
    Add another instance of the same query and only put the week information and another one will only the director info?
    Should I bind those to the excel file and use formulas to make final calculations?
    Will there be a performance issues for adding different instances of the same query
    I have 6 different queries (read 6 user exit that filters time via user exit).
    Depending on the best practices there might be 4 instances for each for a total of 24 instances in the query browser.
    I hope my question is clear enough, if not please do not hesitate I'll clarify as much as possible.
    Regards,
    Steve

    Hi Steve,
    Might be trying for solution for a long time, If i understood your question clear let me clarify you few points.
    You are trying to access the bex query which is designed with the exit's in the background based on the logic and trying to call the entire dimensions and key-figures in a single connection. Then you are trying to map those data in the charts.
    Steve, try to make more connections based upon the logic and split them. use the same query but split them by sales per customer group, sales per day, sales per week by making three different connections and try. You can merge the prompts from all connections.
    Hope this Helps!!!
    Sorry if i misunderstood your question.
    --SumanT

  • Configuring AD Sites and Services best practice for multiple office site ?

    Hi People,
    Can anyone here please suggest me or share the link of what is the best practice in configuring the AD Sites and Service for single AD domain with multiple office sites ?
    I'd like to know more about the number and the direction of the connection between Domain Controllers in one site to the Data Center and vice versa.
    Thanks.
    /* Server Support Specialist */

    Hi People,
    Can anyone here please suggest me or share the link of what is the best practice in configuring the AD Sites and Service for single AD domain with multiple office sites ?
    This series can be useful:
    Active Directory Structure Guidelines – Part 1
    Mahdi Tehrani   |  
      |  
    www.mahditehrani.ir
    Please click on Propose As Answer or to mark this post as
    and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.
    How to query members of 'Local Administrators' group in all computers?

  • RTLS best practices for outdoor environments

    Hi there,
    I was curious as to what the requirements are for outdoor location based services are. Do the indoor best practices apply to outdoor environments? As in APs located 40 - 70 feet apart, clients heard at -75 dbM @ 3 APs etc etc.
    I have a client that we surveyed using these specs and 1532i APs. However they now running fibre outdoors so we are thinking 1552i models to accommodate. However I can't find the Tx power levels to know if the 1552i could emit a cell size small enough.
    Any advice?
    -Brett

    If you look at the data sheet for both models, the maximum transmit power is close. So lowering the TX power would be the same on both models. 
    -Scott

  • Best practice for multiple email accounts

    Hello
    I have set up a Mac mini server with virtual hosts. So, how is the best practice to set up email accounts for each host? I want to have emails like
    [email protected]
    [email protected]
    and
    [email protected]
    [email protected]
    and so on.
    Should I create groups for each domain, and then user "info" and "contact" in each group. Or just add a user something like "infomysite1" and have a second short name "[email protected]"
    Advices are welcome
    Best regards, Magnus

    If user1@domain1 and user1@domain2 are the same person then you just add the other domain to Hosting-> Local Host Aliases. Same user will get all mail for both domains.
    However, I'm presuming that the user1@domain1 and user1@domain2 are two separate people (i.e., same name but different mail account). If so...
    See Chapter: A Mail Service Virtual Host in Apple's Mail Services Administration PDF download at http://www.apple.com/server/macosx/resources/documentation.html
    Also, see MakingVirtual_Mail_Users_in_OS_XServer.pdf from http://osx.topicdesk.com (downloads sections)
    The topicdesk pdf was written for 10.5 server but I think it is still applicable to 10.6 (but follow the Apple doc just in case). However, it is good for explaining why you might want postfix-style aliases rather than the simpler Apple server-style aliases.

  • Best practice for multiple VIs talking to same PXI

    I am looking for a reccomended practice for my use case, which I feel has to be what a lot of people do/need.
    I have a NI-SCOPE PXI device, but this applies to most instruments on some level.  I have multiple VIs that do simple things, such as one VI that changes the horizontal settings, one VI that changes trigger settings, one VI that reads the current trace from the scope.  How can I have multiple VIs talk to the same instrument, some of them might even be called at the same time.
    Some more specifics about my use case is that I am calling these VIs from a web service, and the trace VI is called very frequently and streamed to the user (via the web service).  
    I was thinking of implementing a VI that would give me the VISA connection for the instrument and a semephore.  I would then have the VI doing the work aquire the semephore, make the instrument calls and then release the semephore.  Are there better or different ways?  Maybe something I am over looking with the semephore implementation?

    Typically for this sort of thing I would have a device handler VI which contains your VIs for talking to the instrument. This VI acts like a 'server' and does your device communications and then you can send commands to the device handler VI (e.g. via a queue/event) and it will return the result.
    I would implement this as a state machine (normally using queues) - states for initialising the device, a state for each action you want to perform and a close/shutdown state when your application finishes.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Best practices for multiple developers?

    I am currently working on a fairly large application. At this
    time, I have been the only developer on it, so it hasn't been a
    problem in keeping all of my files up to date or anything. However,
    I know in the future some new blood will be brought in to assist
    me. To this end, I'm looking for suggestions on the best ways to
    set up the project for multiple developers, especially in terms of
    using VSS.
    So far, I have the main HTML, JS, and FLA/SWF files located
    on a web server - easy enough to create a project in Flash and
    synch up with VSS. But what about the supporting .as files? The
    help files seem pretty straight-forward on this kind of thing, but
    I am curious about other people's experiences.
    Any suggestions for me? Thanks!

    HI,
    You can install it on one common desktop, for example you can use citrix program neighborhood. you can install a common desktop in citrix program neighborhood and every time you need to apply some patches you can apply over there. so that you dont need to install it on each and every users desktop. so who ever needs business objects client tools they will be accessing through citrix program neighborhood.
    I hope its clear.
    Thanks,
    SK.

  • PC Convert - Configuring Mail & Best Practices for Multiple Users

    I finally came to the light side last night. I bought an iMac and now I'm trying to figure out how to best set it up for use by me and my wife. Our PC is set up with a single login account and I've created multiple Outlook (not Express) profiles, one for her and one for me.
    Can I do the same thing on the iMac? Am I better off creating multiple login accounts and just keeping everything separate? Being new, I would rather set things up the right way the first time and not have to undo things due to my lack of experience with iMac.
    Thanks!

    Hello,
    Welcome to the Discussions, and welcome to Macs!
    If you each wish not to see the email messages of the other, then your only real choice is to set up separate User Accounts (what you are calling login accounts). Of course using a single User Account, you can set both email accounts up in Mail, and if you keep the Inbox and Sent mailboxes expanded to show the separate Inbox (and Sent) for each account, then that works pretty well. It will not distinguish New Mail without looking in the the Inbox -- the red dot in the Dock will not separate for whom new mail has arrived. But the Address Book will be the same and shared.
    The advantage of multiple User Accounts is that the entire Dock can be customized for the applications each of you like to use, if they are different.
    The disadvantage will be in not sharing will include not sharing the Address Book, music and photo libraries, etc.
    Ernie

  • Best Practices for Multiple Forms-Reports Instances (WebLogic) on Win2008R2

    Hello all,
    I’ve succeeded in creating two instances of Forms/Report (FR) in WebLogic and am looking at about 5 or 6 FR instances on a one Windows Server 2008R2 box. I understand each instances will have its own folder (FR_Inst1) structure under the Middleware folder. Currently I have two instances configured each with its own Home (FR_Home1 & FR_Home2) and Domain (FR_Domain1 & FR_Domain2). Both the of the separate FP applications function correctly.
    Can multiple similar type instances share a single Home (FR_Home)? Can multiple similar type instances share a single Domain outside of the WebLogic Domain, such as FR_Domain?
    Thanks,
    Ron

    Thanx for the reply! I read through the documents and they are very good at explaining how to install the different components individually. I still can't find much on installing them together. I hope it's not just going to be a trial and error thing.
    So far I've installed done the following successfully:
    Installed 10.3.5 weblogic
    Forms and Reports 11g on top of 10.3.5
    I've created an additional managed server for our ADF applications.
    My next step is upgrading the JSF to 2.x. I would have to stage patches 12917525 and 12979653. I'm afraid it will break the forms and reports though. Any ideas?

  • Best practices for multiple users on a network?

    We have a centralized server storing all of our media, and a Final Share system allowing about 10 clients to connect.  The details of the system aren't important, it mounts just like a local drive on each client and bandwidth is higher than FW800.
    My question is what is the best way to handle cache files, sidecar files, autosave, etc. when passing edits between editors?  What should be stored locally, what can be placed on the server?  Of course all media has to be placed on the server, but can everything else sit alongside the footage? 
    The reason I ask is we started by pointing everything at the server, but now are having the good old Serious Error whenever two editors (in different project files) are referencing the same media.  We'd love to resolve this... assistant editors can't log footage if doing so causes the editor's project file to lock up. 
    Thanks!
    P.S. first tried called adobe phone support about this... not making that mistake again.  The most apathetic customer service rep I think I've ever spoken with told me they wouldn't provide support because our Serious Error was the result of network issues and not their fault.  And then that we should be storing our media files locally.  I didn't see it necessary to mention that local storage on 10 machines isn't that viable with almost 50TB of data.

    klonaton wrote:
    The reason I ask is we started by pointing everything at the server, but now are having the good old Serious Error whenever two editors (in different project files) are referencing the same media.  We'd love to resolve this... assistant editors can't log footage if doing so causes the editor's project file to lock up.
    Hi Klonaton.
    Are you using two Premiere projects or one Prelude project (for logging) and one Premiere project (for editing) ? I'll have to check tomorrow to be absolutely sure but we do sometimes have simultaneous logging and editing with -respectively- Prelude and Premiere through our small network, with no issues.
    Changes to metadata and comment markers created into Prelude instantly appears and update into Premiere. Subclip don't and have to be sent from Prelude to Premiere on the same computer (or the media has to be imported again inside Premiere). I think it's normal considering how subclips work a bit differently in Prelude and Premiere.
    Every files are on a thunderbolt raid drive shared on the network through an iMac. The Media Cache and Media Cache DB are on the network shared drive too, and common to every users and computers.
    Also I don't get if crashes happen when your two projects are running simultaneously or not (in the latter case, that's a huge problem).

  • Best Practice for Multiple source.

    Hello gurus:
    The scenario is the following
    I have a material which can be purchase from Supplier A o from Supplier B using a 60/40 distribution..
    What set of steps should i follow from here to make sure every time a purchase requisition it is triggered from MRP a quota arrangement will be suggested to buy the goods from A and B?
    Is it possible to change the quota arrangement once it is confirmed by the MRP?
    Some times we will decide the source determination at the time of converting the Purchase Order, how to handle this if there is no master data like quota arrangement?
    Regards,

    What set of steps should i follow from here to make sure every time a purchase requisition it is triggered from MRP a quota arrangement will be suggested to buy the goods from A and B?
    Create the quota arrangement and in the source list enter 1 for MRP field
    Is it possible to change the quota arrangement once it is confirmed by the MRP?
    quota arrangement can not be changed once it is assigned by MRP except you delete the reqs generated by MRP
    Some times we will decide the source determination at the time of converting the Purchase Order, how to handle this if there is no master data like quota arrangement?
    if oyu don't have quota then system will sugget the source from source list (if you have not make Fix sourcelist in source list)

  • Best Practice for Managing a BPC Environment?

    My company is currently running a BPC 5.1 MS environment and will soon be upgrading to version 7.0 MS.  I was wondering if there is a white paper or some guidance that anyone can give with regard to the best practice for managing a BPC environment.  Which brings to light several questions in my mind:
    1.  Which department(s) in a company should u201Cownu201D the BPC application? 
    2. If both, whatu2019s SAPu2019s recommendation for segregation of duties?
    3. What roles should exist within our company to manage BPC?
    4. What type(s) of change control is SAPu2019s u201CBest Practiceu201D?
    We are currently evaluating the best way to manage the system across multiple departments, however there is no real business ownership in the system, which seems to be counter to the reason for having BPC as a solution in the first place.
    Any guidance on this would be very much appreciated.

    My company is currently running a BPC 5.1 MS environment and will soon be upgrading to version 7.0 MS.  I was wondering if there is a white paper or some guidance that anyone can give with regard to the best practice for managing a BPC environment.  Which brings to light several questions in my mind:
    1.  Which department(s) in a company should u201Cownu201D the BPC application? 
    2. If both, whatu2019s SAPu2019s recommendation for segregation of duties?
    3. What roles should exist within our company to manage BPC?
    4. What type(s) of change control is SAPu2019s u201CBest Practiceu201D?
    We are currently evaluating the best way to manage the system across multiple departments, however there is no real business ownership in the system, which seems to be counter to the reason for having BPC as a solution in the first place.
    Any guidance on this would be very much appreciated.

  • Best practices for development / production environments

    Our current scenario:
    We have one production database server containing the APEX development install, plus all production data.
    We have one development server that is cloned nightly (via RMAN duplicate) from production. It therefore also contains a full APEX development environment, and all our production data, albeit 1 day old.
    Our desired scenario:
    We want to convert the production database to a runtime only environment.
    We want to be able to develop in the test environment, but since this is an RMAN duplicated database, every night the runtime APEX will overlay it, and the production versions of the apps will overlay. However, we still want to have up to date data against which to develop.
    Questions: What is best practice for this sort of thing? We've considered a couple options:
    1.) Find a way to clone the database (RMAN or something else), that will leave the existing APEX environment intact? If such is doable, we can modify our nightly refresh procedure to refresh the data, but not APEX.
    2.) Move apex (in both prod and dev environments) to a separate database containing only APEX, and use DBLINKS to point to the data in both cases. The nightly refresh would only refresh the data and the APEX database would be unaffected. This would require rewriting all apps to use DBLINKS though, as well as requiring a change to the code when moving to production (i.e. modify the DBLINK to the production value)
    3.) Require the developers to export their apps when done for the day, and reimport the following morning. This would leave the RMAN duplication process unchanged, and would add a manual step which the developers loath.
    We basically have two mutually exclusive requirements - refresh the database nightly for the sake of fresh data, but don't refresh the database ever for the sake of the APEX environment.
    Again, any suggestions on best practices would be helpful.
    Thanks,
    Bill Johnson

    Bill,
    To clarify, you do have the ability to export/import, happily, at the application level. The issue is that if you have an application that consist of more than a couple of pages, you will find yourself in a situation where changes to page 3 are tested and ready but, changes to pages 2, 5 and 6 are still in various stages of development. You will need to get the change for page 5 in to resolve a critical production issue. How do you do this without sending pages 2, 5 and 6 in their current state if you have to move the application all at once??? The issue is that you absolutely are going to need to version control at the page level, not at the application level.
    Moreover, the only supported way of exporting items is via the GUI. While practically everyone doing serious APEX development has gone on to either PL/SQL or Utility hacks, Oracle still will not release a supported method for doing this. I have no idea why this would be...maybe one of the developers would care to comment on the matter. Obviously, if you want to automate, you will have to accept this caveat.
    As to which version of the backend source control tool you use, the short answer is that it really doesn't matter. As far as the VC system is concerned, you APEX exports are simply files. Some versioning systems allow promotion of code through various SDLC stages. I am not sure about GIT in particular but, if it doesn't support this directly, you could always mimic the behavior with multiple repositories. Taht is, create a development repository into which you automatically update via exports every night. Whenever particular changes are promoted to production, you can at that time export form the development repository and into the production. You could, of course, create as many of these "stops" as necessary to mirror your shop's SDLC stages, e.g. dev, qa, intergation, staging, production etc.
    -Joe
    Edited by: Joe Upshaw on Feb 5, 2013 10:31 AM

  • What are best practices for managing my iphone from both work and home computers?

    What are best practices for managing my iphone from both work and home computers?

    Sync iPod/iPad/iPhone with two computers
    Although it isn't possible to sync an Apple device with two different libraries it is possible to sync with the same logical library from multiple computers. Each library has an internal ID and when iTunes connects to your iPod/iPad/iPhone it compares the local ID with the one the device normally syncs with. If they are the same you can go ahead and sync...
    I have my library cloned to a small 1Tb USB drive which I can take between home & work. At either location I use SyncToy 2.1 to update the local copy with the external drive. Mac users should be able to find similar tools. I can open either of the local libraries or the one on the external drive and update the media content of my iPhone. The slight exception is Photos which normally connects to a specific folder on a specific machine, although that can easily be remapped to the current library if you create a "Photos" folder inside the iTunes Media folder so that syncing the iTunes folders keeps this up to date as well. I periodically sweep my library for new files & orphans withiTunes Folder Watch just in case I make changes at one location but then overwrite the library with a newer copy from the other. Again Mac users should be able to find similar tools.
    As long as your media is organised within an iTunes Music or Tunes Media folder, in turn held inside the main iTunes folder that has your library files (whether or not you let iTunes keep the media folder organised) each library can access items at the same relative path from the library folder so the library can be at different drives/paths on different machines. This solution ensures I always have adequate backups of my library and I can update my devices whenever I can connect to the same build of iTunes.
    When working with an iPhone earlier builds of iTunes would remove any file not physically present in the local library, even if there was an entry for it, making manual management practically redundant on the iPhone. This behaviour has been changed but it will still only permit manual management with a library that has the correct internal ID. If you don't want to sync your library between machines on a regular basis just copy the iTunes Library.itl file from the current "home" machine to any other you want to use, then clean out the library entires and import the local content you have on that box.
    tt2

Maybe you are looking for

  • Password protected site and gallery: no go

    Hi, i'm trying to publish a password protected site to mobileme. The site will contain links to mobileme galleries (password protected too). first issue: i can't add a protected gallerie to iweb, iweb doesn't show it. After removing the protection ("

  • Radar Charts SSRS

    Hi All, I have requirement to develop a report like below image. Is to possible to develop this kind of reports in SQL Server Reporting services 2008 r2. I have tried with one example but the major grid lines shows only circle it is not changing to b

  • FTP Security

    Hi Everyone How to provide PGP  Security for ftp at the file adapter module.Can any one please send me the documenation link for PGP Security in XI.or In XI how to provide to security for FTP transfers. Thanks Rajesh

  • Af:table range navigation

    Hi, i'm facing a problem...i'm using seperate af:selectRangeChoiceBar for range navigation. But sometimes the rangebar behaves wrongly, like in safari, if i slecet the range from option list, range is changing and suddenly again server trip is happen

  • How to insert the sim card

    How do you insert the sim card to iPhone 4