Ask user for date

Is there a standard dialog for this?
I googled but the things I found was
* JDatePicker (some sort of commercial product - ?)
* JXDatePicker (belongs to org.jdesktop.swingx, a packet I cannot import)
sure there must be a simpler way?

of you can try to find out plenty od JDatePicker, JDate or JCalendar
then google returns ...., check and compare its funcionalities with calendar by "toedter"
on check posts on some forums (inc. this one), its can get you answer

Similar Messages

  • Cannot impersonate user for data source 'SMSDB'. --- Microsoft.ReportingServices.Diagnostics.Utilities.LogonFailedException: Log on failed. ---

    After Upgrading from SCCM 2012 Sp1 to SCCM 2012 R2 we are getting following error:
    System.Web.Services.Protocols.SoapException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
    Cannot impersonate user for data source 'SMSDB'. ---> Microsoft.ReportingServices.Diagnostics.Utilities.LogonFailedException: Log on failed. ---> System.Runtime.InteraopServices.COMException: The referenced account is currently locked out and may not
    be logged on to. (Exception from HRESULT: 0x80070775)
       at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.GetReportParameters(String Report, String HistoryID, Boolean ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, ReportParameter[]& Parameters)
       at Microsoft.ReportingServices.WebServer.ReportingService2005.GetReportParameters(String Report, String HistoryID, Boolean ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, ReportParameter[]& Parameters)
    Microsoft.ConfigurationManagement.ManagementProvider.SmsException
    An error has occurred during report processing.
    Stack Trace:
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ParameterPresenter.GetParameters()
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ParameterPresenter.LoadParameters(IReport report, Collection`1 navigationParameters, IResultObject resultObject)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerPresenter.Worker_DoWork(Object sender, DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
    System.Web.Services.Protocols.SoapException
    System.Web.Services.Protocols.SoapException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException:
    Cannot impersonate user for data source 'SMSDB'. ---> Microsoft.ReportingServices.Diagnostics.Utilities.LogonFailedException: Log on failed. ---> System.Runtime.InteropServices.COMException: The referenced account is currently locked out and may not
    be logged on to. (Exception from HRESULT: 0x80070775)
       at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.GetReportParameters(String Report, String HistoryID, Boolean ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, ReportParameter[]& Parameters)
       at Microsoft.ReportingServices.WebServer.ReportingService2005.GetReportParameters(String Report, String HistoryID, Boolean ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, ReportParameter[]& Parameters)
    Stack Trace:
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ParameterPresenter.GetParameters()
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ParameterPresenter.LoadParameters(IReport report, Collection`1 navigationParameters, IResultObject resultObject)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerPresenter.Worker_DoWork(Object sender, DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

    HI,
    Check the SQL Reporting services account that is used, the one that you supplied when setting up the SQL Reporting Services point in the Configuration Manager 2012 console, it seems to be locked out.
    I believe it has been asked once before on the forums as well.
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Lync monitoring Details reports are not getting opened, Getting SQL error like "Cannot impersonate user for data source 'CDRDB"

    Hi,
         Two month before, We have deployed Lync 13 set up with lync monitoring and archiving service enabled. After configuring we have the Lync monitoring and archiving services are working fine... few weeks back I have changed the Admin Password
    of the Lync Setup. After that Lync Monitoring and Archiving services are not working.
    when I try open Lync monitoring service from web UI, 
    http://localhost/ReportServer_LyncMonitoring/
    Web UI is opening but Reports home page is not Accessible , Getting error Like
    "An error has occurred during report processing. (rsProcessingAborted)
    Cannot impersonate user for data source 'CDRDB'. (rsErrorImpersonatingUser)
    Log on failed. Ensure the user name and password are correct. (rsLogonFailed)
    The user name or password is incorrect"
    Please help me to trouble shoot this problem.
    Thanks,
    Rajarajan.D

    Hi Rajarajan.D
    You probably need to update the password against the CDRDB datasource in SSRS Report manager, take a look at this article: http://lyncme.co.uk/microsoft-lync-server-2013/cannot-impersonate-user-for-data-source-cdrdb-rserrorimpersonatinguser-error/
    If this helped you please click "Vote As Helpful" if it answered your question please click "Mark As Answer"
    Georg Thomas | Lync MVP
    Blog www.lynced.com.au | Twitter
    @georgathomas
    Lync Edge Port Check (Beta)
    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • BPMon Setup: Check user for data collection

    Dear experts,
    I'm trying to configure Business Process Monitoring in our Solution Manager system and I'm stuck in the step "Check User for Data Collection". See screenshot. I mark this row and click on "Execute Selected". A background job is scheduled and finishes after some 6 seconds, But this step is still marked as "Activity not yet performed". Any idea how this can be solved? I read the documentation, notes and the troubleshooting guide but found nothing about this specific problem.
    Many thanks for any help!
    Calin

    Hi Calin
    The status will remain grey as long as there are clients in the managed system that have not been connected to the Solution Manager.
    However, if there are clients the you would not like to connect to Solman on purpose, he can simply set the execution status to “manually performed”, then the activity will be set to green. I have attached some screen shots from a test system so you can see what I mean.
    Best Regards
    Mark

  • 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.

  • Best way to ask user for duration ??

    I am wondering what the best way to set up a dialog to ask the user for a duration is ?
    I need to query the user for the following duration example 1 month 3 days 5 hours 15 mins
    I have tried messing around with JSpinners with date formats but they really only work with fixed calendar dates not calendar durations...
    Any ideas on a neat approach..
    Currently i have an individual number spinner for each of the items which looks ugly and is hard to manage as you have to take care of up to 23 hours but 24 is one day so one day etc etc..
    Thanks in advance
    -Alan

    You continue along the same lines; keep the DTO in the session as an attribute. When you display your JSP, read the appropriate values for choices from the DTO and set your checkboxes/ radio buttons to 'selected' if they should be.
    When the page is submitted, read the parameters from the form submit and update your session attribute ( DTO ) to reflect any changes the user might have made like selecting a new option or deselecting a previously selected one.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • OS users for Data Service and Information Platform Service

    Hello experts,
    We will install SAP Data Server 4.2 Support Package 2 which required Information Platform Service to be installed before.
    Can we use the same operating system user boadm for both software installation and maintenance.
    Thanks & Best Regards,
    Tong Ning

    Hello Dirk Venken,
    Thanks!
    What is the best practice about the uses required for Data Service and IPS? (in one user or two different user.)
    Regards,
    Tong Ning

  • Asking user for value to resize?

    Hello guys. I want to make a quick script that will take the selected finder item, ask the user for a value to resize (In the form of a dialog box) and then using that percentage, execute the scale image function under preview. Does anyone know how I could do this? Thanks!

    Get Selected Finder Items
    Scale Image (Preview Library, check the "show when run" option)
    As written here, this works on the original. Put a Copy Finder items in Place of Get Selected Finder items if you want to work on a copy.
    Kevin

  • 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);

  • Prompt user for date range

    Im working on a report that when it is opened by end user, i want it to prompt them for a date range. The report should only show records that fall between the date ranges entered.
    If i use the select expert and hardcode specific dates in, it works and only shows the records i want to see. However i cannot figure out how to set Crystal to prompt the user to enter the in DateTime and the to Date Time fields with Select Expert.
    Ive tried using a Parameter field, which it prompts for the date range, but still pulls up all records as normal. Its like it ignores the date range the user enters.
    The select expert shows this formula, the date/time is all zero's in this example.
    {SHOP_ORD\.REVISED_START_DATE} in DateTime (0, 0, 0, 00, 00, 00) to DateTime (0, 0, 0, 00, 00, 00)
    Please help

    Figured it out.
    Had to create two Parameter Fields {?StartDate} and {?EndDate}.
    Then used Select Expert, Formula Editor to modify the formula and set the in DateTime = {?StartDate} and the to DateTime = {?EndDate}
    This works. Just hide the Parameter fields and you have your range selector

  • Cant get IMAQ write file 2 to ask user for the path.

    I am currently using an IMAQ write file 2 to create a .bmp image. I have the VI attached to a control path that allows the user to enter the path where they want to save the file. However I dont want the user to have to make sure they typed the path in before the IMAQ write file executes. I want the program to work so that when the IMAQ write file executes a window appears asking the user where they would like to save the file. If someone could help me out I would appreciate it thanks.
    Solved!
    Go to Solution.

    Use the File dialog VI under File I/O >> Advanced File Functions palette

  • Ask user for input after Workflow has already started?

    I am in the process of creating an "expense report" declarative workflow in Designer. I want to have it start automatically when a new document (here, an Excel file) is uploaded to the Library. I also want some user input (e.g. "Is this
    ER urgent?"). Is there a way to this without requiring the workflow to start manually?

    You can have required information as metadata on your library and user needs to fill those information. You read that information in your workflow.
    Amit

  • Creating folders for data files on a Mac

    On a Mac platform, I am interested in trying to programically create
    folders (named by the user) for data files to be placed in. How can
    this be done? Currently, if I send a path that includes new folders
    that don't exist to the Write to Spreadsheet.vi, I get an error 7 (new
    files don't exist). However if I manually create the folders before
    executing the VI, the files are written correctly. How can I avoid this
    last step. Any help would be greatly appreciated and I thank you in
    advance.
    Jon Caldwell
    Biomedical Engineering, CSUS
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    Figured it out...disregard message.
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

  • Approval Activation for data import

    Hi,
    I will be importing my sales order, purchase order, GRPO and Delivery through DTW. However I want all these transactions to be subject to approvals. But when I imported a PO through DTW it bypassed the approval procedures. Please let me know if this is how it works or I need to change the way I am importing the transaction.
    Thanks

    Dear Kapil,
    You just restrict user for data import but In standeard system you cant set approval for data import.
    REGARDS
    MANGESH PAGDHARE.

  • Issue with xsd Data type mapping for collection of user defined data type

    Hi,
    I am facing a issue with wsdl for xsd mapping for collection of user defined data type.
    Here is the code snippet.
    sample.java
    @WebMethod
    public QueryPageOutput AccountQue(QueryPageInput qpInput)
    public class QueryPageInput implements Serializable, Cloneable
    protected Account_IO fMessage = null;
    public class QueryPageOutput implements Serializable, Cloneable
    protected Account_IO fMessage = null;
    public class Account_IO implements Serializable, Cloneable {
    protected ArrayList <AccountIC> fintObjInst = null;
    public ArrayList<AccountIC>getfintObjInst()
    return (ArrayList<AccountIC>)fintObjInst.clone();
    public void setfintObjInst(AccountIC val)
    fintObjInst = new ArrayList<AccountIC>();
    fintObjInst.add(val);
    Public class AccountIC
    protected String Name;
    protected String Desc;
    public String getName()
    return Name;
    public void setName(String name)
    Name = name;
    For the sample.java code, the wsdl generated is as below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions
    name="SimpleService"
    targetNamespace="http://example.org"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    >
    <wsdl:types>
    <xs:schema version="1.0" targetNamespace="http://examples.org" xmlns:ns1="http://example.org/types"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://example.org/types"/>
    <xs:element name="AccountWSService" type="ns1:accountEMRIO"/>
    </xs:schema>
    <xs:schema version="1.0" targetNamespace="http://example.org/types" xmlns:ns1="http://examples.org"
    xmlns:tns="http://example.org/types" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://examples.org"/>
    <xs:complexType name="queryPageOutput">
    <xs:sequence>
    <xs:element name="fSiebelMessage" type="tns:accountEMRIO" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="accountEMRIO">
    <xs:sequence>
    <xs:element name="fIntObjectFormat" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageType" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageId" type="xs:string" minOccurs="0"/>
    <xs:element name="fIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fOutputIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fintObjInst" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="queryPageInput">
    <xs:sequence>
    <xs:element name="fPageSize" type="xs:string" minOccurs="0"/>
    <xs:element name="fSiebelMessage" type="tns:accountEMRIO" minOccurs="0"/>
    <xs:element name="fStartRowNum" type="xs:string" minOccurs="0"/>
    <xs:element name="fViewMode" type="xs:string" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.org" xmlns:ns1="http://example.org/types">
    <import namespace="http://example.org/types"/>
    <xsd:complexType name="AccountQue">
    <xsd:sequence>
    <xsd:element name="arg0" type="ns1:queryPageInput"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="AccountQue" type="tns:AccountQue"/>
    <xsd:complexType name="AccountQueResponse">
    <xsd:sequence>
    <xsd:element name="return" type="ns1:queryPageOutput"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="AccountQueResponse" type="tns:AccountQueResponse"/>
    </schema>
    </wsdl:types>
    <wsdl:message name="AccountQueInput">
    <wsdl:part name="parameters" element="tns:AccountQue"/>
    </wsdl:message>
    <wsdl:message name="AccountQueOutput">
    <wsdl:part name="parameters" element="tns:AccountQueResponse"/>
    </wsdl:message>
    <wsdl:portType name="SimpleService">
    <wsdl:operation name="AccountQue">
    <wsdl:input message="tns:AccountQueInput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
    ns1:Action=""/>
    <wsdl:output message="tns:AccountQueOutput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
    ns1:Action=""/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="SimpleServiceSoapHttp" type="tns:SimpleService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="AccountQue">
    <soap:operation soapAction=""/>
    <wsdl:input>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SimpleService">
    <wsdl:port name="SimpleServicePort" binding="tns:SimpleServiceSoapHttp">
    <soap:address location="http://localhost:7101/WS-Project1-context-root/SimpleServicePort"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    In the above wsdl the collection of fintObjInst if of type xs:anytype. From the wsdl, I do not see the xsd mapping for AccountIC which includes Name and Desc. Due to which, when invoking the web service from a different client like c#(by creating proxy business service), I am unable to set the parameters for AccountIC. I am using JAX-WS stack and WLS 10.3. I have already looked at blog http://weblogs.java.net/blog/kohlert/archive/2006/10/jaxws_and_type.html but unable to solve this issue. However, at run time using a tool like SoapUI, when this wsdl is imported, I am able to see all the params related to AccountIC class.
    Can some one help me with this.
    Thanks,
    Sudha.

    Did you try adding the the XmlSeeAlso annotation to the webservice
    @XmlSeeAlso({<package.name>.AccountIC.class})
    This will add the schema for the data type (AccountIC) to the WSDL.
    Hope this helps.
    -Ajay

Maybe you are looking for

  • How can I download an iMix into a separate playlist?

    Everytime I download an iMix, the songs are scattered all over my iTunes library. Other than recreating the iMix by creating a new playlist and then individually dragging each of the songs into the new playlist, is there any way that this can be done

  • Open a new table or chart on clicking on "Input field" - Urgent

    Hi all, I have a form view that contains many input fields. Is it possible to open a new table or a chart if an input field is clicked? If yes then how? Please respond. Regards, Aisha Ishrat ICI Pakistan Ltd.

  • ORA-01436 : CONNECT BY loop  - is sequence of keys important?

    Hi everyone I'm seeing an ORA-01436 error - CONNECT BY loop in user data - when I'm running the query below: select distinct(pose.organization_id_child) from per_org_structure_elements pose where pose.org_structure_version_id = (select posv.org_struc

  • Structure for OM

    Hi , I want to know that like there is a common structure for an Employees Personnel Administration infotypes 'PRELP' wherein I can check that for each employee which Infotypes exist and I can update that likewise I want to know that is there also a

  • Delta Mechanisms in LIS,LO

    Hi BW Guru's Plz help me How the Delta works for LIS and LO Extractors? Tell me about the v1,v2 and v3 updates. Plz explain the flow(back ground Mechanism)? thanks in advance regards Ravi Pradeep P