Dynamic xquery/xpath in activevos - xpath

I want to configure xpath or xquery in property file and need to use that variable while reading data.
for example, I configured xquery property in configuration file like
aXquery = types:Request/types:Person/type:details/type:a/text()
I need to use this aXquery variable in script some thing like
$RESTRequest/types:payload/string($configData/ns2:XPaths/ns2:aXquery)
Can anyone help me on this how to do in activevos?

I don't think that you can use property files directly. AFAIK there are three options to implement a dynamic configuration mechanism:
Use URN Mappings (Configurable in ActiveVOS Console / Administration / URN Mappings). You can read those with functions available in XQuery in ActiveVOS (resolveURN).
Place the configuration value in the database (e.g. create a new table) and read those with ActiveVOS DB access mechanisms.
Wrap your config file in a Web service and call the service from your process.

Related

In Spring boot, I'm trying to create another .property file that functions like messages.property, Is that possible?

So I'm trying to create another .property file (called labels.properties) that i can use in Thymeleaf like this:
<div th:text=#{property.from.labels}></div>
Right now I just add labels.properties in the root of resource folder, for now its not working. The purpose of this is I want to separate the property file that handles the error messages from texts for labels & buttons.
Is that possible?
if yes, how to do it?
if yes again, can I do internationalization like adding labels_ja.properties (Japanese)?
You can customize the naming (and location) of the message bundles by configuring the spring.messages.basename property. For example:
spring.messages.basename=labels
By doing so, Spring will look for messages within classpath:labels.properties and classpath:labels_{locale}.properties, such as classpath:labels_ja.properties.
If you want to use this in addition to the regular messages.properties, you can use a comma separated value:
spring.messages.basename=messages,labels
The first one within that comma separated list will take priority over the other ones. If you have a property.from.labels in both messages.properties and labels.properties, the one within messages.properties would be chosen in this example.
This can also be found within the documentation about internationalization.

How do I assign a name to a v8::Object so that scripts can access it?

I'm currently trying to add scripting functionality to my C++ application by using v8. The goal is to process some data in buffers with JS and then return the result. I think I can generate an ArrayBuffer by using New with an appropriate BackingStore. The result would be a Local. I would now like to run scripts via v8::Script::Compile and v8::Script::Run. What would be the name of the ArrayBuffer - or how can I assign it a name so that it's accessible in the script? Do I need to make it a Globalif I need to run multiple scripts on the same ArrayBuffer?
If you want scripts to be able to access, say, my_array_buffer, then you'll have to install the ArrayBuffer as a property on the global object. See https://v8.dev/docs/embed for an introduction to embedding V8, and the additional examples linked from there. In short, it'll boil down to something like:
global_object->Set(context,
v8::String::NewFromUtf8(isolate, "my_array_buffer"),
array_buffer);
You don't need to store the ArrayBuffer in a Global for this to work.

What NOREPLACE means at netflix's nebula plugin?

I was using netflix's nebula. Looking here, I saw this line:
fileType [org.freecompany.redline.payload.Directive] - Default for types, e.g. CONFIG, DOC, NOREPLACE, LICENSE
I didn't find any doc about the actual meaning of this enum, but I've found the original code.
Now I want an actual description of this enum. I thought NOREPLACE is releated to being not allowed to replace the file. But I want to be sure and don't rely on assumptions.
I have only seen noreplace as an additional attribute on a config file, e.g. %config(noreplace). It means that if the user has edited the file, the installer should put its new version as filename.rpmnew; by default %config files are replaced with the user one put as filename.rpmold .

Spring boot: Override property value

Into my application-pre.properties file there's coded this property:
scheduler.url-backoffice=http://${BACKOFFICE_SERVICE}:8080
In order to fill it, I'm using -Dspring-boot.run.arguments=--spring.config.additional-location=scheduler-config.properties.
scheduler-config.properties:
BACKOFFICE_SERVICE=localhost
scheduler.url-backoffice=http://localhost:8081
I need to set BACKOFFICE_SERVICE property, otherwise spring doesn't start. So, it means that scheduler.url-backoffice comes to http://localhost:8080.
I 've added another line after that in order override its value.
My surprise is its value is not changed. I mean, scheduler.url-backoffice's value is http://localhost:8080 instead of http://localhost:8081.
I'm not able to change application-pre.properties content file.
Use multiple application properties files.
One can ship in the jar;
this contains the defaults.
For me, defaults translates to either the prod values,
if there is only one set of prod values,
or the developer local values (which should cause failures in production).
The second file contains the environment specific property values that
override the defaults.
You must change your startup values to achieve this.
Here is an example:
-Dspring-boot.run.arguments=--spring.config.additional-location=scheduler-config.properties,local-scheduler-config.properties
Edit: in response to "still not working".
It seems like you need much more than the "simple" approach I described above.
For that,
check out section 24. Externalized Configuration in the Spring Boot Reference Guide.
There are many techniques to override configuration values;
all are covered in the reference guide.

MSDatashape being deprecated

In the following microsoft documentation: -
https://learn.microsoft.com/en-us/sql/ado/guide/appendixes/microsoft-data-shaping-service-for-ole-db-ado-service-provider?view=sql-server-2017
this feature is being removed and the suggestion is to use XML. Has anyone done this? I'm wondering what they mean, in terms of loading the structure of what MSDataShape is by using XML, or just to use XML objects?
TIA
I believe this is referring to the FOR XML clause of T-SQL, which performs much the same job as MSDataShape in that it returns hierarchically nested data.
Port your MSDataShape queries to FOR XML queries and change the client to parse the results instead of using the MSDataShape OLEDB provider.
At the client side, SAX or pull parsing would be the best fit to port code that previously used MSDataShape (which also had a move-through-the-records cursor based model).
This is my bit of code that is helpful. My MSDataShape code still works, therefore I propose using that to generate your XML as a template, then use that going forward to load them: -
Dim objShapeMaker As clsShapeMaker
Dim rsoTemp As ADODB.Recordset
Dim strXMLTemplate As String
' Template file
strXMLTemplate = "C:\Temp\Template_GI.xml"
' Create the MSDataShape and save it to XML
Set rsoTemp = objShapeMaker.CreateGI()
rsoTemp.Save strXMLTemplate, adPersistXML
' Now we have the XML in a file going forward, load it in my recordset
Set rsoTemp = New ADODB.Recordset
rsoTemp.Open strXMLTemplate, , , , adCmdFile
' Cleanup
Set rsoTemp = Nothing
Set objShapeMaker = Nothing
If you don't like the idea of generating XML template files to maintain, you could do this via .NET and expose it to COM to use in your VB6/VBA application as mentioned here.
I have made a .NET application that can generate these XML files from simple code lines should anyone want going forward that is similar to the blog listed, however it handles child recordsets with relationships.
EDIT 1: This works great if you have schema set ups without returning data. As far as I can tell, to populate these effectively, it's better to write code to load the structure first, and populate it after from seperate recordsets (which is slower!)
EDIT 2: This is the approach we are taking with a replacement in a .NET Interop. Initially looking at bringing XML from SQL and parsing that back as required. This could be bought back into a DataSet and that's parsed into the target recordset as well, but then the relationship between the tables in the result dataset needs to be set in code rather than the one place in T-SQL with XML output.

Resources