Please disable your adblock and script blockers to view this page

Search this blog

Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Wednesday 19 April 2017

Get af:richTextEditor value without HTML formatting and tags using jsoup library



af:richTextEditor
is used to format text in rich text using HTML formatting and it is used to get the formatted text. Previously I have posted about it
Cool Component - Using af:richTextEditor as text editor, HTML editor with custom toolbox in Oracle ADF

Tuesday 7 March 2017

Post to twitter using Twitter4J API in Oracle ADF and Java


Hello All

In this post I am talking about how to post a tweet on your twitter timeline using Twitter4J Java API in your Oracle ADF Application
Using this API makes the process very simple , For accessing twitter we need Twitter API keys, It is called Consumer Key and Access Token

For this you need a twitter account and then follow these steps

Thursday 2 March 2017

Generate permanent Facebook Page Access Token to access Graph API


Hello All,
Hope you are doing well

Earlier I have posted about using facebook graph api to get profile information, post status on facebook timeline and post as facebook page.

To Access Facebook graph API we need to use Access Token and each access token has it's expiry time (temporary access tokens) but to build an application we need a permanent access token so that our app doesn't stop working after a time and it is not very easy to get a permanent access token , there are some steps you need to follow to get one

Saturday 11 February 2017

Post Status on Facebook Timeline using restfb Graph API in ADF & Java

Hello All

Previous post was about generating temporary access token and using it get Facebook profile detail usinf restfb Graph API , Go through previous post before this as graph api basics are described in that post

Now In this post I am talking about posting facebook status update so for this I am extending same sample application

Wednesday 1 February 2017

Export ViewObject data to PDF file using Apache PDFBox

Hello All
Hope you all are doing well :)

This post is about exporting view object data in a pdf file directly from af:table , export to excel is built in feature of ADF but exporting data in PDF requires little bit of extra effort
So here for this requirement I am using Apache PDFBox library , previously I have posted about using this API to create PDF file from text data
I know many of you will not visit that link ;) So a quick overview

Friday 30 October 2015

Read data from Google Spreadsheet without authentication using Java

Google Spreadsheets provides a way to create, edit, save spreadsheets online.
The Google Sheets API (formerly called the Google Spreadsheets API) lets you develop client applications that read and modify worksheets and data in Google Sheets.
Read More about Sheets API

Let's see how to use this API to read data from Spreadsheet, here i am going to use Spreadsheet version 3.0 , if this link doesn't work then check on GitHub , from here you will get  client library for all Google APIs

Monday 19 October 2015

Get domain information (WHOIS) using Apache Commons Net API- ADF & Java

We can get any domain information using Apache commons net library. It supports various protocols and WHOIS information is one of them

WhoisClient class provides access of domain information
See what docs says -

The WhoisClient class implements the client side of the Internet Whois Protocol defined in RFC 954. To query a host you create a WhoisClient instance, connect to the host, query the host, and finally disconnect from the host. If the whois service you want to query is on a non-standard port, connect to the host at that port.

Download required library or if this link doesn't work then goto API page and download from there

This simple java method will fetch information of domain using Apache library

Monday 12 January 2015

Send eMail and attachement from any SMTP server using JavaMail in Oracle ADF


The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications- JavaMail API

This post is about sending eMail and attachments from any SMTP (Simple Mail Transfer Protocol) as Gmail or any other server (mail.awasthiashish.com)
You can read my previous post about mail integration with ADF that was specifically about using Gmail Server
Gmail Integration with Oracle ADF using Java Mail API 

So all basic configuration is described in previous post , now in this post i am only writing a java method to send mail and attachments


Don't forget to download these 2 jar files
  1.mail.jar 2. Activation.jar- Download
Add both jar files to project library path and then use this method 
Necessary packages to import -


import java.util.ArrayList;
import java.util.Properties;

import javax.activation.DataHandler;
import javax.activation.DataSource;

import javax.activation.FileDataSource;

import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.NoSuchProviderException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;


Helper method (JavaCode) to send simple eMail and eMail with attachment-

    /**Method to send mail from any SMTP server using JavaMail API
     * Provide Correct Parameters
     * @return
     * @param msg- Email Message Body
     * @parsm subject- Subject of Email
     * @param FromUser- Email Id of Sender
     * @param ToUser- Email Id of Reciever
     * @param pwd- Password of sender's email address
     * @param hostName- Host Name of Mail server (smtp.gmail.com)
     * @param isAnyAtchmnt- "Y" for yes there is an attachement and "N" for no attachment
     * @param fileNamePath- abolute path of file on server if there is any attachement
     */
    public String sendMail(String msg, String subject, String FromUser, ArrayList<String> ToUser, String pwd,
                           String hostName, String isAnyAtchmnt, ArrayList<String> fileNameNPath) {
        // Setting Properties
        Properties emailProperties = new Properties();
        emailProperties.put("mail.smtp.host", hostName);
        emailProperties.put("mail.smtp.auth", "true");
        emailProperties.put("mail.smtp.starttls.enable", "true");
        //Login Credentials
        final String user = FromUser; //change accordingly
        final String password = pwd; //change accordingly
        //Authenticating...
        Session session = Session.getInstance(emailProperties, new javax.mail.Authenticator() {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(user, password);
            }
        });

        //1) create MimeBodyPart object and set your message content
        MimeMessage message = new MimeMessage(session);
        try {
            message.setFrom(new InternetAddress(user));
            for (String email : ToUser) {
                System.out.println("Mail Id is-" + email);
                message.addRecipient(Message.RecipientType.TO, new InternetAddress(email));
            }
            message.setSubject(subject);

            BodyPart messageBody = new MimeBodyPart();

            messageBody.setContent(msg, "text/html");

            // If there is any attachment to send
            //5) create Multipart object and add MimeBodyPart objects to this object
            Multipart multipart = new MimeMultipart();
            multipart.addBodyPart(messageBody);

            if ("Y".equalsIgnoreCase(isAnyAtchmnt)) {
                //2) create new MimeBodyPart object and set DataHandler object to this object


                for (String path : fileNameNPath) {
                    MimeBodyPart messageBodyPart2 = new MimeBodyPart();
                    System.out.println("Exact path--->" + path);
                    DataSource source = new FileDataSource(path);
                    messageBodyPart2.setDataHandler(new DataHandler(source));
                    // System.out.println("FileName is-"+path.substring(path.lastIndexOf("//")+1, path.length()));
                    messageBodyPart2.setFileName(path.substring(path.lastIndexOf("//") + 2, path.length()));
                    multipart.addBodyPart(messageBodyPart2);
                }

                //6) set the multiplart object to the message object
                message.setContent(multipart);
                message.saveChanges();
            }
            //If there is plain eMail- No Attachment
            else {
                message.setContent(msg, "text/html"); //for a html email
            }
        } catch (MessagingException e) {
        }

        Transport transport = null;


        try {
            transport = session.getTransport("smtp");
        } catch (NoSuchProviderException e) {
            System.out.println("No such Provider Exception");
        }

        try {
            transport.connect(hostName, FromUser, pwd);
            transport.sendMessage(message, message.getAllRecipients());
            transport.close();

            System.out.println("Email sent successfully.");
            return "Y";
        } catch (MessagingException e) {
            System.out.println("Messaging Exception" + e);
            return "N";
        }

    }


Call this method in your ADF Application to send simple mail or mail with attachment, this is just like plug n play , provide correct parameters and use

Thanks :) Happy Learning

Monday 20 October 2014

Send SMS from Oracle ADF Application using Horizon SMS API

This post is about using SMS API to send SMS text to mobile from an Oracle ADF application
there are various SMS Gateway to send SMS using java and all java API's can be used with Oracle ADF

here i am using sms horizon (a bulk sms provider in india) see this SMS API integration with Java and Oracle ADF, follow the steps
First create an account with SMS Horizon - http://www.smshorizon.in/ or User Login- SMS Horizon

you can purchase a trial package to test your code, they provide 200 sms for Rs 25 only. So After purchasing trial pack you will get and API Key and username



Login to your account and see your dashboard-



you will see your API key in this type of box-



Now first step is complete and second and last step is implement code in your managed bean
you can find Sample API files (code to use API in Java, C#, PHP etc) from there

So for this i have a created a Fusion Web Application and a page in it


created a managed bean and actionListener for this Send button
this url is used to send sms and it returns msgId of sent message

http://smshorizon.co.in/api/sendsms.php?user=******&apikey=*****8&mobile=xxyy&message=xxyy&senderid=xxyy&type=txt


See the ActionListener code -


    /**Method to send SMS using SMS Horizon API
     * @param actionEvent
     */
    public void sendSMSAction(ActionEvent actionEvent) {
        // get mobile number value using component binding
        if (mobNoBind.getValue() != null) {
            // Replace with your username
            String user = "userId";

            // Replace with your API KEY (We have sent API KEY on activation email, also available on panel)
            String apikey = "your_api_key";

            // Replace with the destination mobile Number to which you want to send sms
            String mobile = mobNoBind.getValue().toString();

            // Replace if you have your own Sender ID, else donot change
            String senderid = "WEBSMS";

            // Replace with your Message content
            String message = "SMS API -Oracle ADF";

            // For Plain Text, use "txt" ; for Unicode symbols or regional Languages like hindi/tamil/kannada use "uni"
            String type = "txt";

            //Prepare Url
            URLConnection myURLConnection = null;
            URL myURL = null;
            BufferedReader reader = null;

            //encoding message
            String encoded_message = URLEncoder.encode(message);

            //Send SMS API
            String mainUrl = "http://smshorizon.co.in/api/sendsms.php?";

            //Prepare parameter string
            StringBuilder sbPostData = new StringBuilder(mainUrl);
            sbPostData.append("user=" + user);
            sbPostData.append("&apikey=" + apikey);
            sbPostData.append("&message=" + encoded_message);
            sbPostData.append("&mobile=" + mobile);
            sbPostData.append("&senderid=" + senderid);
            sbPostData.append("&type=" + type);

            //final string
            mainUrl = sbPostData.toString();
            System.out.println("URL to Send SMS-" + mainUrl);
            try {
                //prepare connection
                myURL = new URL(mainUrl);
                myURLConnection = myURL.openConnection();
                myURLConnection.connect();
                reader = new BufferedReader(new InputStreamReader(myURLConnection.getInputStream()));
                //reading response
                String response;
                while ((response = reader.readLine()) != null) {
                    //print response
                    System.out.println(response);
                }
                System.out.println(response);
                //finally close connection
                reader.close();


            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public void setMobNoBind(RichInputText mobNoBind) {
        this.mobNoBind = mobNoBind;
    }

    public RichInputText getMobNoBind() {
        return mobNoBind;
    }

you can check status of each SMS in your account that it is delivered of not, other than this you can also check status of msg in your code also using this url

http://smshorizon.co.in/api/status.php?user=*****&apikey=*********&msgid=xxyy

pass msgId returned from previous url and it will return you status of message as- PENDING , DELIVERED etc
see imports used in code-


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

import javax.faces.event.ActionEvent;

import oracle.adf.view.rich.component.rich.input.RichInputText;

Thanks :) Happy Learning

Friday 9 August 2013

Creating pdf file using Apache PDFBox API in ADF Faces and opening it in new window -Oracle ADF

Apache PDFBox library is an open source java tool for working with PDF documents, go to http://pdfbox.apache.org/ for API docs and download jar (pdfbox-app-1.8.2) from there.

  •  Now create a fusion web application and add jar to view controller project's library and class-path
  •  To convert text to pdf format, i have used an input text and bind it to bean (to get value)
  •  Now see the button code that converts text to pdf file format using Apache PDFBox

  •         PDDocument document = new PDDocument();
            PDPage page = new PDPage();
            document.addPage(page);
    
            // Create a new font object selecting one of the PDF base fonts
            PDFont font = getFontDef();
    
            // Start a new content stream which will "hold" the to be created content
            PDPageContentStream contentStream = new PDPageContentStream(document, page);
    
            // Define a text content stream using the selected font, moving the cursor and drawing the text "Hello World"
    
            contentStream.beginText();
            contentStream.setFont(font, 10);
            contentStream.moveTextPositionByAmount(50, 700);
            contentStream.drawString(textToConvert.getValue().toString());
            contentStream.endText();
    
            // Make sure that the content stream is closed:
            contentStream.close();
    
            // Save the results and ensure that the document is properly closed:
            try {
                document.save("D:/Test_pdf.pdf");
            } catch (COSVisitorException e) {
            }
            document.close();
    

  • now your pdf is generated in fixed path, and if user want to open it immediately , try to do this



  •         if ((new File("D:\\Hello World.pdf")).exists()) {
    
                Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler D:\\Hello World.pdf");
                p.waitFor();
    
            } else {
    
                System.out.println("File is not exists");
    
            }
    

  • this code invokes File Protocol using Runtime class
  • Run this application and see-
 Click on generate button-


For more details and functionality visit Apache PDFBox site
Sample ADF Application-Download

Thursday 20 June 2013

Bing language Translation API integration with Java- microsoft-translator-java-api

Google Translation is very popular and widely used for language translation as it is now paid service,
so i  came to know about Microsoft Translator (Bing Translator), it is providing free API up to 2000,000 character/Month to translate.

Key features and point-
  • Provides java wrapper around microsoft translator (Bing Translator)
  • Developed as alternative of Google Translator
  • Follow coding standard, naming, functionality and usage patterns of widely used google translation API
This is very very simple to use -Follow steps




  • First Download JAR for API- http://code.google.com/p/microsoft-translator-java-api/  with all dependencies
  • Now obtain client secret key and client id in order to access API , see this http://msdn.microsoft.com/en-us/library/hh454950.aspx
  • After this create a simple java class and just write this code-
  • Don't forget to add JAR in your project's class path

  • package translation;
    
    import com.memetix.mst.language.Language;
    import com.memetix.mst.translate.Translate;
    
    public class MicrosoftTranslator {
        public static void main(String[] args) throws Exception {
            
            Translate.setClientId("secret client id");
            Translate.setClientSecret("secret key");
    
    
            String translatedText = Translate.execute("hello", Language.ENGLISH, Language.FRENCH);
            System.out.println(translatedText);
        }
    }
    

  • Enter your key and id in code, you can change language with available list, and run this code
  • To use this in web application , you must handle SSL certificate

Sunday 16 June 2013

Using Java API for getting Weather information in Oracle ADF-wunderground-core

hello everyone, here is nice tutorial for all ADF techies-
i have developed an application in ADF that retrieves weather information of a country's weather stations.
as-temperature, humidity, dew, rain rate, wind speed etc using wunderground-core 
API . This API fetch weather data for a weater station by given month and year or data for all the stations of a country.

Feature of this wunderground-core-
  1. Very simple to use
  2. Date Listener support
  3. Fetch weather data for all stations of country
  4. can be used with desktop or web application
  5. Ajax supported
  6. Real Time weather values
Snap-
 Change Country-

and download jar distribution with all dependencies

  • Now start , create a fusion web application and add jar file to  classpath
  • Now create a bounded taskflow and a .jsff page inside this , now see the simple code to get all weather station of acountry and their weather data

  •         /*  create an instance of WeatherStationService */
            WeatherStationService weatherStationService = new WeatherStationService();
    
            /*  find all weather stations */
            List<WeatherStation> stations = weatherStationService.findAllWeatherStationsByCountry("INDIA");
    
            
            for (WeatherStation weatherStation : stations) {
                System.out.println(weatherStation.getStationId() + "\t" + "\t" + weatherStation.getCity() + "\t" +
                                   weatherStation.getCountry());
    
                HttpDataReaderService dataReader = new HttpDataReaderService();
                dataReader.setWeatherStation(weatherStation);
                DataSet current = dataReader.getCurrentData();
    
                System.out.println(current.getDateTime() + "Temperature- " + current.getTemperature() + "Humidity-" +
                                   current.getHumidity());
    

  • I have used this code on my af:commandButton for getting weather data, and a table on page to show this information on page using list (arrayList) , rest is same and simple like other ADF Application
  • Download Sample Application and see it, you will also learn that how to show a table using List(Java) Sample ADF Application




  • See source of .jsff page for tables'use and values-

  • <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
        <af:panelBox text="Weather Report App-www.javadrive.co.in" id="pb1" showDisclosure="false">
            <f:facet name="toolbar"/>
            <af:panelFormLayout id="pfl1">
                <af:inputText label="Country Name" id="it1"
                              contentStyle="text-transform:upperCase;color:green;font-weight:bold;"
                              binding="#{WeatherReportBean.cntryNameBind}"/>
                <af:commandButton text="Get Report" id="cb1" actionListener="#{WeatherReportBean.getWeatherReportButton}"
                                  inlineStyle="font-weight:bold;"/>
            </af:panelFormLayout>
            <af:popup childCreation="deferred" autoCancel="disabled" id="p1">
                <af:dialog id="d1" title="User-User4" type="none">
                    <f:facet name="buttonBar"/>
                    <af:message id="m1" message="You are not authorize to make an order of 25000, your limit is 20000 !!!"
                                messageType="error"/>
                </af:dialog>
            </af:popup>
            <af:panelGroupLayout id="pgl1" layout="horizontal">
                <af:table var="row" rowBandingInterval="1" id="t1" value="#{WeatherReportBean.stations}"
                          partialTriggers="::cb1" contentDelivery="immediate" width="500">
                    <af:column sortable="false" headerText="Country" id="c3">
                        <af:spacer width="10" height="10" id="s2"/>
                        <af:outputText value="#{row.country}" id="ot3" inlineStyle="font-weight:bold;color:red;"/>
                        <af:spacer width="10" height="10" id="s1"/>
                    </af:column>
                    <af:column sortable="false" headerText="Locality" id="c4" width="150">
                        <af:outputText value="#{row.neighborhood}" id="ot4"/>
                    </af:column>
                    <af:column sortable="false" headerText="City" id="c2">
                        <af:outputText value="#{row.city}" id="ot2" inlineStyle="font-weight:bold;color:darkgreen;"/>
                    </af:column>
                    <af:column sortable="false" headerText="Station Id" id="c1">
                        <af:outputText value="#{row.stationId}" id="ot1" inlineStyle="font-weight:bold;color:darkblue;"/>
                    </af:column>
                </af:table>
                <af:table value="#{WeatherReportBean.reportL}" var="row" rowBandingInterval="1" id="t2"
                          contentDelivery="immediate" partialTriggers="::t1 ::cb1" styleClass="AFStretchWidth" width="800">
                    <af:column sortable="false" headerText="Date" align="start" id="c5">
                        <af:spacer width="10" height="10" id="s4"/>
                        <af:outputText value="#{row.currDate}" id="ot5" inlineStyle="font-weight:bold;">
                            <af:convertDateTime pattern="dd/MMM/yyyy"/>
                        </af:outputText>
                        <af:spacer width="10" height="10" id="s3"/>
                    </af:column>
                    <af:column sortable="false" headerText="Temperature" align="end" id="c6" width="70">
                        <af:outputText value="#{row.temp} C" id="ot6" inlineStyle="font-weight:bold;color:teal;"/>
                    </af:column>
                    <af:column id="c7" headerText="Humidity" align="right" width="70">
                        <af:outputText value="#{row.humid}" id="ot7" inlineStyle="font-weight:bold;color:orange;"/>
                    </af:column>
                    <af:column id="c8" headerText="Dew Point" align="right" width="70">
                        <af:outputText value="#{row.dewR}" id="ot8" inlineStyle="font-weight:bold;color:green;"/>
                    </af:column>
                    <af:column id="c9" headerText="Wind Direction" align="right" width="70">
                        <af:outputText value="#{row.windDirec}" id="ot9" inlineStyle="font-weight:bold; color:Olive;"/>
                    </af:column>
                    <af:column id="c10" headerText="Wind Speed (Km/H)" align="right">
                        <af:outputText value="#{row.windSpd}" id="ot10"
                                       inlineStyle="color:ActiveCaption;font-weight:bold;"/>
                    </af:column>
                    <af:column id="c11" headerText="Rain Rate" align="right" width="70">
                        <af:outputText value="#{row.rainRt}" id="ot11" inlineStyle="font-weight:bold;color:maroon;"/>
                    </af:column>
                    <af:column id="c12">
                        <af:image shortDesc="Weather" id="i1"
                                  source="#{row.temp >35 ? resource['images:sun.png'] : resource['images:sun_slush.png']}"/>
                    </af:column>
                </af:table>
            </af:panelGroupLayout>
        </af:panelBox>
    </jsp:root>
    

  • And see managed bean code to populate data in tables on page, other than manged bean i have used a java bean to populate value in list and then in table
  • WeatherReportBean.java

  • package weather.view.bean;
    
    import de.mbenning.weather.wunderground.api.domain.DataSet;
    import de.mbenning.weather.wunderground.api.domain.WeatherStation;
    import de.mbenning.weather.wunderground.impl.services.HttpDataReaderService;
    import de.mbenning.weather.wunderground.impl.services.WeatherStationService;
    
    import java.io.Serializable;
    
    import java.sql.SQLException;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import javax.faces.event.ActionEvent;
    
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    
    import oracle.jbo.domain.Date;
    
    public class WeatherReportBean implements Serializable {
        private RichInputText cntryNameBind;
    
        public WeatherReportBean() {
        }
        WeatherStationService weatherStationService = new WeatherStationService();
    
        List<WeatherStation> stations;
        List<Report> reportL;
    
    
        public void getWeatherReportButton(ActionEvent actionEvent) throws SQLException {
            if (cntryNameBind.getValue() != null) {
                String cntryName = cntryNameBind.getValue().toString();
    
                stations = weatherStationService.findAllWeatherStationsByCountry(cntryName);
                reportL = new ArrayList<Report>(50);
                for (WeatherStation weatherStation : stations) {
    
                    HttpDataReaderService dataReader = new HttpDataReaderService();
                    dataReader.setWeatherStation(weatherStation);
                    DataSet current = dataReader.getCurrentData();
    
                    java.util.Date b = new java.util.Date();
                    Double c = new Double(0);
                    Integer humidity = 0;
                    Double dew = new Double(0);
                    String windDir = "";
                    Double windSp = new Double(0);
                    Double rainRate = new Double(0);
    
                    if (current != null) {
                        if (current.getDateTime() != null) {
                            b = current.getDateTime();
                            c = current.getTemperature();
                            humidity = current.getHumidity();
                            dew = current.getDewPoint();
                            windDir = current.getWindDirection();
                            windSp = current.getWindSpeedKmh();
                            rainRate = current.getRainRateHourlyMm();
                            System.out.println("Humidity is-->" + current.getHumidity() + "dew point-->" +
                                               current.getDewPoint() + "wind -->" + current.getWindDirection() +
                                               "speed--" + current.getWindSpeedKmh());
    
    
                        }
                    }
    
                    reportL.add(new Report(b, c, humidity, dew, windDir, windSp, rainRate));
    
                }
    
    
            }
    
        }
    
        public void setStations(List<WeatherStation> stations) {
            this.stations = stations;
        }
    
        public List<WeatherStation> getStations() {
            return stations;
        }
    
        public void setReportL(List<Report> reportL) {
            this.reportL = reportL;
        }
    
        public List<Report> getReportL() {
            return reportL;
        }
    
        public void setCntryNameBind(RichInputText cntryNameBind) {
            this.cntryNameBind = cntryNameBind;
        }
    
        public RichInputText getCntryNameBind() {
            return cntryNameBind;
        }
    }
    

  • Report.java- bean class to populate list

  • package weather.view.bean;
    
    import java.util.Date;
    
    public class Report {
    
        private Date CurrDate;
        private double temp;
        Integer humid;
        Double dewR;
        String windDirec;
        Double windSpd;
        Double rainRt;
    
        public Report(Date date, Double double1, Integer hum, Double de, String windD, Double windS, Double Rain) {
            System.out.println("date is-->" + date + "and temp is-->" + double1);
    
            this.CurrDate = date;
            setTemp(double1);
            this.humid = hum;
            this.dewR = de;
            this.windDirec = windD;
            this.windSpd = windS;
            this.rainRt = Rain;
    
    
        }
    
    
        public void setCurrDate(Date CurrDate) {
            this.CurrDate = CurrDate;
        }
    
        public Date getCurrDate() {
            return CurrDate;
        }
    
        public void setTemp(double temp) {
            this.temp = temp;
        }
    
        public double getTemp() {
            return temp;
        }
    
        public void setHumid(Integer humid) {
            this.humid = humid;
        }
    
        public Integer getHumid() {
            return humid;
        }
    
        public void setDewR(Double dewR) {
            this.dewR = dewR;
        }
    
        public Double getDewR() {
            return dewR;
        }
    
        public void setWindDirec(String windDirec) {
            this.windDirec = windDirec;
        }
    
        public String getWindDirec() {
            return windDirec;
        }
    
        public void setWindSpd(Double windSpd) {
            this.windSpd = windSpd;
        }
    
        public Double getWindSpd() {
            return windSpd;
        }
    
        public void setRainRt(Double rainRt) {
            this.rainRt = rainRt;
        }
    
        public Double getRainRt() {
            return rainRt;
        }
    }