I am new to Apache Ignite.Can someone help me on how to fetch and load the data from ignite cache
using node js without using sql field queries option. Cache is loaded using CacheJDBCPOJO Store and the Key and Value types are custom types defined using JAVA.As these classes are defined in Java not sure on how to fetch the data using node.
Hope the following example , explains the issue better.
We have ignite cache of custom key Type i.e Person Key with attributes Person First Name and person Last Name and custom value type i.e Person Info with attributes Person Address and Person Age etc.
These classes are defined in Java and the caches are configured in Bean File and loaded using CacheJDBCPOJO Store.
As these classes will not be available in node js, how can we load /fetch the data from node js using cahe.put /cache.get.Tried creating similar classes in node and pass the object of these classes to
cahe.put /cache.get but it is in't working.
I can see the following error:
ERROR: Binary type has different field types [typeName=OrderId, fieldName=OrderID, fieldTypeName1=long, fieldTypeName2=double] (node:13596)
Which will probably be fixed by removing ignite work dir (/tmp/ignite/work or ./ignite/work by default) and restarting all your nodes, and as such, not related directly to node.js
As for examples, have you tried the following:
https://apacheignite.readme.io/docs/nodejs-thin-client-binary-types
As for REST API, it should convert BinaryObject's to JSON by default, this should include all SQL columns' values.
Update: Turns out you have to do query.setIncludeFieldNames(true) to make getFieldNames() return field names.
Related
I would like to know how to store something when you use check box and later access it when checkbox state changes.
I tried store array as global but when script runs again what i stored is reseted to empty array.
I also tried propeties but it can only store strings.
So if anybody know how to store attachments i would be glad.
There are lots of ways on how this can be approached. Either you can store data to a spreadsheet and build scripts based on the Google Sheet Data by referring to this document.
If it's a file were talking about you can use DriveApp using the method createFile() from a given Blob of arbitrary data. Documentation here.
Or, you can connect to an external database using JDBC Service as reference here in this documentation.
for a project at university we are working on an application that is supposed to automatically create a file for the user after having queried several information from the user. The general idea is to use Decision Model and Notation "DMN" to perform the query and collect the information needed. The file input depends on the answers provided by the user. The application is further intended to be web-based.
My question is therefore, how we can put the strings that result from the DMN query into a PDF template that is ready to print/send? The template is currently set up to be a text document (.docx) that has several input fields that need to be filled.
Thanks!
You can use Kogito for the DMN execution side; it is JVM based but it exposes for you automatically generated REST (JSON) endpoints to evaluate the DMN model. Based on the requirements you listed, this should an easy way to achieve the DMN evaluation part; that is for Kogito you drop the .dmn model file into the src/main/resources directory and it will automatically provide for you a cloud-native based application exposing the REST endpoint.
Further, the outcoming JSON payload (of the DMN evaluation results) could be fed into a template engine, in order to generate from the JSON of result the final PDF leveraging conversion from a more friendlier target. For instance, this could have also been done with Apache FreeMarker/Velocity template engine. You could use as target HTML or ODF, and finally achieve the final PDF conversion.
Since data set in SpagoBI could be created using scripts, I need to connect, query my MongoDB data base using javascript (or Groovy).
I need to use scripts to be able to execute aggregation on the mongoDB data, I can't use aggregation directly on my MongoDB because my data type is String
I dont know how to access my Database using scripts
Any ideas?
You should create a Mongo dataset. The steps to create are:
Step1: Create a Mongo datasource in the administrator console. Notes: the type must be JDBC and the value for Class input field must be "mongo"
JDBC: {unit_host}:{port}/${db}
CLASS: mongo
Step2: now you can create a dataset. The procedure is the same of the query datasets. The difference here is the language.. JS instead of SQL.
Take a look at the SpagoBI wiki in particolar here: http://wiki.spagobi.org/xwiki/bin/view/spagobi_server/data_set#HQueryDataSet28Mongo29
When connecting to mongoDB, you pass auth stuff in the url. Since the scripts lies on the client side, it would be hard to make the connection secure (unless you are talking about backend JavaScript). Anybody would be able to see how to connect to your DB and for instance delete all content.
I would suggest a simple api to interface the database. Then u control the access to what a user can do towards the database.
Or have I misunderstood the scenario?
I am trying to activate a node of the tree generated by the fancytree using Javascript. I am using flask as server side framework and passing the key as a server side variable. As mentioned on http://wwwendt.de/tech/fancytree/demo/index.html#sample-api.html, I am using the following script:
$("#tree2").fancytree("getTree").activateKey('{{key}}');
However, this does not activate any key in spite of the key being present.
P.S. I am customizing my key using alphanumeric code in the source ajax data for fancy tree.
Your code looks ok, given that the selector exists and '{{key}}' resolves to an existing key (you might want to check that using console.log(...)).
Note that the nodes are only available, after the ajax request has returned, so you only can lookup those nodes in the tree.init event or after this happened.
I have a list of of data being return from a "standard" HttpGet IQueryable method from an ApiController that implements the Breeze EFContextProvider. When one of the objects references another object that has already been returned in the payload, Breeze gives me an $ref to refer to the object that was already returned.
I want the object with all related objects return explicitly, not a reference with $ref. Also, I'm not using the breeze.js library on the client side; simply making straight calls to the Controller with a web address.
I found this:
Breeze does not replace the Ref: node with its real data
which is the thing I'm looking for, but using Include on the server still doesn't return all of the data.
Any idea on how to "force" Breeze on the server side to include all related data no matter if it was returned and referenced in the payload?
Update 1
Per Steve's answer below I added the following to the BreezeWebApiConfig.RegisterBreezePreStart method in the App_Start folder:
var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
json.SerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.Object;
Compiling and running produces the same output with only the $ref group instead of the full data. I'm sending a request to the server to $expand the collection. Do I need to change the SerializerSettings upon each request to the controller or will adding this to the BreezeWebApiConfig.RegisterBreezePreStart method be enough?
Update 2
I've added a CustomBreezeConfig class per the instructions at the link that Steve added in his answer. I am however using Breeze.WebApi2 so it appears that the BreezeConfig is actually in Breeze.ContextProvider. The code compiles, but I'm still seeing the same $ref for the actual object in JSON.
Do I need to include this CustomerBreezeConfig class in a specific place in my project for Breeze to use it's serializer settings?
Under WebAPI, Breeze uses the Json.NET serializer to turn the results to JSON. You can change the serializer settings (specifically the PreserveObjectReferences setting) to change this behavior.
Breeze configures it's own JSON serializer, so in a Breeze app, you'll need to configure it as described in the Breeze Web API Controller doc.
Note that, if you turn PreserveObjectReferences off, you might also need to configure the ReferenceLoopHandling setting, if you have circular reference in your object graphs (as most of us do).