Preferences API plus Linux. Saving entries system wide.

Hi:
I hope you know a little more about this than I do:
I want to (one time) write a key-value pair into the Registry (Windows) / the according xml file (Linux).
Since this entry should be available for all users, I used the following line to save it system wide:
Preferences prefs = Preferences.systemRoot().node(this.getClass().getName());
In the Windows Registry it can be found here:
HKEY_LOCAL_MACHINE/ SOFTWARE/JavaSoft/Prefs
Under Linux the prefs.xml file which contains the key value pair can be found here:
/etc/.java/.systemPrefs/_!':!.../prefs.xml
But, in order to create this file under Linux I had to temporarily change the access rights of the directory "/etc/.java/.systemPrefs" plus the two files inside this directory (".system.lock" and ".systemRootModFile") to 777.
Afterwards I executed my Java program which set the entry I am talking about.
At the end I set back the access rights of the ".systemPrefs" directory plus the two files mentioned above.
The file prefs.xml has the following access rights:
-rw-r--r--
So, everyone has at least read access (which is great).
My question:
- Since other people should use this program in the future too: is there an easier / better way to set system wide preferences?
For an answer thank you very much in advance.
Joey

Hi jschell:
Thank you for your answer.
The way you describe it is exactly how it is done till now.
My task is to find out the way to do it using the Properties API plus solving potential problems (like the one described above).
I just took a look at my question again. I wrote "Since other people should use this program in the future too: is there an easier / better way to set system wide preferences?".
What I wanted to ask is: "Since other people should install this program in the future too, is there an easier / better way to set system wide preferences (by using the Properties API)?"

Similar Messages

  • How remove saved system-wide default for a column

    yesterday I saved a system-wide default for a column with a custom column heading and data format.
    now, when I drag this column in a new analysis, obiee shows no column heading.
    I've tried to save my custom default again or reset to column-default but with no results: the column heading is still empty.
    How can I fix this problem?
    thanks
    Luc

    Hello,
    What OBI version are you using?
    Enter some other custom name for the column (e.g. same as default one) and save it as system-wide. I guess, you have already tried, but...
    1. Stop Presentation Services.
    2. Go under web catalog in the file system and locate folder \root\system\metadata. This folder contains files storing subject area attributes, including system-wide settings. I the folder find 2 files named similar as the subject area which column you have modified (name will be in lowercase, spaces replaced with +). For example, for "SA System" subject area these files are named as "sa+system" and "sa+system.atr".
    3. Backup these 2 files you have found (better whole presentation catalog).
    4. Try one of the options:
    Option 1: If you have another version of these files (in the backup or other environments) - try to replace them. There is a risk you will loose some other column settings (or inherit new).
    Option 2: Modify the file without extension (it contains XML code inside): locate the string similar to your column name. Remove whole section ONLY for the column you have found between tags <sawsavedformat:columnSavedFormat and </sawsavedformat:columnSavedFormat>.
    Below is sample code for column originally named as "Pager" under "User" folder in "SA System" subject area.
    <sawsavedformat:metadata xmlns:sawsavedformat="com.siebel.analytics.web/savedformat/v1.1">
    <sawsavedformat:columnSavedFormats>
      <sawsavedformat:columnSavedFormat xmlns:saw="com.siebel.analytics.web/report/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sawsavedformat:regularColumnSavedFormat" columnName="&quot;SA System&quot;.&quot;User&quot;.&quot;Pager&quot;">
       <saw:displayFormat><saw:formatSpec suppress="suppress" wrapText="true" hAlign="left" vAlign="top"/></saw:displayFormat>
       <saw:tableHeading><saw:caption fmt="text"><saw:text>User</saw:text></saw:caption><saw:displayFormat/></saw:tableHeading>
       <saw:columnHeading><saw:displayFormat><saw:formatSpec/></saw:displayFormat><saw:caption fmt="text"><saw:text>Pager New</saw:text></saw:caption></saw:columnHeading>
      </sawsavedformat:columnSavedFormat>
    </sawsavedformat:columnSavedFormats>
    </sawsavedformat:metadata>
    Option 3: Just remove these 2 files. Naturally, you will loose all the settings, not only one you like to get rid off.
    5. Restart presentation services.
    Hope, this helps.

  • Unable to save column as system wide default

    Hi All,
    I am in 11.1.1.1.6, I am trying to the save a column as system wide default in 11g but my changes are not getting saved or reflected?
    This is what I did using the "weblogic" user name and password
    1. Pulled a column EmpName in the criteria
    2. Added an action link to that column, which points to another dashboard page Page1
    3. Saved as system wide default by clicking on save as system wide default for "EmpName"
    4. Restarted the presentation services.
    Now when again logged in, and selected that column in my request, what I expect to see (when I run the request and go to results) is that navigtion applied on this column which will take me to the dashboard page Page1.
    But this is not happening, What is that I am missing? Can anybody please let me know
    Thanks,
    Ronny

    Thanks Deva for your reply, I don't have access to Oracle support, I'll have to go back to my client saying that this is a bug,
    Can you please confirm that this bug which you mentioned is related to not being able to save the column properties as system wide default in obiee 11.1.1.1.6.0 version?
    Also what i just found online is that this bug was fixed in 11.1.1.1.6.2? Can you please confirm this?
    Thanks,
    Ronny

  • System wide preferences

    Hi,
    I was wondering if it is possible to make preferences that I currently have for one user on my computer system wide, so that all other users have the same setup. Ie, I don't have to setup "tap mouse pad, instead of press button" for all users independantly.
    My thinking is that on my work computer I have multiple desktops, and it would be nice to have multiple users set up which works in kind of the same way.
    If it isn't possible to set it so that the setup and preferences are not system wide, which group of files need to be copied, and would this work?
    Thanks

    There are multi-desktop solutions for Mac too.
    Most linuxes have this: inside your account you have 4 screens; and you can put applications on different screens.
    A quick google turned up:
    This one is alfa, but works: http://desktopmanager.berlios.de/ (freeware)
    Seems complicated: http://www.codetek.com/ctvd/ (shareware)
    And a macosx hints discussion: http://www.macosxhints.com/article.php?story=20030423140625302

  • ICloud mail settings not saved in System Preferences on Mountain Lion

    I note that iCloud mail settings not saved in System Preferences on Mountain Lion even if I tick mail in Icloud then close system preferences then open system preferences and it is untiked again?
    Does anyone know how to fix this?
    Cheers
    Paul

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Preference Pane for system wide audio EQ? (2 yrs later)

    I fully agree with the quoted message underneath.
    *"Is there some sort of universal Equalizer I can apply to all my audio? A Preference Pane would be great! I listen to an internet radio client (XM Radio) that doesn't have any EQ control.*
    *I know Audio Hijack can do this. But I'd rather not run a whole other application on top of the radio client just for EQ."* (original post from Feb 20, 2007 5:07 PM)
    I can't believe that almost 2 years later, there is still no system wide equalizer in OS X, working always, like, while watching YouTube or whatever. Yes, I know there is Hear now, but both apps, Hear and Audio Hijack Pro, are expensive and overkill for the simple ability to change some equalizer settings. A preference pane would be much better.

    I found a system wide EQ along with mixer and many other functions it works great its called Hear this is the web sight http://www.joesoft.com/products/hear.php

  • Preference Pane for system wide audio EQ?

    Is there some sort of universal Equalizer I can apply to all my audio? A Preference Pane would be great! I listen to an internet radio client (XM Radio) that doesn't have any EQ control.
    I know Audio Hijack can do this. But I'd rather not run a whole other application on top of the radio client just for EQ.

    I found a system wide EQ along with mixer and many other functions it works great its called Hear this is the web sight http://www.joesoft.com/products/hear.php

  • Urgent Assistance Needed:  All Documents deleted after setting system-wide viewing preferences for Finder

    I got myself into some trouble...
    Following the guide here to force a default Folder view to sub folders:  http://apple.stackexchange.com/questions/10488/system-wide-finder-view-preferenc es
    Which is:
    There is a simpler way.
    In the Terminal, navigate to your $HOME directory: cd ~
    Remove all the .DS_Store files:find ~ -name ".DS_Store" -depth -exec rm -f {} \;
    Relaunch finder going to: Force Quit → Finder
    Set your global preferences using ⌘J and press the Use as default button.
    Now, every folder you open or create will have the new settings.
    I now have the existing Folder structure in tact for Documents, but every single file is gone (in my entire Documents directory).
    Naturally I'm thinking two things:
    1)  Oh no.  I knew better than to go down this path without knowing exactly what I was doing.
    2)  How do I "get my files back..."
    I'm not sure if they're just not viewable or if they were deleted.  Essentially everything I've configured on the machine (From Apple login to mouse scroll reversal) has been undone.  I don't have TimeMachine set up yet - I brought two remote hard drives to work today to get it done but they're both NTFS so I couldn't progress. 
    I'm reasonably technical but new to Mac. 
    Advice is greatly appreciated... I'm GREATLY distressed at the moment...
    <Edited by Host>

    Ok so "DS_Store files are used by Mac OS X to store folder specific metadata information."  Supposedly they get recreated... except I didn't get a nice smooth transition of newly created invisible, instead every file on my machine is "gone."

  • Set system-wide Finder view preferences

    I know that .DS_Store files are created in every directory I enter with the finder in Mac OS X, and that keeps track of the folder's metadata (including how is it being displayed). I also know that this command:
    sudo find /Users/[USERNAME]/ -name ".DS_Store" -depth -exec rm -f {} \;
    ... will recursively delete all .DS_Store files insite the /Users/[USERNAME]/ folder.
    Also, I know that when pressing CMD+J inside a finder window, selecting the configuration I want (40x40 icons, small-medium grid space, arrange by kind, text size 10px, show item info, show icon preview, background white) and selecting "use as defaults" will.. well, make it the default, and holding OPT will restore it to THAT default.
    The thing is that, when I create a new folder, it doesn't take those parameters. And the folders that HAD .DS_Store files deleted keep that previous configuration, not the "default" one.
    What can I do to set a system-wide, consistent finder look?
    I'm on Mac OS X 10.6.6.

    Hi,
    I think I remember a similar problem in Tiger yonks ago. I recall the solution was to make all the changes to the Finder whilst in an Admin account - this way the choices stick for all windows?
    Worth a shot.
    S.

  • System Wide Keyboard shortcuts

    F5 on my macbook (in any application) opens a 'Quick Task Entry' window.
    ( I am not sure where this behaviour comes from but I suspect it was from one of any number of apps I have tried out over the years).
    I would like F5 to do nothing.
    In the System Preferences>Keyboard & Mouse>Keyboard Shortcuts, there is no 'mention' of F5 and this action. Other applications (like Things) also create System Wide shortcuts that do not show up in this window.
    How can I change this F5 behaviour?
    Thanks.

    Thanks Tim, you're a genius. That gave me the clue.
    The new user 'test' does not have the F5 behaviour problem.
    Therefore I checked through my list of login items, and found that it was 'Contactizer Pro' that used F5 to add a Quick Task.
    Changing that default stopped the problem.
    (The reason this is an issue is that I have a new Kensington Wireless Presenter, and it appears that pushing the laser pointer button also sends an F5 keystroke (for some reason)- which would stop my Keynote presentation and open the 'Quick Task' window!)

  • Preference API in windows when registry is blocked

    Hi All,
    I have a requirement to save the user preferences of a swing based medical application at the user end and the Preferences API seemed clean to fit the bill.
    However after going live, we found that some workstations have been denied user access to the registry. In such cases the entire application seems to fail. Please suggest some way out. It is exteremely important as we have already gone live with the software in place and some doctors may not be able to use the system. For the time being I could start using a properties file as a back up and storing using the random-access file api. Please help......
    Thanks in advance,
    Zeus

    A cursory look at the Preferences.java source leads me to believe that it should be possible to change where the values are stored. This code interrogates the os.name and chooses either the Windows Registry or something else (I assume a file it creates.)
    // 3. Use platform-specific system-wide default
    String platformFactory =
        System.getProperty("os.name").startsWith("Windows")
        ? "java.util.prefs.WindowsPreferencesFactory"
        : "java.util.prefs.FileSystemPreferencesFactory";
    try {
        return (PreferencesFactory)
         Class.forName(platformFactory, false, null).newInstance();
    } catch (Exception e) {
        InternalError error = new InternalError(
         "Can't instantiate platform default Preferences factory "
         + platformFactory);
        error.initCause(e);
        throw error;
    }You should be able to subclass this class and change so that the Registry isn't used.

  • Accessing the Admin API via Linux (and hopefully Python)

    I have been looking through the available documentation and past forum
    entries but I see nothing really on point.
    It is possible to have a complete GW system on Linux, from server to
    client. So if it is possible to administer a GW system from Linux using
    Console One, it should be possible to access the API from Linux.
    Can anyone point me towards the appropriate documentaion? Thanks
    Bob

    Bob Brandt wrote:
    > Michael Bell wrote:
    >> Yes, but there is no admin API exposed for Linux. Period.
    >>
    >> SOAP can do message store or address book related stuff. And some client
    >> option stuff. It cannot create/delete/rename users, or do most things
    >> Admin API (Win32 only) can do.
    >
    > That is very disappointing. So even though I can have a completely
    > non-M$ system, pride myself on not sending a cent to Redmond; Novell is
    > forcing me to use their competitor's (M$) inferior OS. Even the GW API
    > Gateway is not really supported anymore!
    >
    > Thats seems stupid and udderly backwards, in other words typically Novell!
    >
    > Bob
    All a matter of resources, Bob. They've had an admin api under
    development for years, just didn't have time to make it ready for Bonsai.
    You are correct, however you must have a win32 box (or try wine, but I
    doubt that's worth it). One friend of mine then wrappered the whole
    thing in a SOAP service, so he could mostly avoid thinking about windows.

  • Set system wide default mailto url

    I'm trying to configure system wide settings in linux so any new user will apply for this settings.
    I want register my zimbra server with mailto links.
    I've found some information here:
    http://www.zimbra.com/forums/general-questions/48547-how-control-mailto-selection-firefox.html
    but this must be performed by the user and I want to be preconfigured.
    I also tried to play with mimeTypes.rdf, but it seems that there's no system wide mimetypes file. is just created when users changes something.
    how can I setup that setting system wide?

    I've found a partial solution.
    create an application file, for example '''/usr/share/applications/zimbra.desktop''' with this content:
    [Desktop Entry]
    Icon=mail-message-new
    MimeType=x-scheme-handler/mailto;
    Name=Zimbra
    Comment=Zimbra
    Exec=xdg-open https://my.zimbraserver.com/zimbra/?view=compose&to=%u
    Type=Application
    X-XFCE-MimeType=x-scheme-handler/mailto;
    then modify file '''/etc/gnome/defaults.list''', find and substitute '''x-scheme-handler/mailto''' with filename you just created:
    ''x-scheme-handler/mailto=zimbra.desktop''
    the caveat is only works with unity, if you use another wm probably won't work

  • Change the background colour of windows system-wide? (non B/W)

    I have difficulty reading on a white background, but find the White on Black theme doesn't work for me either. The background colour which works best for me is #F9EEE2;. I can work for nearly twice as long in a window with that background colour.
    So I prefer apps which allow me to change the background colour of their windows (e.g. [PathFinder|http://www.cocoatech.com>, [iTerm|http://iterm.sourceforge.net>, [Journler|http://wiki.journler.com/index.php?title=Main_Page], [OmniOutliner|http://www.omnigroup.com/products/omnioutliner>, [BBEdit|http://www.barebones.com/index.shtml], [TranslateIt|http://mac.gettranslateit.com>). I'll pay for this feature.
    However, I often don't have the choice. For example, [PoEdit|http://www.poedit.net/index.php] is the only OSX-native gettext .po editor (since Snow Leopard killed Cocoa-Java and thus [LocFactoryEditor|http://www.triplespin.com/en/products/locfactoryeditor.html]) , so I have to use it. I asked the developer if he could add a preference to change the background colour of the window (PoEdit is Carbon). He replied that this sort of preference should be system-wide, shouldn't it?
    From the Linux POV, yes, it should. Do we have that sort of option in OSX Snow Leopard? Previous OSX theme apps ShapeShifter and Mystique are respectively not yet compatible with OSX, and not available any more. I had a look at [ThemePark|http://www.geekspiff.com/software/themepark> (which does support 10.6), but don't know where to start in editing resource files. So what are our options for changing window background colour system-wide? (Or is there a Carbon plugin or library the PoEdit developer could use to embed that preference for his app.?)
    Thanks for any help you can offer with this.

    I asked a similar question before...as far as I know, there is no option to change this system-wide...short of creating a new color profile or using some hidden Terminal command.

  • Preferences API

    Just a small question: I'm using the preferences API to store settings. I just looked around, but I didn't find where these preferences are saved... I mean in what file!
    Can anyone give me a small hint????
    Thnks a lot!

    It is in the users directory. On windows try looking for the env var HOMEPATH at the command line.
    If you print out the system environment in java it is in there as well (although the name is different.)

Maybe you are looking for

  • Not able to view data and song folders/files in my ipod

    Hi All, I have a 30 GB Video iPod which I have been using since the past 6 odd months. Recently, my iPod was infected with a virus. I managed to clean up the virus but since then I am not able to view the data and song files or folders stored in the

  • Summit Sporting goods schema

    Dear all I am in urgent need of Summit sporting table scripts and the sample application code (FMB files). Can anyone help me in getting the same. Thanks in advance BR MM

  • PhotoShop CS6 date on saving a jpeg

    When I am editing  document and save it as a JPEG the date and the time of the jpeg are not the current date/time.  What do I need to do to change this behavior? I would rather that the new image have the current date/time on the file. Thanks, Mike

  • How do I update from 10.6 to 10.6.8?

    How do I update from 10.6 to 10.6.8? I downloaded the 10.6.8 Update v1.1, but it said I need 10.6.7 or higher. I'm hoping I don't need to update one, by one, by one to .1 .2 .3 .4 etc to 8. Thanks!

  • Lenovo thinkpad T540P backlit keyboard swap

    Hello, I intend to buy lenovo thinkpad T540P, part number 20BE003AUS. Does the motherboard support backlit keyboard? Can I buy the backlit keyboard and swap it with the old one? Thanks,