Padrino Admin (12.0) + Mongoid: escaped quotes break MongoDB array syntax - mongoid

Whenever I edit an object with an array field with Padrino Admin interface, the quotes are escaped and MongoDB doesn't recognize the array as an array anymore.
Fields are correctly defined as arrays in the object model definitions.
Any ideas?
Edit:
the array is received by the controller's post and put methods as such, it's after the document is persisted to MongoDB that it's escaped resulting in a string. Maybe this has to do with MongoDB serialization?

Related

How can I use RelationshipFilter in 2sxc Visual Query with text field instead of entity field?

I'm trying to do the same as this example does under title "Attribute-On-Relationship to Query other Fields".
I'm editing Blog application visual query.
So I have RelationshipFilter, which takes entities of type Category via Default in point. And I want to filter them by field Name. Here I can get list of names either from params or from list of posts and their categories. That's not a problem as far as I understand.
So looks like Name has to be of entity type. I'm struggling right now with this filter, since I want to filter Category by field Name of simple text type. Which means that I have nothing to specify in Relationship Attribute. EntityTitle or just empty Relationship Attribute field don't work and cause Bad Request error. So is there a way to make it work?
P.S. ValueFilter is not an option, since it doesn't support returning nothing if there are no items, that satisfy condition and also it supports only filter by item's Attribute, that contains Value and no option that Value can contain any in Attribute with separator.
The RelationshipFilter is only meant for relationships (item with item) - and you seem to want to do a string-compare.
I'm not really sure what you should do because I don't have context, but if things get really special, best use LINQ instead. Check out the tutorials for LINQ here: https://2sxc.org/dnn-tutorials/en/razor/linq/home

How to display server side validations for individual input fields when using AngularJS and Springboot?

so my question is if this is possible to display the errors on top of individual input fields when using AngularJS service to call Rest controller, because when response is received from AngularJS service, it comes as a single error message, so either that whole errors will be displayed on UI.
For example we are validating field A, B and C using server side validation, and there are 3 types of error messages coming from server but as a single string.
It depends on the return type of your method. If return type is string then it will return as single string. Please use class object concept or dynamic json object in var type variable or use pipe ("|") separator and split it to show on page.

How to store object on URL query string

I am developing a generic search component on React that puts it's filters, current page and some other params on the URL query string (after the ?).
I currently use the URLSearchParams to transform the query string to js objects and back to query string, as the react-router-v4 expects
The point is that I need to store an Object within the query string, so I can differentiate the search filter (that can have multiple fields) from other params.
I see that I can transform a object to JSON, and store everything on a filter param, or I could store the object using dot notation (?filter.name=foo&filter.tag=bar) or even a square brackets notation (?filter[name]=foo&filter[tag]=bar) and treat them accordingly when reading them from the url.
I am tending to choose the JSON notation, but Is there any problems with this approach? Should I know beforehand any limitations? Is there a better way to do it?

How to get tabs in angular forms based on given xml file?

I have to get number of input tabs or fields based on given xml or json file.
example : If xml has 3 tags, then form should contain 3 input fields.
Same with JSON.
You can use ng-repeat on service response array of objects. And also you can create new scope variable & assign unique property of response array object to it. Then you can have as many number of input fields based on service data & also dynamic ng-model on them to handle their model data to submit it.
This is small example which demonstrates your requirement: http://jsfiddle.net/DrQ77/
For xml response, better use xml to json library plugins to convert it to json data https://github.com/abdmob/x2js. Or prefer server side sending json data (with implementing xml to json functionality at server side).

Document Converstion for PDF form (eg. w2/1040/etc) as key/values instead of a single string based on font information

Trying to use the Document Conversion service to capture the json key/value pairs for the pdf documents such as (w2/1040/etc forms.)
Content of such forms in json response are coming as part of the "text" under the "content". Missing the form data, but mostly rendering the form labels as a single string.
I would like to know if there is anyway to capture the form data for the pdf (w2/1040/etc) as key / values in json instead of a single string?
Thanks.
Unfortunately, the Document Conversion Service currently does not support forms in PDFs. At most, it may recognize some of the forms as tables, but not as key/value pairs.
If it recognizes a form as a table, you still would need to do some non-trivial post-processing to map it to key/value pairs.

Resources