playMaker

Author Topic: DataMaker Xml xPath and Json [JANUARY 2018]  (Read 28116 times)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4114
    • View Profile
    • jinxtergames
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #30 on: November 25, 2015, 01:31:35 AM »
Hi jean,
i think i found another bug :


don't forget to read my last post btw :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #31 on: November 25, 2015, 02:16:29 AM »
Hi,

 Yes, I am just running behind big time, so I'll need to time to process everything.

 The examples are pending 1.8 release so that I clean them up, so don't rely too much on them right now, they will get a clean up pass.

 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4114
    • View Profile
    • jinxtergames
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #32 on: November 25, 2015, 12:38:07 PM »
Hi,
Yes i have noticed that the examples needs to be cleaned up,
so i made my own samples for the tutorial videos.

But "Xml Create Node" seems not to work.

Can you let me know if you have updated.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4114
    • View Profile
    • jinxtergames
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #33 on: November 26, 2015, 12:05:36 AM »
Hi,
I found another problem in the action XmlInsert node.
insert after is inserting before.
line 79 of the code is this :
Code: [Select]
parentNode.InsertBefore(_node,refChild);
but should be this :

Code: [Select]
parentNode.InsertAfter(_node,refChild);

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4114
    • View Profile
    • jinxtergames
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #34 on: November 26, 2015, 11:36:43 PM »
Hi jean,
i have updated the action "Xml Set Node Properties" so that you can also change the "inner text" from the node.

i think i found them on github so i can update the action and also thi XmlInsert node.

but i would like a permission first :)

and if this is the right path : PlayMaker--DataMaker--U4.3.4.SubModule-/Xml/Actions/

here is the code for the updated "Xml Set Node Properties" action :

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2015. All rights reserved.
// updated by : DjayDino
//
using UnityEngine;

using System.Xml;
using System.Xml.XPath;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("DataMaker Xml")]
[Tooltip("Sets node properties and attributes. Use an xml reference.")]
public class XmlSetNodeProperties : DataMakerXmlActions
{

[ActionSection("XML Node")]

public FsmString xmlReference;

public FsmString nodeInnerText;

[CompoundArray("Node Attributes", "Attribute", "Value")]
public FsmString[] attributes;

public FsmString[] attributesValues;

[ActionSection("Feedback")]
public FsmEvent errorEvent;

public override void Reset ()
{
xmlReference = null;

attributes = null;
attributesValues = null;
errorEvent = null;
nodeInnerText = new FsmString(){UseVariable=true};
}

public override void OnEnter ()
{

SetAttributes();


Finish ();
}


private void SetAttributes ()
{

XmlNode _node = DataMakerXmlUtils.XmlRetrieveNode(xmlReference.Value);

if (_node ==null)
{
Debug.LogWarning("XMl reference is empty, or likely invalid");

Fsm.Event (errorEvent);
return;
}

if (!nodeInnerText.IsNone)
{
_node.InnerText = nodeInnerText.Value;
}

int att_i = 0;
foreach (FsmString att in attributes) {
SetNodeProperty(_node,att.Value,attributesValues[att_i].Value);
att_i++;
}

// Debug.Log(_node.OwnerDocument.OuterXml);
Finish ();
}

}
}

When the actions are updated i will release the first 3 parts of my datamaker tutorial.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4114
    • View Profile
    • jinxtergames
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #35 on: November 27, 2015, 11:31:06 AM »
Hi,
i just noticed that i can't edit the xml actions
Quote
you must be on a branch to make or propose changes to this file

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #36 on: November 28, 2015, 05:46:40 AM »
Hi,

 Let me have a look, I am pretty sure you can set the innertext of a node.

 as for contributing, I'll give you access, not a problem, this is very much welcomed indeed!!

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #37 on: December 01, 2015, 04:03:49 AM »
Hi Jean,

xml create Node does not seem to work, also on your sample (RssFeedEditor) does  not work

Also i am wondering what the difference is with xml insert node and create node?

i am almost done with the datamaker tutorial, only a few actions i need some help with...

How does the nodes Math Operator work? if you can make me a quick sample i can figure it out

What are the "Fsm Xml Properties Storage", "Fsm Xml Properties Type" and "Fsm Xml Source" for

and maybe a sample for Convert Json String To Xml Node.

Hi,

 ok, so I looked at this, and I spotted the issue, and made an update, please redownload from the Ecosystem.

-- setting the inner text of a node works, simply put "." for the xpath query.

-- insert node lets you specific where ( first child, last child, etc)
-- Create node simply append to the parent node

-- the FsmXmlPropertiesStorage etc etc are for internal usage to create complex actions interfaces and avoid duplication.

-- I have pushed the unity scene I am using the test json to xml conversion, it's on the Github rep.

-- nodes Math Operator is very easy, if you have a node with inner text 4, you can add 1 to it, without saving 4 into a fsmint, add it etc etc.

-- VEry important note, when you edit xm and you use an xml Proxy, use the action "XmlProxyRefreshStringVersion" after your editing so that in the Unity inspector the xml string of the proxy is refreshed, I fixed this in this latest version and is likely the reason why you get so confused, because them actions works, but it was not updating in proxies.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #38 on: December 01, 2015, 04:06:53 AM »
Hi jean,
i have updated the action "Xml Set Node Properties" so that you can also change the "inner text" from the node.

When the actions are updated i will release the first 3 parts of my datamaker tutorial.

Hi,
 
not need to edit this action, it works as is. Simply put "." in the property, which refer to itself ( the innertext de facto).

 try this and let me know if that worked.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [NOVEMBER 2015]
« Reply #39 on: December 01, 2015, 04:11:08 AM »
Hi,
I found another problem in the action XmlInsert node.
insert after is inserting before.
line 79 of the code is this :
Code: [Select]
parentNode.InsertBefore(_node,refChild);
but should be this :

Code: [Select]
parentNode.InsertAfter(_node,refChild);

Hi,

 Fixed in the latest version, thanks :)

 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4114
    • View Profile
    • jinxtergames
Re: DataMaker Xml xPath and Json [DECEMBER 2015]
« Reply #40 on: December 05, 2015, 10:55:33 PM »
Hi,
i will try to test the update next week and let you know if all works :)

Quote
"Xml Set Node Properties"

not need to edit this action, it works as is. Simply put "." in the property, which refer to itself ( the innertext de facto).

I did not know that was possible....
but i do think it is more clearer this way,
especially for beginners.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Re: DataMaker Xml xPath and Json [DECEMBER 2015]
« Reply #41 on: January 07, 2016, 09:08:29 AM »
Hi,

I just downloaded a second ago DataMaker from ecosystem and I get this error: Assets/PlayMaker Utils/PropertyDrawers/PlayMakerFsmVariable/Editor/PlayMakerFsmVariablePropertyDrawer.cs(59,59): error CS0117: `HutongGames.PlayMaker.Ecosystem.Utils.PlayMakerInspectorUtils' does not contain a definition for `GetBaseProperty'

What is this? First time with datamaker so no sure what I am looking at..

UPDATE: I just reinstalled arraymaker from ecosystem and all is well..
« Last Edit: January 07, 2016, 09:23:07 AM by dudebxl »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [DECEMBER 2015]
« Reply #42 on: January 12, 2016, 11:17:06 PM »
Hi,

 When you get this, it's likely that the PlayMaker utils of one package is older than the PlayMaker utils you have currently installed in your project.

so, thanks for reporting, because everytime I make an update of the PlayMaker utils, I need to repackage everything that depends on it pretty much...

Bye

Jean



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14052
  • Official Playmaker Support
    • View Profile
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #43 on: January 12, 2016, 11:19:30 PM »
Hi,

 Just to ping this thread for everyone using datamaker, it's now updated and compatible with Unity 4.7.

Bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 140
    • View Profile
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #44 on: February 02, 2016, 03:12:43 PM »
Hi -

I just reinstalled the JSON files in DataMaker (via EcoSystem) in order to retest against Case 1387.  It now looks like the FSM that the script I was using to load AssetBundles is no longer functioning - my HashTables are getting created and populated, but the objects all read "None" (they're supposed to be textures).

Since I have a backup of the version just before the DataMaker/JSON update, I loaded that back up, and it works fine.  So there is no doubt that the connection to the server and XML file is working properly.

Before I go down the troubleshooting rabbit hole, is there some obvious setting that I might be missing?

Thanks very much!