// Path: src/main/java/com/restfiddle/dao/NodeRepository.java
// public interface NodeRepository extends RfRepository<BaseNode, String> {
//     
//     @Query("{ 'parentId' : ?0 }")
//     public List<BaseNode> getChildren(String nodeId);
// 
//     @Query("{ 'projectId' : ?0 }")
//     public List<BaseNode> findNodesFromAProject(String projectId);
// 
//     @Query("{ 'projectId' : ?0 ,$or : [{name : { $regex : ?1, $options: 'i' }},{ nodeType : {$exists: true}}]}")
//     public List<BaseNode> searchNodesFromAProject(String projectId, String search);
//     
//     @Query("{ 'projectId' : ?0 , nodeType : {$exists:false}, name : { $regex : ?1, $options: 'i' }} }")
//     public List<BaseNode> findRequestsFromAProject(String projectId, String search);
//   
//     @Query("{'workspaceId' : ?0, 'starred' : true , name : { $regex : ?1, $options: 'i'}}")
//     public Page<BaseNode> findStarredNodes(String workspaceId, String search, Pageable pageable);
// 
//     @Query("{ 'tags' : ?0 }")
//     public Page<BaseNode> findTaggedNodes(String tagId, Pageable pageable);
// 
//     @Query("{ 'tags' : ?0 , $or : [{name : { $regex : ?1, $options: 'i' }},{ nodeType : {$exists: true}}]}")
//     public Page<BaseNode> searchTaggedNodes(String tagId, String search, Pageable pageable);
//     
//     @Query("{ 'workspaceId' : ?0, 'nodeType' : 'PROJECT', name : { $regex : ?1, $options: 'i'}}")
//     public List<BaseNode> findProjectsfromAWorkspace(String workspaceId, String search);
// }


import io.swagger.models.HttpMethod;
import io.swagger.models.Info;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.Swagger;
import io.swagger.models.parameters.Parameter;
import io.swagger.parser.SwaggerParser;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.restfiddle.constant.NodeType;
import com.restfiddle.dao.NodeRepository;
import com.restfiddle.dto.ConversationDTO;
import com.restfiddle.dto.FormDataDTO;
import com.restfiddle.dto.NodeDTO;
import com.restfiddle.dto.RfHeaderDTO;
import com.restfiddle.dto.RfRequestDTO;
import com.restfiddle.entity.BaseNode;
import com.restfiddle.entity.Project;
import com.restfiddle.util.TreeNode;
/*
 * Copyright 2015 Ranjan Kumar
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.restfiddle.controller.rest;





@RestController
@Transactional
public class ImportController {
    Logger logger = LoggerFactory.getLogger(ImportController.class);

    @Autowired
    private NodeController nodeController;

    @Autowired
    private ConversationController conversationController;

    @Autowired
    private ProjectController projectController;

    @Autowired
// Path: src/main/java/com/restfiddle/dao/NodeRepository.java
// public interface NodeRepository extends RfRepository<BaseNode, String> {
//     
//     @Query("{ 'parentId' : ?0 }")
//     public List<BaseNode> getChildren(String nodeId);
// 
//     @Query("{ 'projectId' : ?0 }")
//     public List<BaseNode> findNodesFromAProject(String projectId);
// 
//     @Query("{ 'projectId' : ?0 ,$or : [{name : { $regex : ?1, $options: 'i' }},{ nodeType : {$exists: true}}]}")
//     public List<BaseNode> searchNodesFromAProject(String projectId, String search);
//     
//     @Query("{ 'projectId' : ?0 , nodeType : {$exists:false}, name : { $regex : ?1, $options: 'i' }} }")
//     public List<BaseNode> findRequestsFromAProject(String projectId, String search);
//   
//     @Query("{'workspaceId' : ?0, 'starred' : true , name : { $regex : ?1, $options: 'i'}}")
//     public Page<BaseNode> findStarredNodes(String workspaceId, String search, Pageable pageable);
// 
//     @Query("{ 'tags' : ?0 }")
//     public Page<BaseNode> findTaggedNodes(String tagId, Pageable pageable);
// 
//     @Query("{ 'tags' : ?0 , $or : [{name : { $regex : ?1, $options: 'i' }},{ nodeType : {$exists: true}}]}")
//     public Page<BaseNode> searchTaggedNodes(String tagId, String search, Pageable pageable);
//     
//     @Query("{ 'workspaceId' : ?0, 'nodeType' : 'PROJECT', name : { $regex : ?1, $options: 'i'}}")
//     public List<BaseNode> findProjectsfromAWorkspace(String workspaceId, String search);
// }


// Path: src/main/java/com/restfiddle/controller/rest/ImportController.java
import io.swagger.models.HttpMethod;
import io.swagger.models.Info;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.Swagger;
import io.swagger.models.parameters.Parameter;
import io.swagger.parser.SwaggerParser;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.restfiddle.constant.NodeType;
import com.restfiddle.dao.NodeRepository;
import com.restfiddle.dto.ConversationDTO;
import com.restfiddle.dto.FormDataDTO;
import com.restfiddle.dto.NodeDTO;
import com.restfiddle.dto.RfHeaderDTO;
import com.restfiddle.dto.RfRequestDTO;
import com.restfiddle.entity.BaseNode;
import com.restfiddle.entity.Project;
import com.restfiddle.util.TreeNode;

/*
 * Copyright 2015 Ranjan Kumar
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.restfiddle.controller.rest;





@RestController
@Transactional
public class ImportController {
    Logger logger = LoggerFactory.getLogger(ImportController.class);

    @Autowired
    private NodeController nodeController;

    @Autowired
    private ConversationController conversationController;

    @Autowired
    private ProjectController projectController;

    @Autowired
    private NodeRepository nodeRepository;