INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Query field type via mcws  (Read 1214 times)

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Query field type via mcws
« on: April 07, 2019, 10:09:32 am »

Is it possible to query the field type via mcws? The documentation doesn't mention anything. Apparently it is possible to create fields along with a type, but not possible to query the type. This would be really useful for automatic type conversion in scripts. Soooo.... pretty please? =)
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: Query field type via mcws
« Reply #1 on: April 08, 2019, 01:42:45 pm »

Could you expand a little on what you're thinking?  A way to specify a type like "String" and get a list of all the matching fields?

It's a little tricky because fields have a data type and an edit type and I'm not sure which we would search.

Thanks for any clarification.
Logged
Matt Ashland, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970
Re: Query field type via mcws
« Reply #2 on: April 08, 2019, 02:18:40 pm »

I figure he wants to determine the type of existing fields, not search by type, so if you get a list of values you know eg. which is a Date field, and which is a plain number field. I've had this thought before when w orking on JRemote, since it just wouldn't know which kind of field is a Date.
Logged
~ nevcairiel
~ Author of LAV Filters

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: Query field type via mcws
« Reply #3 on: April 08, 2019, 02:26:00 pm »

So would it be adding the data type and/or edit type to the Library/Fields function?
Logged
Matt Ashland, JRiver Media Center

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: Query field type via mcws
« Reply #4 on: April 08, 2019, 04:22:58 pm »

Thank you for your consideration!
When creating a field, you have to specifiy a data type (e.g. Date, String, Integer...). When querying fields from mcws, knowing these field types would allow proper casting. I didn't even consider the edit type, but this would actually be useful as well in order to provide the best input field for users.

Hendrick got what I meant: Ideally I'd need an endpoint that returns the field names along with the data and edit types, or, optionally, an endpoint that I give a field name as parameter, and input and edit type are returned. Adding this data to the Library/Fields function would be ideal from my point of view, I don't know if that would break backwards compatibility though.

Edit: On the risk of sounding ungrateful, but could we maybe get relational type and allowed values as well?  :)
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: Query field type via mcws
« Reply #5 on: April 08, 2019, 04:38:36 pm »

I can add that tomorrow.  Thanks for the idea  ;)
Logged
Matt Ashland, JRiver Media Center

MrBiff

  • World Citizen
  • ***
  • Posts: 151
Re: Query field type via mcws
« Reply #6 on: April 08, 2019, 04:45:29 pm »

It would be nice to expand:

http://localhost:52199/MCWS/v1/Library/Fields

to return some XML which indicated the field's edit and data types, acceptable values, etc.  Currently it returns only the field name for non-calculated fields, and the field name + expression for calculated fields.

Likewise, the CreateFields input should take the same XML structure to be able to fully specify the created fields.

I use these new features frequently, so thanks for adding them.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: Query field type via mcws
« Reply #7 on: April 09, 2019, 01:35:27 am »

I can add that tomorrow.  Thanks for the idea  ;)

Thank you so much, Matt <3
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: Query field type via mcws
« Reply #8 on: April 09, 2019, 08:15:29 am »

Coming next build:
NEW: Added the edit type and data type to the MCWS Library/Fields function.

Thanks again for the suggestion.
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up