Package org.metrapp.api

Source Code of org.metrapp.api.Facade

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package org.metrapp.api;

import java.io.File;
import org.metrapp.dataModel.DataFrame;
import org.metrapp.dataModel.StringDataFrame;
import org.metrapp.filters.Filter;
import org.metrapp.io.Loader;
import org.metrapp.sys.Controller;
import rcaller.RCaller;
import rcaller.RCode;

/**
*
* @author Ilija
*/
public class Facade {
   
    private Loader loader;
    private RCaller caller;
    private RCode code;
   
    public Facade(){
        loader = new Loader();
        caller = new RCaller();
        code = new RCode();
    }
    //AT THIS POINT ZHR AND POPULATION INDEX FIELDS SHOULD BE IMPLEMENTED; WAITING FOR R CODE, THIS FACADE WILL LOAD DATA FROM GIVEN LOCATION AND APPLY FILTER WHICH USER HAS SELECTED

    public boolean executeClientRequest (String fileLocation, Filter filterFromClient){
 
        Controller.getInstance().initializeBasic(caller, code);
       
        loader.loadFile(fileLocation, caller, code);
        File xmlDocument = caller.getParser().getXMLFile();       

        DataFrame df = new StringDataFrame();
        df.createDataFrameAndFillItWithData(xmlDocument);
        Controller.getInstance().updateDataFrame(df);
       
        Filter filter = filterFromClient;
        
        filter.filterData(df, caller, code, null);
       
        //RESULT SHOULD BE PASSED TO CLIENT AS XML
        return true;
    }
}
TOP

Related Classes of org.metrapp.api.Facade

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.