How to input the right path that i need in miscellaneous files folder

i have this sample code
public class image extends JFrame
private JLabel statusBar = new JLabel();
private JMenuItem menuFileExit = new JMenuItem();
private JMenu menuFile = new JMenu();
private JMenuBar menuBar = new JMenuBar();
private ImageIcon imagedoc = new ImageIcon(button.class.getResource("help.gif"));
private JButton buttondoc = new JButton();
private JPanel jPanel1 = new JPanel();
it works but i used the pictures in the file that is already with the jframe.
i want to add other image, i've already add them on my project but my problem is it is located to another folder. the miscelleanous files folder. if i used the same code, there are errors.
i want to know the right path in how i can use those images in that folder.
thanks in advance
pls reply as soon as possible... i really need this one.

Hello,
I think the way to make your images/icons work in your jclient app,
is to use such a code (test it):
Class c = Class.forName("YourList.YourListWindowFrame");
java.net.URL testt = c.getResource("create.gif");
ImageIcon imageCreate = new ImageIcon(testt);
if ( imageCreate != null)
buttonCreate.setIcon(imageCreate);
But this only works if you copy your icon (create.gif ) into your class directory
YourList/classes/YourList. This is if your output directory in your project Settings
is set to YourList/classes and the package is YourList.
Even if your additional class path is set to YourList/classes and you try to set
your additional class path to YourList/icons, your icons are not found.
It looks like JDeveloper is only looking in your output sub directories.
When you build your application, your gif files are "copied" to your output directory:
YourList/classes.
So, you will have to manually put the icons in your class/packages to make this work.
The idea is that the image files need to be in the same dir as the Java
class file that loads them. Therefore, the best way to do that is to have
an ImageLoader class that is in the same folder as the images one:
public class ImageLoader
public ImageLoader()
public ImageIcon getImageIcon(String name)
return new ImageIcon(getClass().getResource(name + ".gif"));
and would be called like this:
mButtonButton.setIcon(imgl.getImageIcon("JButton"));
http://otn.oracle.com/sample_code/products/jdev/jclient/jclient_binding_demo.html
There you will find a jClient Component Demo that has this code you can use.
(its a pretty cool and extensive demo ... he can look at files ImageLoader.java
and StartFrame.java to see how that particular coding is done.)
Reference:
I don't how much help that can be for you, but here is an interesting Metalink note :
Note 130302.1
"Sample JSP Code: Directory and File Browser Implemented with Custom Tag Library"
Regards,
Steff

Similar Messages

  • How to find the exact package that I need?

    How can I find the exact package that I need, for example, in Ubuntu, I can add launcher in System -> Preferences -> Main Menu, but in Arch, I can not find this Main Menu, I know I need to install something, but don't know where to go?

    Ghost1227 wrote:depends... where are you now?
    LOL
    pacman -Ss <package-name>
    would help you out. You can also put in part of the name and it will return all the matches. As for a GUI -- you don't get that by default in Arch.
    There is a GUI wrapper for pacman called shaman, but iirc, it uses kdelibs and integrates well with KDE. It looks like you are using Gnome, but you can use shaman in Gnome too.

  • How to create the right path depending from Os

    Hi all,
    I should do a simple thing
    1. Get a dir by a filechooser
    2. Get a dir by another filechooser
    3. Extract all files' name by 1.
    4. Append every filename from 3. to 2.
    5. 4.toString()
    I have problem in 4. Becouse if I append them as Strings I've to add a separator character between dir an filename. This char id \ under Windows and / under linux. Is here any way to concatate a filename and a dir indipendently from filesystem?
    This is the current version that work only on Windows:
                final JFileChooser fc = new JFileChooser();
                fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                fc.setDialogTitle("Select Source Folder");
                returnVal = fc.showOpenDialog(this);
                File file = fc.getSelectedFile();
                final JFileChooser fc2 = new JFileChooser();
                fc2.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                fc2.setDialogTitle("Select Destination Folder");
                returnVal2 = fc2.showOpenDialog(this);
                File file2 = fc2.getSelectedFile();
                if (returnVal2 == JFileChooser.APPROVE_OPTION &&
                    returnVal == JFileChooser.APPROVE_OPTION) {
                    File allFiles[] = file.listFiles();
                    for (int i = 0; i < allFiles.length; i++) {
                        if (allFiles.isFile()) {
    Mp3s mp3file = new Mp3s(allFiles[i].getAbsolutePath().
    toString(),
    file2.getAbsolutePath().
    toString() +
    "\\" + allFiles[i].getName());
    Mp3 is a class that gets 2 strings (1st_path/filename, 2nd_path/filename)
    or (1st_path\filename, 2nd_path\filename) depending from OS and that's the dial
    Hope everithing is clear.
    Tnx in advance
    Ciro

    The forward slash should be used, regardless of the platform. The only time this may not work under Windows is if you actually pass the string outside of the Java process. But things like:
    File x = new File("/some/directory/somefile.ext");
    should work under all OS environments. Under Windows, the above will reference whatever the current drive is (C:, for example), so it would resolve to c:\some\directory\somefile.ext when all is said and done. Java takes care of the conversion for you.

  • How to balance the right/left channel of a single audio file?

    Hi, this might be an easy procedure but I cannot wrap my head around the following problem - an audio file, that I use as background music in one of my sequences, has uneven right and left channels - they need to be leveled.
    How can i do this in PrPro or Soundbooth? I prefer to edit the channel levels of the original file before importing it into my composition. I work with CS5. So far, I've managed to level the R/L chanels by using the 'Balance' knob in the ProP "Audio Mixer" tab . The problem with this method is that the balnce knob adjust the balance of all audio files sitting on the same sound track, whereas I need to adjust the balance of only one of them. Many thanks.

    There is a Balance effect as well.

  • How to get the complete path of the file that is selected using FormFile

    i m working on struts..
    i hv used FormFile like
    <html:file property="xsdpath" value="Browse" />
    need to get the whole path that i will select using browse button
    for example d:\foldername\filename.java
    but FormFile Api has a method getFileName(); which returns the filename, for getting the absolute path wat has to be done.
    please reply bak soon
    thanks in advance

    here i use formfile <html:file> just to allow the
    user to select a xml file .
    so i need to get the whole path of the selectedfile
    to parse the xml file.No you dont.
    You would definitely benefit from further reading on
    file upload.
    <html:file> tag renders an HTML <input> element of
    type file.
    When a user uploads a file, this file is sent as a
    stream of data, which a program (jsp/servlet) on the
    server, reads and stores the data back in the form
    of a file on the server.
    Any server program that needs to parse the file,
    should do so on the file stored on the server.
    There's no point in knowing the absolute path of the
    file on the client machine. If a server program can
    parse a file on the client machine, why upload the
    file in first case ? Get the drift ?
    i also want to show my user the path he hadselected.
    If you have such a requirement, then yes.
    But it sounds weird to me. If you see my response
    above, you will realize that the server has a copy of
    the client's file uploaded and then parsed. What if
    the client has changed his file after upload ?
    cheers,
    ram.I also have a requirement to get the whole filepath of the file selected and place this information into a table. From FormFile I can only retreive the absolute filename
    Any suggestions would be helpful.
    Thanks, dam

  • I use aperture 3 since a long time. Using slit viewer, now the bigger image become bigger then the given space and shifted to the right, so that I can't see the complete picture anymore. And I also don't see the last few picture in the strip below. How ca

    I use aperture 3 since a long time. Using slit viewer, noe the bigger image become bigger then the given space and shifted to the right, so that I can't see the complete picture anymore. And I also don't see the last few picture in the strip below. How can I splve this problem?

    This lloks like your preferences file might have become corrupted.
    you probably have a problem with corrupted user preferences.
    Remove the Preferences: Remove the Aperture's user preferences from the User Library as described here:
    Aperture 3: Troubleshooting Basics   http://support.apple.com/kb/HT3805
    Note:Your User Library is hidden by default in 10.7.x or later - to open it in a Finder window use the "Go" menu from the Finder's main menu bar.
    Quit Aperture, if it is running. Log off and on again.
    Open the user library by using the Finder's "Go > Go to Folder" menu and hold down the options-key, until "Library" appears in the drop down menu. Select it.
    In the widow that will open, scroll down to "Preferences"
    From the "Preferences" folder  remove "com.apple.Aperture.plist".
    Then try to launch Aperture again.
    But deleting the "Preferences" file will cause Aperture to forget the preferences settings. Be prepared to have to reset all options you set using the Aperture Preferences panel.
    Regards
    Léonie

  • Dear all, I found that I can't upload attach to yahoo or gmail using firefox5 as it keeps asking me the authen.. I input the right uname&pwd, the attach stuck. It works fine on IE.. Thanks for help!!!

    I found that I cannot upload any attachment to yahoo or gmail using firefox 5 as it always keep asking me the authentication. Even I input the right, the attachment stuck. It works fine on IE.. Thanks!!!

    Look here:
    http://discussions.apple.com/thread.jspa?messageID=10609826&#10609826

  • How do I preserve the embedded hyperlinks when printing to .pdf?   I am using Acrobat Pro XI for Mac, and when I export to .pdf the existing hyperlinks lose functionality.   I assume it's just the flick of the right button – I just need help finding that

    How do I preserve the embedded hyperlinks when printing to .pdf? 
    I am using Acrobat Pro XI for Mac, and when I export to .pdf the existing hyperlinks lose functionality.   I assume it’s just the flick of the right button – I just need help finding that button. 
    Can you help?  Thanks!

    How:  MS Word to .pdf by Command P, hitting the PDF button, and then the button for "save as Adobe pdf"
    I didn't have this problem at all on prior versions of Adobe on my PC.   This isn't a Mac attack, is it?

  • $20 to anyone who can help: (I think) how to send the right cookie info

    Yes, we're so befuddled and stumped that we are willing to pay $25 by Paypal or any other method (check, money order) to the first person who provides us with a concrete solution that allows us to read this page through a Java application:
    http://s1.amazon.com/exec/varzea/subst/your-account/your-open-marketplace-items.html/104-3907538-7794313
    The problem (we think) seems relatively simple: how can we pass the correct cookie to a server? We want to search our merchant web pages on amazon.com (and perform other operations, but for the purposes of this problem, just assume we want to read the above web page). We wrote a variation of a webcrawler which works fine on most web pages. However, the Amazon web pages we want to crawl (i.e., http://s1.amazon.com/exec/varzea/subst/your-account/your-open-marketplace-items.html/104-3907538-7794313) require you to sign in first (otherwise you get redirected to http://s1.amazon.com/exec/varzea/subst/your-account/your-won-zshop-items.html/104-0793551-2976761). So we thought that this meant we had to figure out how to get our webcrawler to login first (we implemented the Java Almanac example for accessing password-protected URLs: http://javaalmanac.com/egs/java.net/Auth.html?l=rel). During the course of testing this out (the code seemed to work, though we still got redirected), we realized that the Amazon web page is not actually performing basic authentication (not asking for username/password), but instead seems (that is, seems to inexperienced us) to be looking for a cookie. We believe this because after we sign in to Amazon, we can access all our merchant web pages just fine without ever needing to log in, even if we turn off the browser (or computer). Also, if we try to access the web page after deleting all cookies, we again get redirected to the page requesting that we sign in.
    So we took a look at the Amazon cookie that was created after we signed in to Amazon (printed below), and then implemented the cookie-passing code from the Java Almanac (http://javaalmanac.com/egs/java.net/SendCookie.html). This seemed to have no effect:we still got redirected. We hunted around for other Cookie examples and found achase1's example from a previous forum question (http://forum.java.sun.com/thread.jsp?forum=54&thread=375956), which seemed to add a few HTTPUrlConnection.set's, but this also had no effect--our Java crawler still gets redirected to the page that requests that we sign in first.
    So we think that either we are somehow passing the wrong cookie information, or are just missing some critical HttpURLConnection setting or parameter.
    So, if you can tell us how to read the Amazon page that seems to require a cookie, and your explanation actually works (that is, we can read the page), we will send you $25 immediately--like so many others on the forum, we're frustrated and lost and need an answer that works!
    Here is the Amazon account information (naturally, this is a working dummy account on Amazon, not our actual account, in case you want to test your solution before posting it):
    username: [email protected]
    password: melville
    Here is the cookie that is generated:
    session-id
    104-3907538-7794313
    amazon.com/
    1536
    3382951936
    29569409
    1475475408
    29568127
    session-id-time
    1055491200
    amazon.com/
    1536
    3382951936
    29569409
    1475575408
    29568127
    ubid-main
    430-1017936-7312154
    amazon.com/
    1536
    2916341376
    31961269
    1482485408
    29568127
    x-main
    Z3yciaQAfpzN?CPFkzeRd8z1U2lWcoap
    amazon.com/
    1536
    2916341376
    31961269
    2005235408
    29568127
    Here is the extra-simplified version of our webcrawler, which simply tries to read (and print out) the web page:
    import java.net.*;
    import java.io.*;
    public class PasswordReader {
    public static void main(String[] args) throws Exception {
    // Try to access the page
    try {
         HttpURLConnection m_urlConn;
         URL url = new URL(args[0]);
    // Cookie passing code
         m_urlConn=(HttpURLConnection)url.openConnection();
         m_urlConn.setDoOutput(true);
         m_urlConn.setDoInput(true);
         m_urlConn.setUseCaches(false);
         m_urlConn.setRequestMethod("POST");
         // optrional
         m_urlConn.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; H010818)");
         m_urlConn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
         m_urlConn.setRequestProperty("Cookie" , "session-id=104-3907538-7794313;session-id-time=1055491200;ubid-main=430-1017936-7312154;x-main=Z3yciaQAfpzN?CPFkzeRd8z1U2lWcoap");
         m_urlConn.connect();
    // end cookie code
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        url.openStream()));
         String inputLine;
    // Read and print out the web page
         while ((inputLine = in.readLine()) != null)
         System.out.println(inputLine);
         in.close();
    } catch (MalformedURLException e) {
    } catch (IOException e) {
    Thank so much to anyone who even tries to help us!! We've been poring through the Sun forums, almanacs, and sample code all week without much evident progress. You'd really be making us very, very happy.
    Thank you,
    Ogi Ogas
    [email protected]

    "{[VERSION="0" ; NAME="session_id" ; VALUE="@@33f84622845133891a68ec0dffe9f620" ; DOMAIN="my.asu.edu" ; PATH="/" ; SECURE="false" ; EXPIRES="null"]}"
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The Cookie!
    <HTML><HEAD><!--set cookie-->
    <SCRIPT language='JavaScript'><!--
    document.cookie = "session_id=@@33f84622845133891a68ec0dffe9f620; path=/;";
    // Begin JavaScript
    if(!document.cookie) {
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    // Note: Opera and WebTV spoof Navigator.
    var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
    && (agt.indexOf('webtv')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
    (agt.indexOf("; nav") != -1)) );
    var is_nav5 = (is_nav && (is_major == 5));
    var is_nav5up = (is_nav && (is_major >= 5));
    var is_ie = (agt.indexOf("msie") != -1);
    var is_ie3 = (is_ie && (is_major < 4));
    var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
    var is_ie4up = (is_ie && (is_major >= 4));
    var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened. Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol = (agt.indexOf("aol") != -1);
    var is_aol3 = (is_aol && is_ie3);
    var is_aol4 = (is_aol && is_ie4);
    var is_opera = (agt.indexOf("opera") != -1);
    var is_webtv = (agt.indexOf("webtv") != -1);
    var intro_dir = "This installation of Blackboard 5 requires the acceptance of a cookie by your browser software. ";
    intro_dir += "The cookie is used to ensure that you <I>and only you</I> are able to access information in the courses, assessments, gradebooks and other features which are appropriate for you. <P>";
    intro_dir += "The system has been unable to place the cookie. This may be because cookies are disabled in your browser.<P> To enable cookies in your browser:<ol>";
    var nn4dir = "<LI>Select <I>Preferences</I> from your browser's Edit Menu. <LI>Select <I>Advanced</I> from the list in the left-hand pane of the dialog box. ";
    nn4dir += "<LI>Under the <I>Cookies</I> box, select either of the first two options ('Accept all cookies' or 'Accept only cookies that get sent back to ";
    nn4dir += "the originating server')<LI>Click 'Ok' to close the dialog box. ";
    var ie5dir = "<LI>Select <I>Internet Options</I> from your browser's Tools Menu <LI>Select the <I>Security</I> Tab, and click on the 'Custom Level' button. ";
    ie5dir += "<LI>Scroll down to the 'Cookies' Section, and select either of the last two options under 'Allow Per-Session Cookies (not stored)' - either 'Enable' or 'Prompt'. ";
    ie5dir += "<LI>Click 'Ok' to Close the Security Settings dialog box. ";
    ie5dir += "<P><B>NOTE</B> Depending on your institution's set-up of Blackboard 5, you may need to repeat steps 3 & 4 for more than one 'Security Zone'. ";
    ie5dir += "<BR>For example, if you are connecting from a computer inside the same firewall or network as the Blackboard 5 machine, you would select the 'Local Intranet Zone'. ";
    ie5dir += "<BR>If you are making a connection across the internet from another location, you would select the 'Internet Zone'. <BR>In some cases, you may need to do both.<P>";
    ie5dir += "<LI>Click 'Apply' and 'Ok' to close the Internet Options dialog box.";
    var ie4dir = "<LI>Select <I>Internet Options</I> from your browser's Tools Menu <LI>Select the <I>Advanced</I> Tab. ";
    ie4dir += "<LI>Scroll down to the 'Cookies' Section under 'Security', and select either the first or last option - either 'Prompt before Accepting Cookies' or 'Always Accept Cookies'. ";
    ie4dir += "<LI>Click 'Apply' and 'Ok' to close the Internet Options dialog box.";
    var browser_dir = "<LI>Please follow your browser's Help instructions for enabling Session (non-stored) cookies that are sent back to the originating server.";
    if (is_nav) { browser_dir = nn4dir; }
    if (is_ie5up) { browser_dir = ie5dir; }
    if (is_ie4) { browser_dir = ie4dir; }
    browser_dir += "<LI>Click 'Ok' on this page to return to Blackboard 5.";
    document.write("<table border='0' width='100%' cellpadding='0' cellspacing='0'><tr><td align='left' width='40'> </td>");
    document.write("<td align='left' width='100%'><b><font face='Arial, Helvetica, sans-serif' size='4'>Browser Cookies Disabled</font></b><hr size=5 noshade></td></tr></table>");
    document.write("<table border='0' cellpadding='5' cellspacing='0' width='100%'><tr><td width='20' valign='top'> </td><td width='100%' valign='top'>");
    document.write("<font face='Arial, Helvetica, sans-serif' size='2'><b>Browser Cookies Disabled</b></font><br>");
    document.write("<font size='2' face='Arial, Helvetica, sans-serif'>"+intro_dir);
    document.write(browser_dir);
    document.write("</font><br></td></tr><tr><td colspan='6' align='center'><form><input type=button value='Ok' onclick='javascript:history.go(-1)'></td></tr></table></form>");
    } else {
    var href = document.location.href;
    href = href + "?bbatt=Y";
    document.location.href = href;
    //END JavaScript
    //--></SCRIPT>
    </HEAD><BODY BGCOLOR='FFFFFF'>
    </BODY><HTML>

  • How to get the current path of my application in java ?

    how to get the current path of my application in java ?
    thanks

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

  • I have 100  songs on i pod touch. But when i connect it to itunes it only showed 44 songs. What is actually happening and how to fix the problem so that all music in my iphone can be seen in my itunes

    I have 100  songs on i pod touch. But when i connect it to itunes it only showed 44 songs. What is actually happening and how to fix the problem so that all music in my iphone can be seen in my itune

    If they are iTunes purchased music then go to Settings>iTunes and App Store and turn off Show All.
    Next
    Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync/delete all music and resync
    To delete all music go to Settings>General>Usage>Storage>Music>Tap edit in upper right and then tap the minus sign by All Music
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

  • How to change the date path of Web Server to my system time?

    Hi,
    I have downloaded a Countdown SWF file from the Internet. It is working fine with the Computers which have Internet Connection. But not working without Internet connection because of the following line of code in XML file:
    <PHPurl>http://www.flepstudio.org/utilita/CountDown/gettime.php</PHPurl>
    When I opened the webpage using the above code, it shows time in a typical digits:
    Monday, October 18, 2010 9:12:52 PM in my System -shows in Web browser like : time=1287425579
    How to modify the code so that I can use my System time to work with Countdown without Internet Connection.
    The following is the path from where I have downloaded the Countdown file:
    http://www.flepstudio.org/forum/flepstudio-utilities/2960-flash-cs3-countdown.html
    Please help me to run this countdown without internet access.
    Thanks.

    It appears all that php file does is return a time=value variable.  So you need to see where that time variable is implemented in the Flash file and assign it a value using the Date.getTime() method instead of having the PHP file get called into play.  Look in the help documents or Google if you do not know how to use the Date class.

  • How to get the absolute path of logicalhost server domain on Windows Sun

    i am reading a file from Xsql Folder, that is located in the logicalhost Sun\AppServer\domains\domain1\applications\j2ee-apps.(IN Sun Application Server)
    I am pretty sure that using the absolute path will solve this issue, so my first question is: How to get the absolute path of logicalhost server domain on Windows?
    i tried with System.getProperty("com.sun.aas.instanceRoot").
    but i am able to retrive Sun\AppServer\domains\domain1 upto this .i am unable to retrive Sun\AppServer\domains\domain1\applications\j2ee-apps.
    please suggest me how u can get absolute path in sun application server

    Take a look here

  • How to get the absolute path of logicalhost server domain on Windows?

    My logicalhost server domain behaves strangely. I am reading a file from collaboration definiton, that is located in the logicalhost/is/domains/domain1/config folder. I thought, that this folder is used as an application root folder so I can read files like ./file from there. And it worked.
    But then I've installed the domain as a Windows service, restarted the PC. When the domain1 gets started, I get exceptions saying that the file can't be found. Then I restart the domain (in domainmgr.bat) and it works again.
    I am pretty sure that using the absolute path will solve this issue, so my first question is: How to get the absolute path of logicalhost server domain on Windows?
    And my second question is: Why does this happen?

    The default folder for a Windows Service is the system32 folder contrary to the instance root folder when starting it as a normal process.
    That's the why, haven't tried the how, but you should be able to get the value by calling System.getProperty("com.sun.aas.instanceRoot").
    Hope this helps
    Paul

  • How to set the report path in a model plugin

    I am trying to figure out how to set the report path in a process model plug-in. I can seem to figure out how to get access to it. It seems like this would be a reasonable thing to do since the plug-ins are for results processing. Does anyone know how to do this? We typically use the Sequential process model but I am trying to keep my plug-in as independent of that as possible. 
    Thanks.
    Solved!
    Go to Solution.

    If I understand, you want your plug-in, when enabled, to alter the settings of any other instances of the NI report plug-in such that their reports share the same directory as your plug-in is configured to use.
    If so, your plug-in can access and modify the settings of all other plug-in instances. All instances are passed to all plug-in entries point in the plugins array sub-property of the ModelConfiguration parameter. You can iterate through this array. Any element of the array with a Base.SequenceFilename equal to "NI_ReportGenerator.seq" is an instance of the NI report plug-in. Its report options are stored in the element under PluginSpecific.Options.
    You can change the report options to what ever you want. Note that the ReportOptions model callback is called from the Initialize model-plugin entry point, so you might want to ensure that your changes are applied after that, so they aren't overwritten. To do that, you could make your changes in the the Initialize entry point of your plug-in, and ensure that your plugin runs last. To make it run last, you could set the FileGlobals.ModelPluginComponentDescription.Default.Base.RunOrder in your plug-in file to a value greater than 0, such as 1.0 (see TestStand Help>>Fundamentals>>Process Model Architecture>>Process Model Plug-in Architecture>>Structure of Plug-in Sequence Files>>Model Plug-in Entry Points>>Order of Entry Point Execution at Run Time).

Maybe you are looking for