Place to store custom parameters (properties) in swing application

In a relatively simple swing application, I was wondering how should I handle choosing of custom parameters like database userid and password. I think for a simple application I can use xml file for setting the userid and password. But that leads to some doubts.
1. The xml file cannot be included in the jar distribution beacuse otherwise the user will not be able to change the settings.( We don't expect the user to unjar the file, change the settings and repackage it). So where should the xml file be put ?
2. In my program, I should be able to read the xml file based on the relative path (which ideally should begin from the location where the jar is stored). How would I achieve that.
That said, if there is some other way, easier or more suited for this kind of functionality, please let me know.
regards,
nirvan.

Jam_IT wrote:
(new File("")).getAbsolutePath();If the file is not there, ..My understanding is that if the user drags a shortcut to the Jar onto the desktop, that absolute path will point to the desktop.
On a related note. Sun has decided it is no business of code to know where it is stored. Changes to applets and JWS now ensure the code cannot discover the installation location (even for digitally signed and fully trusted code). Non-JWS/applet projects might be able to still get a File location using ..
URL url = ourObject.getClass().getProtectionDomain().getCodeSource().getLocation();..but I would not bank on that still working in Java's 7 or 8..

Similar Messages

  • What is an alternative to bins? Sometimes I want to make custom transitions and I need a place to store them for easy use.

    What is an alternative to bins? Sometimes I want to make custom transitions and I need a place to store them for easy use.

    Either projects or events. You can make a compound clip in a event used to hold favorites. Add a couple of generator items to it and apply the custom transition. You can copy and paste from the compound clip to any project. Hold everything you want into the one event. It probably won't ever get very big, and the render files can be dumped at any time. You can simply move the event from machine to machine or place to place as needed, just as you can other custom content, like keyboard layouts and custom color presets.

  • Linking Custom Document Properties to SharePoint

    We currently have a Microsoft Office Add-in that, among other things, reads and writes Custom Document Properties. Our add-in includes a user-dialogue through which these values are captured and subsequently displayed within the document.
    We now have a requirement to integrate this functionality with SharePoint 2010. In particular, we want our Office custom document properties to be co-ordinated with equivalent SharePoint server properties (i.e. site columns in Document Libraries) so that,
    when a given SharePoint property value is changed the equivalent custom document property is also changed.
    Users must be able to set the properties in either SharePoint or in an Office App (Word for example) and the changes be reflected in both places.
    Our solution must work with the desktop versions of Office 2010/13 and the non-Office365 versions of SharePoint 2010/13.
    During our initial prototyping we have looked at a number of possible approaches (including Document Property Promotion and Demotion) but are still not sure which appropriate to use.
    With regard to Document Property Promotion and Demotion for example, we found that, if we create a document outside SharePoint, then invoke our add-in to set document properties, then upload the document to SharePoint; the SharePoint properties and the
    Office Custom Document Properties are initially in step, any subsequent changes cause problems.
    If we now change the SharePoint properties by editing them in SharePoint and then open the document in Word, the Custom Document Properties are unchanged. Similarly, any change we make in Word is not reflected in the
    SharePoint properties when the document is saved back to the SharePoint library.
    Our properties are all of type string in Word and type Choice in SharePoint.
    For various reasons, our solution must not depend in any way on Office templates.
    We would like to know what would be the recommended approach to implementing this functionality.
    Below provides a basic diagram of our requirement:

    Hi,
    According to your description, you might want to sync the custom document properties between document and SharePoint Library.
    A solution can be like this: We can add an Event Receiver to this library, it will be triggered when there is a file is checked in or the item of list is updated, then we can
    read/write the specific document properties and sync between document and SharePoint Library.
    The whole scenario would be like this: When a document is uploaded and checked in, the method put in the Event Receiver will be triggered and update the related columns of library.
    When we updated these columns in library, we can capture the ItemUpdated event and update the corresponding properties of this document.
    Here is a step by step sample on creating a simple Item added event receiver:
    http://msdn.microsoft.com/en-us/library/ff398052.aspx
    More information on Event Receiver for your reference:
    http://msdn.microsoft.com/en-us/library/gg749858(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/ff408183(v=office.14).aspx
    For about how to update the custom properties of an Office Document, it is recommended you post another question to the Microsoft Office for Developers forum, you will get more
    help and confirmed answers from there.
    http://social.msdn.microsoft.com/Forums/office/en-US/home?category=officedev
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Where is the best place to store Contacts in order to later print labels and such?

    Where is the best place to store contacts in order to later print labels etc?

    I found this excellent article last week describing how to print labels from your Mac's Contacts application:
    How-to: Print customized address labels for holiday card envelopes ...

  • How to store test parameters and recall

    I have built a AC Motor Tester using cDAQ. The tester is in production and running well. The next step I need to tackle is to Record the test parameters that the operator is currently having to enter each time she changes to a different motor. We have several hundred different motor test specifications consisting of  22 different inputs. (1 string, 1-I16, 8-dbl, 4-Boolean, 2-I8, 1-U16). I want to set it up so if the Part Number has not been entered yet, it is recorded. If the Part Number is already in the TDMS file, all of the Value Properties are set from the data in the TDMS file.
    I have wrote a small VI as to how I am trying to appraoch this problem. However, it is looking very convoluted. Is there a better way to do this?
    Attachments:
    Read and Write.vi ‏30 KB

    My favorite way to store that kind of parameters is INI files. Create an INI file for each new motor and store the parameters in it.
    Another way is to use  XML files (there are really great XML toolkits)
    Rodéric L
    Certified LabVIEW Architect

  • How to manage custom document properties (e.g., company name, project name)

    Hi,
    How to manage custom document properties (e.g., company name, project name, event date...) in Apple iWork Pages like it is possible in Microsoft Office Word ?
    The idea is to simplify the management of multiple instances of same piece of information in a document by writing them once as a "properties" of the document that can be referencing in different places of the document. Changing the property value, will automatically change all its instances.
    Thanks in advance for your help

    Thanks for your help Peter.
    Search-Replace and Auto-Substitution are not requivalent for me since I'm looking for something more complex.
    Suppose you have a document about an Event which occur on a specific date (e.g., 11-09-2003).
    In your document, you may be interested in...
    - sometimes display the date as '11-09-2003',
    - sometimes display the date as 'Novembre, 2003',
    - sometimes display the date as 'Sunday, November 9, 2003'.
    With a document property, you would be able to define the EventDate as 11-09-2003, and then define different specific format (e.g., 'mm-dd-yyyy', 'mmmm, yyyy'...) for each reference to the EventDate document property.
    Using Search-Replace of Auto-Substitution, it will be painful since you will have to define as one token per format of a document property (e.g., EventDateAsMMDDYYY, EventDateAsMMMMYYYY...).
    More than that, suppose you have a Numbers table inserted in your Pages document.
    You may be interested in using some document properties in formulas.
    This can't be solved using Search-Replace.
    But its ok, I will wait until this feature will be supported in Pages.

  • Export custom step properties for all sequences based upon expression

    I want to export only my custom step properties to a database. I realize this can be done one at a time but I'm looking for a more general, quicker solution since I have dozens of custom steps and many instances of each. I can probably do this, but if someone has already developed a method I could use the info. Thanks.
    kph 

    Hi kph,
    Unfortunately, there is not a straightforward way to solve this
    problem.  TestStand does not currently support any database
    configuration through programmatic means.  The customized database
    must be configured ahead of time.  I would handle the issue by
    setting up this database in configure >> Database Options. 
    The quickest solution for customization would be to duplicate one of
    the default Schemas (for example, Generic Recordset) under the "Schema"
    tab.  Under the statements tab, you can then cut out all of the
    unwanted statements (it sounds like you'll want to cut out most of
    them) and add new statments for your custom steps.   In this
    step, be sure to reference your custom step type for each statement in
    the "Types to Log" field.
    Under the Columns/Parameters tab, you can then add all of the properties you would like to save for each configured statement.
    At this point, you can use TestStand to create a SQL script file to
    match the Schema you just created.  From the Schema tab, you can
    select the Build .sql File dialog box.  After saving and running
    the script, you will have successfully created the required tables for
    the custom schema. 
    At this point, the custom properties should log to the database.
    Hope this helps in your application development!
    Andrew W. - Applications Engineer

  • Customizing metadata properties in DAM

    Hi all,
    I have been looking into leveraging the DAM to allow for content providers to attach specific global meta data to particular assets. Perhaps I am thinking incorrectly on a strategic level, so any alternate approaches are appreciated as well.
    The problem is, we have a set of affiliates which are listed out in the dam, containing a prescribed set of images/assets/links. These providers can be viewed via pages in CQ5, but also within a set of mobile apps for droid and iPhone.
    The iPhone and droid crews are currently accessing a set of JSON files to get the required metadata, which is placed within the DAM. I think is a very nasty solution, as this data will not be filled in by developers, but rather an affiliate on ramp team. (Essentially a team of Sales staff).
    What I am looking into now, is to store the additional metadata on an affiliate folder as JCR metadata, which I have successfully done, but only by generically customizing the properties for folders/images. Ie, for folders, right click -> properties.
    You can add additional items to the basic properties tab by adding the relevant component nodes to /libs/foundation/components/primary/sling/OrderedFolder/tab_basic/items, even add entirely new tabs by creating a new node at the /libs/foundation/components/primary/sling/OrderedFolder level (i.e. myTab) and then specifying it in the dialog /libs/foundation/components/primary/sling/OrderedFolder/dialog/items/tabs/items
    The problem is that the tab/extra question fields will be universally displayed, and are not folder dependant, so they appear in every folder context.
    What I would love to do, is to have it so that if you access http://localhost:4502/damadmin#/content/dam/affiliate/affiliateA you get your newly customized options/panels etc, but if you were to view properties on http://localhost:4502/damadmin#/content/dam/affiliate you would not get any additional questions being asked.
    Any help would be greatly appreciated.

    Recently there was a similar discussion internally & suggestion came from group was
    1.    Create & confiure an acl.
    OR
    2.    using Listener on the particular field you want to hide and then hide the field based on the path. To do this, create a listeners node of type nt:unstructured under the field  (e.g. /apps/dam/content/asseteditors/image/jpeg/formitems/person/listeners) and set the beforeloadcontent property to [1]. This will hide this field for assets under /content/dam/geometrixx. You could adjust this to meet other requirements.
    Verify 2 & let us know how it goes.
    [1]  function(f, r, p) { if (p.indexOf("/content/dam/geometrixx/") == 0) { f.hide(); } return true; }

  • Custom Parameters

    Hi All,
    Did any one worked on "Custom Parameters"?
    How to use it, and for what is the use of it?

    praveen Jr,
    These parameter is basically to change the default query execution properties for the universe, like inserting a hint for oracle to change from Cost base optimizer to a Rule based optimizer or a Connect Init for a init parameter while connecting to a database..
    The values will be very database specific .. to use these all you would need to do is create a new entry and then define if its a Hint or a ConnectInit in the name and then assign the hint value in the value. 
    To know more about what are the Hints that you can use in orcale refer the link below... Remember its a very database specific thing..
    Optimizer Hints
    here is a sample hint
    ALL_ROWS
    The ALL_ROWS hint explicitly chooses the cost-based approach to optimize a statement block with a goal of best throughput (that is, minimum total resource consumption).
    Value : /*+ ALL_ROWS */

  • Error while accessing secure store: File "SecStore.properties" does not exi

    Hi ,
    I have a java desktop application, and i am trying to get a connection from a datasource deployed on one SAP AS Java, I can get the datasource succsfullly but when i try to get a connection from the DS, it throughs this exception, I put the secstore..properties file in the classpath even after that it is not happy,
    any solution/hint/light please!!!!
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "SecStore.properties" does not exist although it should..
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:226)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:197)
         at com.sap.customcode.ConflictingActionFixture.(ConflictingActionFixture.java:53)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at fit.FixtureClass.newInstance(Unknown Source)
         at fit.FixtureLoader.instantiateFixture(Unknown Source)
         at fit.FixtureLoader.instantiateFirstValidFixtureClass(Unknown Source)
         at fit.FixtureLoader.disgraceThenLoad(Unknown Source)
         at fit.Fixture.loadFixture(Unknown Source)
         at fit.Fixture.getLinkedFixtureWithArgs(Unknown Source)
         at fit.Fixture.doTables(Unknown Source)
         at fit.FitServer.process(Unknown Source)
         at fit.FitServer.run(Unknown Source)
         at fit.FitServer.main(Unknown Source)
    Caused by: com.sap.security.core.server.secstorefs.FileMissingException: File "SecStore.properties" does not exist although it should.
         at com.sap.security.core.server.secstorefs.StorageHandler.openExistingStore(StorageHandler.java:372)
         at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1946)
         at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:802)
         at com.sap.sql.connect.OpenSQLConnectInfo.lookup(OpenSQLConnectInfo.java:783)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:209)
         ... 18 more
    caused by

    the SecStore.key file was not there, I changed the passwd and checked the 'Encryption' on, after that my sever instance is not starting.
    Any idea?
    -Puneet

  • HT204266 I am US apple Store customer, how can i download an app from Indian apple store

    I am a US Apple store customer. Now i am in India. I need to download an app 'Imobile', when i trying its saying that its not available on US store you need to switch to India store, when i say yes to switch, and try to install its saying Your account is not valid for use in Indian store. How can i do install this App. Plesae help. Thanks

    You would need to set up a new account. In order to have an account in the Indian App Store, you need 1) a valid billing address in India, 2) a credit card billed to that address or gift card purchased in India and 3) to be physically present in India at the time of purchase.

  • An OS-Intergrated place to store per-user application configuration files.

    A Chairde,
    I'm developing an application that could be deployed on multiple platforms. I'm looking for a location to store per-user configuration files in a OS-integrated way.
    I use a utility class to determine the OS of the users machine. I know from experience that Windows NT5+ likes to store per-user settings/configurations in the %APPDATA% path (which is usually C:\Users\<username>\Appdata\Roaming\<vendor>\<software> etc.) I'm using a call to the environment labels to determine it's location.
    I'm a linux user myself, so I'm aware that most UNIX based Operating Systems like to store personal configurations in hidden folders in the user's home directory (ex /home/<username>/.<application> etc.), Obviously, I'm using a call to the system property user.home to determine that location.
    My Question is in relation to Mac OS and Mac OS X, where would it be a safe location to store per-user configurations? I know OS X is BSD/UNIX based so is it safe to assume to store them as a hidden subfolder of the user.home directory? What about Mac OS classic? Where are per-user settings stored, or is it like Windows 9x and NT4 and lacks proper multi-user setups (although NT4 is somewhat more prepared then 9x) ?
    It would be much appreciated if anybody has any ideas.
    Is Mise,
    Seán Mac Aodha
    PS. I'm not using Javas Property files etc. I've rolled my own exchangeable format for storing key,value pairs.

    I've used databases in the past to store local files but clients have sometimes run into trouble when the database daemon goes down or doesnt start-up normally because of a "improper" shutdown etc.
    In my own implementation of "Settings Files" i have serialized hashtables marked with appropriate metadata stored to the users "application data", a backup or original copy of those settings in the common directory shared by my application framework and then in a networked enviroment, the Settings can be hosted on a database server, so the user can travel between client machines and keep their settings (and files) with them.
    I have, with a bit of googling, come across the most obvious page i should have looked at in regards to Apple Mac OS X
    http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html
    According to Apple's guidlines, the most suitable place to store User configuration files is in the ~/Library/Application Support/<Application Name> directory.
    and for System-wide configuration files, /Library/Application Support/<Application Name> rather then storing them with the application in the /Applications directory.

  • How to pass custom parameters to the Notification message body in a process

    Hi All,
    We are migrating from ORACLE workflows to Oracle OWB process flows as part of upgrade to Oracle 11g R2. Earlier in workflow notification mesages we could attach custom attributes (eg X_NAME) and reference the custom attributes in the notification message body (&X_NAME) to dynamically build the message body as per the custom attribute values.
    I tried to add a cutom parameter X_EMAIL_ID to a OWB process notification activity and trying to pass it to the notification message body by giving the value "This message is from &X_EMAIL_ID" in TEXT_BODY. But when I get the notification message it shows only "This message is from" and it does not show anything about X_EMAIL_ID.
    Please advise Please help us if anyone have used any workaround to dynamically populate the TEXT_BODY in a notification activity based on custom parameters.
    Thanks and regards,
    Shankar

    Hi David,
    Thank you for your suggestions. When I try to bind the variable to the notification activity parameter TEXT_BODY I get this error - VLD-10035: The value of parameter TEXT_BODY in a NOTIFICATION activity must be a literal value, bindings or expressions are not allowed. It looks like the text_body can have only literal values. Could you please advise if you received any such error or how could you resolve them.
    Thanks and regards,
    Shankar

  • 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

  • How to find custom parameters and its values?

    Hi,
    Please let me know how to find the list of custom parameters with its possible values and its use in programs?
    Thanks.

    There is no validation for the values that can be input so you can put anything in the value field. For example, try "BUK" and
    then a value for a company code you know does not exist.
    When you run a transaction with that it will default that value.

Maybe you are looking for

  • IPhone and windows system recovery

    hi i have an iphone and i did a system recovery recently (windows xp) and i was wondering if when i connect to itunes to sync it says delete all files. will it delete my photos, contacts and notes and music or just my music

  • Stock transfer with delivery in purchasing Problem

    Hi Gurus, I have perform all points needed to be done (as mentioned in Note 498143), Note 498143 : 1. You must assign a delivery type to the purchase order document type/supplying plant combination. You can do this in the IMG for purchasing under "Pu

  • How to get Swings output in HTML?

    HI, I am very new to Swings Technology. I know how to display an applet in HTML page. But the Swing I am using is a stand-alone program which displays the Tree Stucture of a selected Directory. I am able to run my Swing program as a stand-alone progr

  • Using External Library in Mobile Web Dynpro Offline

    Hi all, i would like to use a jar in a Mobile Application for Handheld and i followed the steps from the wiki "Using External Library in Mobile Web Dynpro Offline" at https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/usingExternalLibraryinMobil

  • Problem using PS Elements 10, editing photos

    I purchased my PS Elements 10 from a store. I set it up and got my serial number from using the redemption code. When I access the PS for photos and choose editing, I keep getting the PS Elements trial...I purchased the darn products why does it keep