IoT CAS Frameworks/IOT_Server/Report_Generator_Framework/source/DashBoard-JSONgenerator-ArbitraryDate/src/com/merit/dashboard/Controller.java
private void runTheCode(String customerName, String timestampselection, String cCustomer, String service, String tomcat_home) {
        String sz_startDate = null;
        String sz_endDate = null;
        String start_endarray[] = DateGenerator.dateGenerator(timestampselection);
        sz_startDate = start_endarray[1];
        sz_endDate = start_endarray[0];

        //System.out.println(" Start---Date:" + start_endarray[1] + ";\n End-----Date:" + start_endarray[0] + ";\n CustomerID:" + customerName);
        log.debug(" Start---Date:" + start_endarray[1] + ";\n End-----Date:" + start_endarray[0] + ";\n CustomerID:" + customerName);

        //String[] types = DBUtilHelper.getMetrics_mapping_properties().getProperty("ResourceName").split(",");
        String[] types;
        String resTypes = DBUtilHelper.getMetrics_mapping_properties().getProperty("ResourceName");
        if (resTypes.contains(",")) {
            types = resTypes.split(",");
        } else {
            types = new String[1];
            types[0] = resTypes;
        }
        try {
            Set<String> comboSelection = null;
            DashBoardController list = null;
            for (int i = 0; i < types.length; i++) {
                log.debug("*************Starting " + types[i] + "**********************");
                // System.out.println("************Starting " + types[i] + "**********************");
                comboSelection = ServiceThreadListener.getJSONLocationSet(types[i]);
                for (String selection : comboSelection) {
                    list = new DashBoardController(types[i], cCustomer, service, selection, sz_startDate, sz_endDate, timestampselection,
                            customerName);
                    if (i == types.length - 1) {
                        list.generateDefaultServiceAndResourceType(types[i], cCustomer, service, sz_startDate, sz_endDate,
                                timestampselection, customerName);
                    }
                }
                System.out.println("List===>"+list.toString());
                list.generateJSONForLeftGrid(types[i], cCustomer, service, sz_startDate, sz_endDate, timestampselection, customerName);
                //device level derived jsons
                generatePerformanceJsons(customerName, cCustomer, service, types[i], timestampselection);

                //System.out.println("******************End of " + types[i] + "**********************");
                log.debug("***********************End of " + types[i] + "**********************");
               list = null;
            }
        } catch (Exception e) {
            log.error("IN DashBoardController some ERROR is here" + e.getMessage());
            e.printStackTrace();
        }
    }
/**
     * This method is used to call DashBoardController for generating different
     * types of JSON for Chart
     *
     * @param customerName customerId
     * @param timestampselection means (hour, days, week, month, year)
     * @param tomcat_home where you want to create a directory
     *
     */
This method is used to call DashBoardController for generating different
types of JSON for Chart

@param customerName customerId
@param timestampselection means (hour, days, week, month, year)
@param tomcat_home where you want to create a directory
This method is used to call DashBoardController for generating different types of JSON for Chart @param customerName customerId @param timestampselection means ( hour days week month year ) @param tomcat_home where you want to create a directory
private void runTheCode(String customerName, String timestampselection, String cCustomer, String service, String tomcat_home) {
        String sz_startDate = null;
        String sz_endDate = null;
        String start_endarray[] = DateGenerator.dateGenerator(timestampselection);
        sz_startDate = start_endarray[1];
        sz_endDate = start_endarray[0];
        log.debug(" Start---Date:" + start_endarray[1] + ";\n End-----Date:" + start_endarray[0] + ";\n CustomerID:" + customerName);
        String[] types;
        String resTypes = DBUtilHelper.getMetrics_mapping_properties().getProperty("ResourceName");
        if (resTypes.contains(",")) {
            types = resTypes.split(",");
        } else {
            types = new String[1];
            types[0] = resTypes;
        }
        try {
            Set<String> comboSelection = null;
            DashBoardController list = null;
            for (int i = 0; i < types.length; i++) {
                log.debug("*************Starting " + types[i] + "**********************");
                comboSelection = ServiceThreadListener.getJSONLocationSet(types[i]);
                for (String selection : comboSelection) {
                    list = new DashBoardController(types[i], cCustomer, service, selection, sz_startDate, sz_endDate, timestampselection,
                            customerName);
                    if (i == types.length - 1) {
                        list.generateDefaultServiceAndResourceType(types[i], cCustomer, service, sz_startDate, sz_endDate,
                                timestampselection, customerName);
                    }
                }
                System.out.println("List===>"+list.toString());
                list.generateJSONForLeftGrid(types[i], cCustomer, service, sz_startDate, sz_endDate, timestampselection, customerName);
                generatePerformanceJsons(customerName, cCustomer, service, types[i], timestampselection);
                log.debug("***********************End of " + types[i] + "**********************");
               list = null;
            }
        } catch (Exception e) {
            log.error("IN DashBoardController some ERROR is here" + e.getMessage());
            e.printStackTrace();
        }
    }
private void runTheCode ( String customerName , String timestampselection , String cCustomer , String service , String tomcat_home ) { String sz_startDate = null ; String sz_endDate = null ; String start_endarray [ ] = DateGenerator . dateGenerator ( timestampselection ) ; sz_startDate = start_endarray [ 1 ] ; sz_endDate = start_endarray [ 0 ] ; log . debug ( " Start---Date:" + start_endarray [ 1 ] + ";\n End-----Date:" + start_endarray [ 0 ] + ";\n CustomerID:" + customerName ) ; String [ ] types ; String resTypes = DBUtilHelper . getMetrics_mapping_properties ( ) . getProperty ( "ResourceName" ) ; if ( resTypes . contains ( "," ) ) { types = resTypes . split ( "," ) ; } else { types = new String [ 1 ] ; types [ 0 ] = resTypes ; } try { Set < String > comboSelection = null ; DashBoardController list = null ; for ( int i = 0 ; i < types . length ; i ++ ) { log . debug ( "*************Starting " + types [ i ] + "**********************" ) ; comboSelection = ServiceThreadListener . getJSONLocationSet ( types [ i ] ) ; for ( String selection : comboSelection ) { list = new DashBoardController ( types [ i ] , cCustomer , service , selection , sz_startDate , sz_endDate , timestampselection , customerName ) ; if ( i == types . length - 1 ) { list . generateDefaultServiceAndResourceType ( types [ i ] , cCustomer , service , sz_startDate , sz_endDate , timestampselection , customerName ) ; } } System . out . println ( "List===>" + list . toString ( ) ) ; list . generateJSONForLeftGrid ( types [ i ] , cCustomer , service , sz_startDate , sz_endDate , timestampselection , customerName ) ; generatePerformanceJsons ( customerName , cCustomer , service , types [ i ] , timestampselection ) ; log . debug ( "***********************End of " + types [ i ] + "**********************" ) ; list = null ; } } catch ( Exception e ) { log . error ( "IN DashBoardController some ERROR is here" + e . getMessage ( ) ) ; e . printStackTrace ( ) ; } }
This method is used to call DashBoardController for generating different
 types of JSON for Chart
This method is used to call DashBoardController for generating different types of JSON for Chart
//System.out.println(" Start---Date:" + start_endarray[1] + ";\n End-----Date:" + start_endarray[0] + ";\n CustomerID:" + customerName); //String[] types = DBUtilHelper.getMetrics_mapping_properties().getProperty("ResourceName").split(","); // System.out.println("************Starting " + types[i] + "**********************"); //device level derived jsons //System.out.println("******************End of " + types[i] + "**********************");