public void ConvertGraphsonToGremlin()
    {
        CosmosDbStructure data     = BridgeToGraphson.jsonToCosmosDBStructure(importedData.text);
        string            commands = GraphsonToGremlin.ObjectToGremlinConverter.StructureToQueryString(data);

        importedData.text = commands;
        //codeText.GetComponent<TMPro.TextMeshProUGUI>().text += commands;
    }
    public void LoadGraphson()
    {
        CosmosDbStructure data = BridgeToGraphson.jsonToCosmosDBStructure(importedData.text);

        HideLoadScene();

        // Create scene with graphson data
        sceneCreator.GenerateScene(data);
    }
    public void UploadToDB()
    {
        Transform  editObj    = uploadToDBPanel.transform.GetChild(0);
        InputField hostname   = editObj.Find("hostname Inputfield").GetComponent <InputField>();
        InputField port       = editObj.Find("port Inputfield").GetComponent <InputField>();
        InputField authKey    = editObj.Find("authKey Inputfield").GetComponent <InputField>();
        InputField database   = editObj.Find("database Inputfield").GetComponent <InputField>();
        InputField collection = editObj.Find("collection Inputfield").GetComponent <InputField>();

        Toggle dropDataToggle = editObj.Find("Drop Data Toggle").GetComponent <Toggle>();

        CosmosDbStructure structure = arrowExporter.SceneDataToCosmosDBStructure();
        //CosmosDbStructure data = BridgeToGraphson.jsonToCosmosDBStructure(importedData.text);

        //List<string> queries = GraphsonToGremlin.ObjectToGremlinConverter.StructureToQueryList(structure);

        int  _port;
        bool status = int.TryParse(port.text, out _port);

        if (!status)
        {
            _port = 443;
        }

        //bool uploaded = GraphToDB.UploadToCosmosDB(hostname.text, _port, authKey.text, database.text,
        //    collection.text, queries);
        GraphToDB.UploadToCosmosDB(hostname.text, _port, authKey.text, database.text,
                                   collection.text, structure, dropDataToggle.isOn);

        /*
         * if (uploaded)
         * {
         *  ShowMessage("Data has now been uploaded!", Color.green);
         * }
         * else
         * {
         *  ShowMessage("Something went wrong during the upload!", Color.red);
         * }
         */
        Globals.inMenu = false;
        uploadToDBPanel.SetActive(false);
    }
Exemplo n.º 4
0
    public static CosmosDbStructure jsonToCosmosDBStructure(string json)
    {
        CosmosDbStructure data = GraphsonToGremlin.JsonToGremlinLoader.GraphsonToObject(json);

        return(data);
    }