package mobi.droidcloud.mgmt.server;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.mortbay.log.Log;

import com.isomorphic.datasource.DSRequest;
import com.isomorphic.datasource.DSResponse;
import com.isomorphic.datasource.DataSource;

public class TreeDMI {
	public DSResponse fixRootNodes(DSRequest dsRequest,
			HttpServletRequest servletRequest) throws Exception {
		DSResponse resp = dsRequest.execute();
		if (DataSource.isFetch(dsRequest.getOperationType()) &&
			dsRequest.getOperationId().equals("domain_DataSource_fetch") &&
			dsRequest.getComponentId().equals("isc_TreeGrid_0")) {
			List l = resp.getDataList();
			Log.debug("Returning "+l.size() + " records of type "+l.get(0).getClass().getName());
		}
		return resp;
	}
}
