Asking user to select a directory in which data will be saved (Labview)

i'm doing measurments on superconductors, and I would like my programm to ask the user to select the directory he would like his measurments to be saved to. But not by asking him the writen path (user might be stupid!!)but by a dialog window if you know what I mean.
anyway thankyou very mucH.
toby
Attachments:
grafxyetfich.vi ‏35 KB

Go to File I/O / Advanced File Functions / File Dialog.
This vi have input parameter "Select Mode".
Set it to "Select Existing or New Directory". User will see File Dialog where will be button "select current directory". It means that user go to some directory and press this button, so vi will return path to this directory.
Use vi "Build Path" and give him any file name.
I believe you understand me.
Good luck.

Similar Messages

  • My iPhone 5S , if select : reset all settings / which setting will be default.

    my iPhone 5S , if select : reset all settings / which setting will be default.

    Resetting your settings on your iPhone will not erase you contacts, this just resets your phone settings and does not do anything with the data or content stored in your phone. Also if you have iCloud, your contacts automatically store onto iCloud, and will keep them up to date if you were to, say restore the phone to factory settings

  • Liquidity forecast report - On which date will Purchase order be reflected

    Dear Gurus,
    My client has payment terms ' payment 30 days after date of GR'
    say the Purchase Order is raised on 1/1/2009 and GR done on 20/1/2009 then amount should be due to vendor on 19/2/2009 ( 30 days from GR date)
    it is required that when i raise PO the said date should be reflected in liquidity forecast report.
    How can i make this possible as at time of raising PO i do not know GR date.
    Also let me know on which date the PO would normally be reflected in liquidity forecast report?
    Regards,

    Hi,
    I have a problem that none of the PO amount is reflected on cash liquidation, the report only retrieves balances of PO which have been converted to invoice through MIRO.
    I found that the configuration is complete, planning group has been assigned to vendor master data. Do you have any idea how planning level in Cash Management connects to Material Management/Vendor?
    Or is there something missing that I can't get balance of PO in cash liquidation report?
    Thanks a lot

  • A&T users migrating to Verizon:  4.3.1 data will not restore to 4.2.6

    For users who are migrating from AT&T beyond the March 11 4.3.1 firmware release and have updated their GSM iPhones to this new firmware: If you jump ship to Verizon and purchase an iPhone 4 with firmware 4.2.6 there is no way to restore your backup files from iTunes to your new phone. Apple has a clear fragmentation occurring with their firmware releases and any user who wants to transfer information from 4.3.1 to 4.2.6 will be unable to do so.
    Apple support has indicated a release will be made for the Verizon iPhone firmware but there is no estimate date when this will happen (could be months from now). It seems as if you might just be stuck starting fresh and re-synchronizing data manually. 3rd party application data will not be able to be transferred unless the app has built in iTunes File Sharing for in-app backup of your data.

    Well hopefully the next major iOS release (iOS 5?) will end this fragmentation and put all iPhone users on the same page. I want to see us poor Verizon users get the same love from Apple that AT&T does. And that doesn't mean getting new (well old, I guess) software and hardware 8 months after them. <sniff> Have hope... AT&T only had to wait a whole 30 days (and 2 weeks) to get iOS 4.3(1) and get that hot spot feature (and well... a whole slew of other enhancements, bug fixes and security updates). So maybe, just maybe us Verizon users will see maybe one more update that will at least get us on par with the GSM users. I don't want anything extra... just equality. So I'm hoping that this isn't going to become a tug of war between CDMA and GSM iPhone users!

  • ADFS is asking users to select site

    Hi,
    We have ADFS and ADFS Proxy implemented.
    we are facing the issue , we more that 30 relying party trust created for different customers.
    once of our customer is facing problem is , when their application re-directs authentication to ADFS(externally) it landing to ADFS home realm page. i.e. its asking to select site from the drop down and click on log-in.
    by this way our customers info getting exposed, how block this and provide user to get only ADFS username password webpage.
    created relying party trust manually and we are using custom claim rules.

    On Mon, 22 Sep 2014 16:00:33 +0000, Ragavendra Dayakar wrote:
    We have ADFS and ADFS Proxy implemented.
    ADFS questions should be posted to:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=Geneva
    Paul Adare - FIM CM MVP
    "The Unix phenomenon is scary. It doesn't go away." -- Steve Ballmer

  • Not able to select physicalschema directory for file data server in ODI 11g

    Hi,
    I am a beginner to ODI tech and stuck up with an error while doing a tutorial (mentioned in this link - http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-ff/ODIproject_flatfile-to-flatfile.htm).
    While creating a physical schema for default file server(FILE_GENERIC) , I am not able to select schema directories and the name field with value 'FILE_GENERIC.Directory' is grayed out (non editable)
    I have gone through many documents but could not find any relevant information for this.
    So could you please let me know if any configurations required for this?
    Thanks,
    Anusha

    Hi Oleg,
    Thanks for your reply.
    While creation of physical schema , Name field is grayed out , is that the default behaviour of the screen? because in the tutorial I could see the name filead is pointing to a file directory path.
    Thanks,
    Anusha

  • Upload file without asking user for the file

    Hi,
    I need to upload a file to server, but from my code, not using the file upload from page.
    I have created a xml file and I need to upload to server when user open a web browser (without asking user to select a file).
    How do I proceed??, or what kind of libraries do I must use?
    thanks

    davisote wrote:
    Hi,
    thanks for answer.
    Let me try to explain again (I think its very simple).Simple, yes. But not very thorough.
    I have developed a web application using JSF.So all the code is running on the server, right? There are no Applets, Applications or WebStart applications involved. Right?
    My application has a splash screen where I show data. I have developed a bean to connect to my database (sql server), extract this data and create an xml (using DOM) file like:
    <news>
    <simplenews id="1"> Value </simplenews>
    </news>And that bean runs ... where? Server again?
    (important step) Once I have created the xml file in my bean I want to upload to the server to a place like /WEB-INF/news.
    If the code is running on the server, then "uploading" is the wrong term, as there's nowhere to upload to, since you're already on the server.
    This may sound like nit-picking, but you're sending us on a wrong trail with this phrase.
    Once the file is on the server with another bean I read the xml fileWhy don't you simply store it in the application scope and let everyone access it from there? It doesn't sound as if the XML is huge.
    As you can see I haven't a web page where to show an upload file componetYou also don't want to "upload" anything from the client, from the sound of it.
    You simply want to transfer data between to server-side components, if I understood you correctly.

  • How to create Variables(User Input Selections) in WEBI Report

    Hi Team,
                  My requirement is to create a WEBI Report on top of BEx query,I have created a Universe and WEBI Report on this Universe but my doubt is How to create Variables for the User to select.The Input selection should be
    User Iputs(All are drop downs)
    Distribution Channel :       ->drop down,user can select one
    Division:                          -> drop down,user can select one
    Department:
    Season:
    Collection:
    Date Format              Valid From:                                 Fiscal Week:
    When the user gives the above selections the output should be displayed as
    Material No   Description     Markdown Week     Reason code1(under this)        Reason code2(under this)   like that for all the
                                                                                valid from         Amount              Valid from          Amount            Reason code.
    I have designed the basic layout of the Report but wanted to know how to design like this,Please help me out in this Format.
    Thanks & Regards,
    Somu

    Hi, depending on the way you set this up (it is not entirely clear if you are talking bex variables or report drop down filters), use the following;
    For BEX variables, the choice will be in the
    UserResponse("prompt message")
    this you can display in the message format you want.
    For drop down filters the choice will be in the DrillFilters(), this one will show all selections in one string.
    However, if you want to format this to a certain message, you need to use the Formula
    DrillFilters([object from drill bar])
    This will give you the result of just that one selection. If the user did not select (yet), the value will be "".
    Hope this helps,
    Marianne

  • VBA & Word: Which Sections will be printed?

    I have implemented the event DocumentBeforePrint with Word 2013.
    I've modified the backstage print view where the user can select a text (stamp) which will be inserted as a watermark and removed after the print has been done.
    In the event DocumentBeforePrint I would like to get the information what the user wants to print (All of the document, or only certain sections of it.) Because setting the watermark in the Footer of each Section takes up some time and I would like to narrow
    it down and insert the watermark only in the Section which will be printed.
    Thanks for any help! Martin

    In that case, you'd probably need to use a DocumentBeforePrint macro, coded along the lines of:
    Private Sub wdApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
    Dim StrPrn As String, StrRng As String
    'Retrieve the print parameters from the FilePrint Dialog
    With Application.Dialogs(wdDialogFilePrint)
        'If Print =
        'All, StrPrn = 0
        'Current Page, StrPrn = 2
        'Pages, StrPrn = 4
        StrPrn = .Range
        'If StrPrn = 4, then StrRng holds the range to be printed
        StrRng = .Pages
    End With
    Select Case StrPrn
      Case 0: StrRng = "1" & "-" & ActiveDocument.Sections.Count
      Case 2: StrRng = Selection.Sections.First.Index
      Case 4
        If InStr(StrRng, "p") > 0 Then
          MsgBox "Please specify only Section #s", vbExclamation
          Cancel = True
          Exit Sub
        End If
        StrRng = Replace(StrRng, "s", "")
    End Select
    StrRng = ParseNumberString(StrRng, ",", "-")
    'StrRng now holds an itemised list of Section #s for further processing
    MsgBox StrRng
    End Sub
    Function ParseNumberString(StrIn As String, strSS, strGS)
    Dim i As Long, j As Long, StrTmp As String, Arr As Variant
    Arr = Filter(Split(StrIn, strSS), strGS)
    For i = 0 To UBound(Arr)
      StrTmp = ""
      For j = Val(Arr(i)) To Split(Arr(i), strGS)(1)
        StrTmp = StrTmp & strSS & j
      Next
      StrIn = Replace(StrIn, Arr(i), Mid(StrTmp, 2))
    Next
    ParseNumberString = StrIn
    End Function
    To use code like this, see:
    http://word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm
    and:
    http://word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm
    Note that I haven't included the code that actually adds the watermarks - all it now outputs is a message box showing the sections to be processed. I'll leave that part to you. I also haven't tested whether you can actually reliably retrieve the required
    data this way - you can indeed retrieve it from the Print Dialogue, but doing that directly ordinarily doesn't return the values you're interested in until after the print job has been submitted.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Custom TrustManager example which asks user for trustability

    Hi!
    For I needed a trustmanager which shows an untrusted server certificate to the user and asks him if the certificate can be considered trustable I wrote an own trustmanager. As it took much time to find out how to do this here is my code to shorten your time if you need a similar functionality:
    NOTE:
    If a certificate is declared trustable by the user it is stored in a local keystore file. So if you use the code in an applet you need to sign it to get the appropriate permissions.
    To use it you have to put the following code where you get your SSLSocketFactory:
    try{
                   SSLContext sslContext=SSLContext.getInstance("SSL","SunJSSE");
                   TrustManager[] tm={new StoreCertTrustManager()};
                   sslContext.init(null,tm,null);
                   factory = ( SSLSocketFactory) sslContext.getSocketFactory();
    }catch(Exception e) { ... }
    Here is the implementation of the StoreCertTrustManager:
    * This class implements a TrustManager for authenticating the servers certificate.
    * It enhances the default behaviour.
    class StoreCertTrustManager implements X509TrustManager {
         /** The trustmanager instance used to delegate to default behaviour.*/
         private TrustManager tm=null;
         /** Password for own keystore */
         private final char[] keyStorePassword=new String("changeit").toCharArray();
         /** Path to own keystore. Store it into the home directory to avoid permission problems.*/
         private final String keyStorePath=System.getProperty("user.home")+"/https-keystore";
         /** The stream for reading from the keystore. */
         FileInputStream keyStoreIStream=null;
         /** The instance of the keystore */
         private KeyStore keyStore=null;
         * Creates a TrustManager which first checks the default behaviour of the X509TrustManager.
         * If the default behaviour throws a CertificateException ask the user if the certificate
         * should be declared trustable.
         * @throws Exception: If SSL - initialization failed.
         StoreCertTrustManager() throws Exception {
              /* Try to set the truststore system property to our keystore
              * if we have the appropriate permissions.*/
              try{
                   File httpsKeyStore=new File(keyStorePath);
                   if(httpsKeyStore.exists()==true) {
                        System.setProperty("javax.net.ssl.trustStore",keyStorePath);
              }catch(SecurityException se) {}
              /* Create the TrustManagerFactory. We use the SunJSSE provider
              * for this purpose.*/
              TrustManagerFactory tmf=TrustManagerFactory.getInstance("SunX509", "SunJSSE");
              tmf.init((java.security.KeyStore)null);
              tm=tmf.getTrustManagers()[0];
              /* Something failed we could not get a TrustManager instance.*/
              if(tm == null) {
                   throw new SSLException("Could not get default TrustManager instance.");
              /* Create the file input stream for the own keystore. */
              try{
                   keyStoreIStream = new FileInputStream(keyStorePath);
              } catch( FileNotFoundException fne ) {
                   // If the path does not exist then a null stream means
                   // the keystore is initialized empty. If an untrusted
                   // certificate chain is trusted by the user, then it will be
                   // saved in the file pointed to by keyStorePath.
                   keyStoreIStream = null;
              /* Now create the keystore. */
              try{
                   keyStore=KeyStore.getInstance(KeyStore.getDefaultType());
                   keyStore.load(keyStoreIStream,keyStorePassword);
              }catch(KeyStoreException ke) {
                   System.out.println("Loading of https keystore from file <"+keyStorePath+"> failed. error message: "+ke.getMessage());
                   keyStore=null;
         * Authenticates a client certificate. For we don't need that case only implement the
         * default behaviour.
         * @param chain In: The certificate chain to be authenticated.
         * @param authType In: The key exchange algorithm.
         public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
              ((X509TrustManager)tm).checkClientTrusted(chain,authType);
         * Authenticates a server certificate. If the given certificate is untrusted ask the
         * user whether to proceed or not.
         * @param chain In: The certificate chain to be authenticated.
         * @param authType In: The key exchange algorithm.
         public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
              /* Output the certifcate chain for debugging purposes */
              System.out.println("got X509 certificate from server:");
              for(int i=0; i<chain.length; i++) {
                   System.out.println("chain["+i+"]: "+chain.getIssuerDN().getName());
              try{
                   /* First try the default behaviour. */
                   ((X509TrustManager)tm).checkServerTrusted(chain,authType);
              }catch(CertificateException ce) {
                   System.out.println("in checkServerTrusted: authType: "+authType+", got certificate exception: "+ce.getMessage());
                   /* If we got here the certificate is untrusted. */
                   /* If we could not craete a keystore instance forward the certificate exception. So we have
                   * at least the default behaviour. */
                   if(keyStore==null || chain == null || chain.length==0) {
                        throw(ce);
                   try{
                        /* If we could not find the certificate in the keystore
                        * ask the user if it should be treated trustable. */
                        AskForTrustability ask=new AskForTrustability (chain);
                        boolean trustCert=ask.showCertificateAndGetDecision();
                        if(trustCert==true) {
                             // Add Chain to the keyStore.
                             for (int i = 0; i < chain.length; i++)
                                  keyStore.setCertificateEntry
                                       (chain[i].getIssuerDN().toString(), chain[i]);
                             // Save keystore to file.
                             FileOutputStream keyStoreOStream =
                                  new FileOutputStream(keyStorePath);
                             keyStore.store(keyStoreOStream, keyStorePassword);
                             keyStoreOStream.close();
                             keyStoreOStream = null;
                             System.out.println("Keystore saved in " + keyStorePath);
                        } else {
                             throw(ce);
                   }catch(Exception ge) {
                        /* Got an unexpected exception so throw the original exception. */
                        System.out.println("in checkServerTrusted: got exception type: "+ge.getClass()+" message: "+ge.getMessage());
                        throw ce;
         * Merges the system wide accepted issuers and the own ones and
         * returns them.
         * @return: Array of X509 certificates of the accepted issuers.
    public X509Certificate[] getAcceptedIssuers() {
              X509Certificate[] cf=((X509TrustManager)tm).getAcceptedIssuers();
              X509Certificate[] allCfs=cf;
              if(keyStore != null) {
                   try{
                        Enumeration ownCerts=keyStore.aliases();
                        Vector certsVect=new Vector();
                        while(ownCerts.hasMoreElements()) {
                             Object cert=ownCerts.nextElement();
                             certsVect.add(keyStore.getCertificate(cert.toString()));
                        int newLength=cf.length+certsVect.size();
                        allCfs=new X509Certificate[newLength];
                        Iterator it=certsVect.iterator();
                        for(int i=0; i<newLength ; i++) {
                             if(i<cf.length) {
                                  allCfs[i]=cf[i];
                             } else {
                                  allCfs[i]=(X509Certificate)it.next();
                   }catch(KeyStoreException e) {}
              for(int i=0; i<allCfs.length;i++) {
                   System.out.println("allCfs["+i+"]: "+allCfs[i].getIssuerDN());
              return allCfs;
         * This class implements an interactive dialog. It shows the contents of a
         * certificate and asks the user if it is trustable or not.
         class AskForTrustability implements ActionListener, ListSelectionListener {
              private JButton yes=new JButton("Yes"),no=new JButton("No");
              /** default to not trustable */
              private boolean isTrusted=false;
              private JDialog trust=null;
              private JList certItems=null;
              private JTextArea certValues=null;
              private JComboBox certChain=null;
              private final String certParms[]={"Version","Serial Number","Signature Algorithm", "Issuer", "Validity Period", "Subject", "Signature","Certificate Fingerprint"};
              private X509Certificate[] chain;
              private int chainIdx=0;
              * Creates an instance of the class and stores the certificate to show internally.
              * @param chain In: The certificate chain to show.
              AskForTrustability (X509Certificate[] chain) {
                   this.chain=chain;
              * This method shows a dialog with all interesting information of the certificate and
              * asks the user if the certificate is trustable or not. This method block

    Your code has some errors, I have correct it. Here is the new code:
    StoreCertTrustManager.java
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.security.*;
    import java.security.cert.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import javax.net.ssl.*;
    * This class implements a TrustManager for authenticating the servers certificate.
    * It enhances the default behaviour.
    class StoreCertTrustManager implements X509TrustManager {
         /** The trustmanager instance used to delegate to default behaviour.*/
         private TrustManager tm=null;
         /** Password for own keystore */
         private final char[] keyStorePassword=new String("changeit").toCharArray();
         /** Path to own keystore. Store it into the home directory to avoid permission problems.*/
         private final String keyStorePath=System.getProperty("user.home")+"/https-keystore";
         /** The stream for reading from the keystore. */
         FileInputStream keyStoreIStream=null;
         /** The instance of the keystore */
         private KeyStore keyStore=null;
          * Creates a TrustManager which first checks the default behaviour of the X509TrustManager.
          * If the default behaviour throws a CertificateException ask the user if the certificate
          * should be declared trustable.
          * @throws Exception: If SSL - initialization failed.
         StoreCertTrustManager() throws Exception {
              /* Try to set the truststore system property to our keystore
               * if we have the appropriate permissions.*/
              try{
                   File httpsKeyStore=new File(keyStorePath);
                   if(httpsKeyStore.exists()==true) {
                        System.setProperty("javax.net.ssl.trustStore",keyStorePath);
              }catch(SecurityException se) {}
              /* Create the TrustManagerFactory. We use the SunJSSE provider
               * for this purpose.*/
              TrustManagerFactory tmf=TrustManagerFactory.getInstance("SunX509", "SunJSSE");
              tmf.init((java.security.KeyStore)null);
              tm=tmf.getTrustManagers()[0];
              /* Something failed we could not get a TrustManager instance.*/
              if(tm == null) {
                   throw new SSLException("Could not get default TrustManager instance.");
              /* Create the file input stream for the own keystore. */
              try{
                   keyStoreIStream = new FileInputStream(keyStorePath);
              } catch( FileNotFoundException fne ) {
              // If the path does not exist then a null stream means
              // the keystore is initialized empty. If an untrusted
              // certificate chain is trusted by the user, then it will be
              // saved in the file pointed to by keyStorePath.
                   keyStoreIStream = null;
              /* Now create the keystore. */
              try{
                   keyStore=KeyStore.getInstance(KeyStore.getDefaultType());
                   keyStore.load(keyStoreIStream,keyStorePassword);
              }catch(KeyStoreException ke) {
                   System.out.println("Loading of https keystore from file <"+keyStorePath+"> failed. error message: "+ke.getMessage());
                   keyStore=null;
          * Authenticates a client certificate. For we don't need that case only implement the
          * default behaviour.
          * @param chain In: The certificate chain to be authenticated.
          * @param authType In: The key exchange algorithm.
         public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
              ((X509TrustManager)tm).checkClientTrusted(chain,authType);
          * Authenticates a server certificate. If the given certificate is untrusted ask the
          * user whether to proceed or not.
          * @param chain In: The certificate chain to be authenticated.
          * @param authType In: The key exchange algorithm.
         public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
         /* Output the certifcate chain for debugging purposes */
              System.out.println("got X509 certificate from server:");
              for(int i=0; i<chain.length; i++) {
                   System.out.println("chain["+i+"]: "+chain.getIssuerDN().getName());
              try{
              /* First try the default behaviour. */
                   ((X509TrustManager)tm).checkServerTrusted(chain,authType);
              }catch(CertificateException ce) {
                   System.out.println("in checkServerTrusted: authType: "+authType+", got certificate exception: "+ce.getMessage());
                   /* If we got here the certificate is untrusted. */
                   /* If we could not craete a keystore instance forward the certificate exception. So we have
                   * at least the default behaviour. */
                   if(keyStore==null || chain == null || chain.length==0) {
                        throw(ce);
                   try{
                   /* If we could not find the certificate in the keystore
                   * ask the user if it should be treated trustable. */
                        AskForTrustability ask=new AskForTrustability (chain);
                        boolean trustCert=ask.showCertificateAndGetDecision();
                        if(trustCert==true) {
                             // Add Chain to the keyStore.
                             for (int i = 0; i < chain.length; i++){
                                  keyStore.setCertificateEntry(chain[i].getIssuerDN().toString(), chain[i]);
                             // Save keystore to file.
                             FileOutputStream keyStoreOStream = new FileOutputStream(keyStorePath);
                             keyStore.store(keyStoreOStream, keyStorePassword);
                             keyStoreOStream.close();
                             keyStoreOStream = null;
                             System.out.println("Keystore saved in " + keyStorePath);
                        } else {
                             throw(ce);
                   }catch(Exception ge) {
                   /* Got an unexpected exception so throw the original exception. */
                        System.out.println("in checkServerTrusted: got exception type: "+ge.getClass()+" message: "+ge.getMessage());
                        throw ce;
         * Merges the system wide accepted issuers and the own ones and
         * returns them.
         * @return: Array of X509 certificates of the accepted issuers.
         public java.security.cert.X509Certificate[] getAcceptedIssuers() {
              X509Certificate[] cf=((X509TrustManager)tm).getAcceptedIssuers();
              X509Certificate[] allCfs=cf;
              if(keyStore != null) {
                   try{
                        Enumeration ownCerts=keyStore.aliases();
                        Vector certsVect=new Vector();
                        while(ownCerts.hasMoreElements()) {
                             Object cert=ownCerts.nextElement();
                             certsVect.add(keyStore.getCertificate(cert.toString()));
                        int newLength=cf.length+certsVect.size();
                        allCfs=new X509Certificate[newLength];
                        Iterator it=certsVect.iterator();
                        for(int i=0; i<newLength ; i++) {
                             if(i<cf.length){
                                  allCfs=cf;
                             else {
                                  allCfs=(X509Certificate[])it.next();
                   }catch(KeyStoreException e) {}
              for(int i=0; i<allCfs.length;i++) {
                   System.out.println("allCfs["+i+"]: "+allCfs[i].getIssuerDN());
              return allCfs;
         * This class implements an interactive dialog. It shows the contents of a
         * certificate and asks the user if it is trustable or not.
         class AskForTrustability implements ActionListener, ListSelectionListener {
              private JButton yes=new JButton("Yes"),no=new JButton("No");
              /** default to not trustable */
              private boolean isTrusted=false;
              private JDialog trust=null;
              private JList certItems=null;
              private JTextArea certValues=null;
              private JComboBox certChain=null;
              private final String certParms[]={"Version","Serial Number","Signature Algorithm", "Issuer", "Validity Period", "Subject", "Signature","Certificate Fingerprint"};
              private X509Certificate[] chain;
              private int chainIdx=0;
         * Creates an instance of the class and stores the certificate to show internally.
         * @param chain In: The certificate chain to show.
              AskForTrustability (X509Certificate[] chain) {
                   this.chain=chain;
         * This method shows a dialog with all interesting information of the certificate and
         * asks the user if the certificate is trustable or not. This method blocks until
         * the user presses the 'Yes' or 'No' button.
         * @return: true: The certificate chain is trustable
         * false: The certificate chain is not trustable
              public boolean showCertificateAndGetDecision() {
                   if(chain == null || chain.length == 0) {
                        return false;
                   trust=new JDialog((Frame)null,"Untrusted server certificate for SSL connection",true);
                   Container cont=trust.getContentPane();
                   GridBagLayout gl=new GridBagLayout();
                   cont.setLayout(gl);
                   JPanel pLabel=new JPanel(new BorderLayout());
                   Icon icon = UIManager.getIcon("OptionPane.warningIcon");
                   pLabel.add(new JLabel(icon),BorderLayout.WEST);
                   JTextArea label=new JTextArea("The certificate sent by the server is unknown and not trustable!\n"+
                   "Do you want to continue creating a SSL connection to that server ?\n\n"+
                   "Note: If you answer 'Yes' the certificate will be stored in the file\n\n"+
                   keyStorePath+"\n\n"+
                   "and the next time treated trustable automatically. If you want to remove\n"+
                   "the certificate delete the file or use keytool to remove certificates\n"+
                   "selectively.");
                   label.setEditable(false);
                   label.setBackground(cont.getBackground());
                   label.setFont(label.getFont().deriveFont(Font.BOLD));
                   pLabel.add(label,BorderLayout.EAST);
                   GridBagConstraints gc=new GridBagConstraints();
                   gc.fill=GridBagConstraints.HORIZONTAL;
                   gl.setConstraints(pLabel,gc);
                   pLabel.setBorder(new EmptyBorder(4,4,4,4));
                   cont.add(pLabel);
                   Vector choices=new Vector();
                   for(int i=0; i<chain.length ; i++) {
                        choices.add((i+1)+". certificate of chain");
                   certChain = new JComboBox(choices);
                   certChain.setBackground(cont.getBackground());
                   certChain.setFont(label.getFont().deriveFont(Font.BOLD));
                   certChain.addActionListener(this);
                   JPanel pChoice=new JPanel(new BorderLayout());
                   pChoice.add(certChain);
                   gc=new GridBagConstraints();
                   gc.fill=GridBagConstraints.HORIZONTAL;
                   gc.insets=new Insets(4,4,4,4);
                   gc.gridy=1;
                   gl.setConstraints(pChoice,gc);
                   pChoice.setBorder(new TitledBorder(new EmptyBorder(0,0,0,0), "Certificate chain"));
                   cont.add(pChoice);
                   certItems=new JList(certParms);
                   certItems.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                   certItems.addListSelectionListener(this);
                   JPanel pList=new JPanel(new BorderLayout());
                   pList.add(certItems);
                   pList.setBorder(new TitledBorder(new EtchedBorder(), "Certificate variables"));
                   gc=new GridBagConstraints();
                   gc.fill=GridBagConstraints.HORIZONTAL;
                   gc.insets=new Insets(4,4,4,4);
                   gc.gridy=2;
                   gl.setConstraints(pList,gc);
                   cont.add(pList);
                   certValues=new JTextArea();
                   certValues.setFont(label.getFont().deriveFont(Font.BOLD));
                   certValues.setEditable(false);
                   certValues.setBackground(cont.getBackground());
                   certValues.setLineWrap(true);
                   certValues.setWrapStyleWord(true);
                   JPanel pVals=new JPanel(new BorderLayout());
                   pVals.add(certValues);
                   pVals.setBorder(new TitledBorder(new EtchedBorder(), "Variable value"));
                   gc=new GridBagConstraints();
                   gc.insets=new Insets(4,4,4,4);
                   gc.weightx=1.0;
                   gc.weighty=1.0;
                   gc.fill=GridBagConstraints.BOTH;
                   gc.gridy=3;
                   gl.setConstraints(pVals,gc);
                   cont.add(pVals);
                   JPanel p=new JPanel();
                   yes.addActionListener(this);
                   no.addActionListener(this);
                   p.add(yes);
                   p.add(no);
                   gc=new GridBagConstraints();
                   gc.weightx=1.0;
                   gc.fill=GridBagConstraints.HORIZONTAL;
                   gc.gridy=4;
                   gl.setConstraints(p,gc);
                   cont.add(p);
                   //This should be the subject item
                   certItems.setSelectedIndex(5);
                   certItems.requestFocus();
                   trust.pack();
                   trust.setSize(500,600);
                   trust.setVisible(true);
                   return isTrusted;
         * Listener method for changin the contents of the JTextArea according to the
         * selected list item.
              public void valueChanged(ListSelectionEvent e) {
                   if (e.getValueIsAdjusting()){
                        return;
                   JList theList = (JList)e.getSource();
                   if (theList.isSelectionEmpty()) {
                        certValues.setText("");
                   } else {
                        String selVal = theList.getSelectedValue().toString();
                        if(selVal.equals("Version")==true) {
                             certValues.setText(String.valueOf(chain[chainIdx].getVersion()));
                        } else if(selVal.equals("Serial Number")==true) {
                             certValues.setText(byteArrayToHex(chain[chainIdx].getSerialNumber().toByteArray()));
                        } else if(selVal.equals("Signature Algorithm")==true) {
                             certValues.setText(chain[chainIdx].getSigAlgName());
                        } else if(selVal.equals("Issuer")==true) {
                             certValues.setText(chain[chainIdx].getIssuerDN().getName());
                        } else if(selVal.equals("Validity Period")==true) {
                             certValues.setText(chain[chainIdx].getNotBefore().toString()+" - "+chain[chainIdx].getNotAfter().toString());
                        } else if(selVal.equals("Subject")==true) {
                             certValues.setText(chain[chainIdx].getSubjectDN().getName());
                        } else if(selVal.equals("Signature")==true) {
                             certValues.setText(byteArrayToHex(chain[chainIdx].getSignature()));
                        } else if(selVal.equals("Certificate Fingerprint")==true) {
                             try{
                                  certValues.setText(getFingerprint(chain[chainIdx].getEncoded(),"MD5")+"\n"+
                                  getFingerprint(chain[chainIdx].getEncoded(),"SHA1"));
                             }catch(Exception fingerE) {
                                  certValues.setText("Couldn't calculate fingerprints of the certificate.\nReason: "+fingerE.getMessage());
         * This method calculates the fingerprint of the certificate. It takes the encoded form of
         * the certificate and calculates a hash value from it.
         * @param certificateBytes In: The byte array of the encoded data.
         * @param algorithm In: The algorithm to be used for calculating the hash value.
         * Two are possible: MD5 and SHA1
         * @return: Returns a hex formated string of the fingerprint.
              private String getFingerprint(byte[] certificateBytes, String algorithm) throws Exception {
                   MessageDigest md = MessageDigest.getInstance(algorithm);
                   md.update(certificateBytes);
                   byte[] digest = md.digest();
                   return new String(algorithm+": "+byteArrayToHex(digest));
         * This method converts a byte array to a hex formatted string.
         * @param byteData In: The data to be converted.
         * @return: The formatted string.
              private String byteArrayToHex(byte[] byteData) {
                   StringBuffer sb=new StringBuffer();
                   for (int i = 0; i < byteData.length; i++) {
                        if (i != 0) sb.append(":");
                        int b = byteData[i] & 0xff;
                        String hex = Integer.toHexString(b);
                        if (hex.length() == 1) sb.append("0");
                        sb.append(hex);
                   return sb.toString();
         * The listener for the 'Yes', 'No' buttons.
              public void actionPerformed(ActionEvent e) {
                   Object entry =e.getSource();
                   if(entry.equals(yes)==true) {
                        isTrusted=true;
                        trust.dispose();
                        } else if(entry.equals(certChain)==true) {
                             int selIndex=certChain.getSelectedIndex();
                             if(selIndex >=0 && selIndex < chain.length) {
                                  chainIdx=selIndex;
                                  int oldSelIdx=certItems.getSelectedIndex();
                                  certItems.clearSelection();
                                  certItems.setSelectedIndex(oldSelIdx);
                        } else {
                             trust.dispose();
    -----------------------------------------------end------------------------------------------------
    We can use follow code in main class to complete SSL authorize:
             SSLSocketFactory factory = null;
              KeyManager[] km = null;
              TrustManager[] tm = {new StoreCertTrustManager()};
              SSLContext sslContext = SSLContext.getInstance("SSL","SunJSSE");
              sslContext.init(null, tm, new java.security.SecureRandom());
              factory = sslContext.getSocketFactory();
             SSLSocket socket =
              (SSLSocket)factory.createSocket("localhost", 7002);

  • How to ask user to enter value in select statement

    Hi,
    Can anyone tell me syntax of select statement where i can ask user to enter value .
    for example i am trying to use belowthing but it displaying error
    select * from emp where empname=:empname
    SP2-0552: Bind variable "empname" not declared.
    2.Is there any data dictionary table to see all pl/sql procedures and corresponding code?
    Thanks,
    sri

    user632733 wrote:
    Can anyone tell me syntax of select statement where i can ask user to enter value .None. The SQL engine resides on the server. It is incapable of prompting for data entry on the client.
    The client interacts with the user. The client is suppose to:
    a) prompt for variable values
    b) send a SQL statement to Oracle
    c) bind values to bind variables in the SQL statement
    for example i am trying to use belowthing but it displaying error
    select * from emp where empname=:empnameIn SQL*Plus, you need to create a bind variable:
    SQL> var empname varchar2(200)
    And then assign a value to it:
    SQL> exec :empname := 'John Doe';
    Note that this is still not ideal - as the assignment is also done via the server and sends a PL block to the server. This block contains non-sharable code and this can lead to fragmentation of the server's Shared Pool.
    But it does illustrate the basic principle.

  • Query to get objects list for which the current user has 'SELECT' privilege

    Hi,
    I want to get tables and views list for which the current user has 'SELECT' privilege excluding sytem tables and views. The privilege information for the current user is scattered in more than one system views. I have following system views
    USER_TAB_PRIVS_RECD - Object grants for which the current user is the grantee
    ROLE_TAB_PRIVS - describes table privileges granted to roles. Information is provided only about roles to which the user has access.
    If the object privilege is granted explicitly like "GRANT ALL ON TABLE_NAME TO "USERNAME" then this privilege entry goes to USER_TAB_PRIVIS_RECD
    If the object privilege is granted by ROLE. Role is created with certain object privileges. this role is assigned to user "GRANT ROLE_NAME TO "USERNAME"", then this entry goes to ROLE_TAB_PRIVS
    From these findings, I have composed below query
    (SELECT DISTINCT TABLE_NAME FROM USER_TAB_PRIVS_RECD) UNION (SELECT DISTINCT TABLE_NAME FROM ROLE_TAB_PRIVS WHERE PRIVILEGE = 'SELECT')
    Have I got user's all prvilege details? should I look some other system views?
    How to exclude system table privileges details?
    (SELECT DISTINCT TABLE_NAME FROM USER_TAB_PRIVS_RECD) UNION (SELECT DISTINCT TABLE_NAME FROM ROLE_TAB_PRIVS WHERE PRIVILEGE = 'SELECT' AND OWNER NOT IN ('SYS','SYSTEM') Is this right?
    What about Public role in Oracle? Should I consider public role here?
    Oracel Version :11g
    I want make this query to work on Oracle 8i or above version
    Thanks

    >
    I want to get tables and views list for which the current user has 'SELECT' privilege excluding sytem tables and views.
    >
    You will need a hierarchical query to do that.
    Try this script for Listing privileges recursively for Oracle users
    http://www.adp-gmbh.ch/ora/misc/recursively_list_privilege.html

  • Can you ask the user to select a point?

    Is there a way in a javasript to ask the user to select a point and then get that information back as an X and Y value?
    Eric

    One way, if you have cs4, is have the user drop a color sampler. Then you could do something like this
    app.activeDocument.colorSamplers[0].position;// get the position
    app.activeDocument.colorSamplers[0].remove()// remove the sample

  • How can a jsp page tell which Oracle Responsibility the user has selected?

    We have two responsibilities - Timecard Administrator and Timecard Viewer. Everything that they can access is the same, except for one particular jsp page which we want to present a slightly different view if the user's responsibility is Timecard Viewer (specifically, the edit link in the results page will be suppressed). Unfortunately in order to implement this, the jsp code needs to be able to distinguish which of those two responsibilities the user has selected. I have written jsp code to print all the environment variables and unfortunately the environment is essentially identical regardless of which of the two responsibilities the user selected.
    How do I pass in the active responsibility to that page/environment in a way that can be tested by the jsp code?
    Thank you,
    Graham Toal <[email protected]>

    Yes, I tried something like this (shortened to the basics for this post):
    <pre>
    sqlQuery="select responsibility_name from fnd_responsibility_vl where responsibility_id = FND_GLOBAL.RESP_ID";
    stmt=con.createStatement();
    rs=stmt.executeQuery(sqlQuery);
    int field_count=rs.getMetaData().getColumnCount();
    while (rs.next()) {
    for (int i=0; i<field_count; i++) {
    logger.write("Responsibility: "+rs.getObject(i+1),"JSP",objName,0,-1,1001);
    </pre>
    However it did not print any results at all.
    I'm trying a different approach at the moment - I've cloned the menus from the Administrator responsibility to the new Viewer responsibility, and have altered the top-level menu so that I can insert a new variable into the process state myself; that way by the time the user navigates to the changed page, there should be a variable there that can be tested.
    Unfortunately the top-level menu isn't just a simple menu, it's a piece of code that issues an HTML redirect depending on the parameter passed in - which is set in the Oracle function screen for the function attached to that menu.
    (was something like utpa_top_menu.jsp?ADMIN and I changed it to utpa_top_menu.jsp?VIEWER, with appropriate tests for the new module name:
    <tt>
    else if ("VIEWER".equals(moduleName))
    url = "/utpa/jsp/admin_reports-viewer.jsp";
    </tt>
    In admin_reports-viewer.jsp I've added <tt>session.putValue("REPVIEWER","y");</tt> and in the actual target main page I have:
    <pre>
    if (session.getValue("REPVIEWER") == "y") {
    // viewer
    out.println("<CENTER><B>You are using the Timecard Viewer responsibility</B></CENTER><BR>");
    } else {
    </pre>
    And although the URL bar at the top of the screen is displaying the correct (redirected) URL, the page that is displayed is blank. Completely empty. 0 bytes. The file is present on the filing system; has content; has the correct ownership and permissions; I've reloaded apache, even had the systems guys reboot completely. I'm at a loss :-/
    Graham

  • Feature Request: Ability to detect which tab user has selected in tab view

    'Twould be nice if the tab the user has selected could be restored when a dialog box with a tab view is re-presented.
    Or is there a way and I'm just brain-dead at the moment?
    Thx,
    R

    Hi, Rob,
    Use the «value» property of viewFactory:tab_view() with data from «identifier» from nesting viewFactory:tab_view_item(). I just tried this and it works well. You can bind this value directly to entry in preferences table, and the tab selection will be restored at each run.
    Alex

Maybe you are looking for