Inputs to UA-Model Compiler (OPCUA) - opc-ua

Based on the Github page of UAModelCompiler, the docker container used for UA Model Compiler requires two inputs.
xml file
csv file
Although the XML file can easily be generated using UaModeler, I am not sure how to generate the CSV file for the same XML.
Any hints would be appreciated!

Use the 'Export NodeIds' function next to the 'Export XML' in UaModeler.

Related

an option or extension to export changes made to the document

I have enabled track changes and changed 2 words as seen in this screenshot.
atest > test
trac > track
Can I save this list of 2 lines in a csv or .txt file? I do not see "export changes" option anywhere.
From the menu (option or extension): no, not that I know of. But with a tool? In theory that would be perfectly possible.
You can open the ODT file as a ZIP file. This allows access to the content.xml sub-file, where changes are stored in the <text:tracked-changes> XML node.
In each "changed-region" you will find whether it is an insert, a deletion, and who and when did it, together with an ID that maps to a <text:change-end text:change-id="ctUNIXTIME_IN_SECONDS"/> node inside the text itself (not so useful for tracking).
If you apply the changes in timestamp order, that's the "accept all changes" algorithm.
I believe you could actually get a CSV object from the XML file with the appropriate XSLT directives.
<text:p text:style-name="P2">
<text:span text:style-name="T1">Seconda</text:span>
</text:p>
</text:deletion>
</text:changed-region>
<text:changed-region xml:id="ct1526650030752" text:id="ct1526650030752">
<text:insertion>
<office:change-info>
<dc:creator>Leonardo Serni</dc:creator>
<dc:date>2021-01-18T00:44:08</dc:date>
</office:change-info>
</text:insertion>
</text:changed-region>
<text:changed-region xml:id="ct1526650030272" text:id="ct1526650030272">
<text:insertion>
<office:change-info>
<dc:creator>Raffaello Mascetti</dc:creator>
<dc:date>2021-01-18T00:44:02</dc:date>
</office:change-info>
</text:insertion>
</text:changed-region>
</text:tracked-changes>
<text:p text:style-name="P2">
<text:change text:change-id="ct1526650030512"/>
<text:change-start text:change-id="ct1526650030752"/>
<text:span text:style-name="T3">Terza</text:span>
<text:change-end text:change-id="ct1526650030752"/>
<text:span text:style-name="T2"> modifica.</text:span>
<text:change-start text:change-id="ct1526650030272"/>
</text:p>
<text:p text:style-name="P3">Ancora.
<text:change-end text:change-id="ct1526650030272"/>
</text:p>
Your guess is correct, you cant export only the changes, what you can do (using LibreOffice) is to export a pdf that includes the changes:
Edit > Changes > Show Changes?
File > Export As > Export as PDF
You can export to pdf like this

Generate starter code based on new file VSCode

Is there a way to configure some code based on a file extension when created in VS Code? I'm currently working with psioniq file header which has been pretty helpful in generating good header files, but I'm looking to take this a step farther.
When I create a new file, based on a specific file extension, I would like it to generate some starting code that I can configure. For example, I work with Verilog a lot. It would be really cool if Code could generate based on the file name.
Create new file
Code generates some code (like below) or something else that could be configured based on the filetype:
module <filename> (
input ,
output ,
);
endmodule
Anyone have any extensions they know about or resources they can point me to to implement this?
This would be a pretty easy extension to write but an alternative is snippets.
You can create keywords, based on the extensions, that when you type it it'll create all that code for you.
https://code.visualstudio.com/docs/editor/userdefinedsnippets

Why does DITA Open Toolkit PDF plugin rename image href attributes?

I'm sorry if this doesn't have enough information. I don't typically ask for help online like this.
I'm using DITA Open Toolkit 3.4 on Windows. I generated a plugin called "vcr2" using Jarno's (very excellent and helpful) PDF Plugin Generator and then made a handful of customizations. The plugin uses the pdf2 plugin as a base. When I try to use the vcr2 plugin, my images are not working. I've tracked the problem down to malformed image filenames in the image's href attribute.
For example:
In my source file (a DITA Task), the markup for one of my images looks like this:
<image href="MyRemindersChooseReminder.png"/>
If I run a transform with the pdf2 plugin, the images work fine. In the merged stage1.xml file in the Temp folder, the XML for that same image looks like this:
<image class="- topic/image " href="df2d132af27436c59c5c8c4282e112d62bec8201.png" placement="inline" xtrc="image:1;10:66" xtrf="file:/V:/Vasont/Extract/t12340879-minimal/t12340879.xml"/>
It is processed into a file Topic.fo, and looks like this:
<fo:external-graphic
 src="url('file:/V:/Vasont/Extract/t12340879-minimal/MyRemindersChooseReminder.png')"/>
Everything works fine and the image looks fine.
If I run the same file through my 'vcr2' plugin, which just calls the same pdf2 plugin with some overrides, all the images get broken:
stage1.xml
<image class="- topic/image " href="df2d132af27436c59c5c8c4282e112d62bec8201.png" placement="inline" xtrc="image:1;10:66" xtrf="file:/V:/Vasont/Extract/t12340879-minimal/t12340879.xml"/>
Topic.fo
<fo:external-graphic
 src="url('file:/V:/Vasont/Extract/t12340879-minimal/df2d132af27436c59c5c8c4282e112d62bec8201.png')"
/>
As I track this down further, it appears that somewhere in the map-reader Ant task, this filename gets changed to that cryptic string of pseudo-hexadecimal. I think later on it's supposed to be changed back or resolved to a complete URI or something.
So, the two-part question is: Why does Open Toolkit change my filenames, and what's supposed to change them back?
DITA-OT's preprocess uses hashes for temporary filenames because it allows the code to not deal with directory structures. This enables preprocess to work in so-called "map-first" mode, where it first processes all DITA map resources and only then starts to process DITA topic and image resources.
The preprocess has a step called clean-preprocess that can rewrite the temporary file names to match source resource files names. However, this rewrite operation is disabled for PDF output because the original file names are not used for anything in that output type.

How to make a section optional when mapped to optional data in a Word OpenXml Part?

I'm using OpenXml SDK to generate word 2013 files. I'm running on a server (part of a server solution), so automation is not an option.
Basically I have an xml file that is output from a backend system. Here's a very simplified example:
<my:Data
xmlns:my="https://schemas.mycorp.com">
<my:Customer>
<my:Details>
<my:Name>Customer Template</my:Name>
</my:Details>
<my:Orders>
<my:Count>2</my:Count>
<my:OrderList>
<my:Order>
<my:Id>1</my:Id>
<my:Date>19/04/2017 10:16:04</my:Date>
</my:Order>
<my:Order>
<my:Id>2</my:Id>
<my:Date>20/04/2017 10:16:04</my:Date>
</my:Order>
</my:OrderList>
</my:Orders>
</my:Customer>
</my:Data>
Then I use Word's Xml Mapping pane to map this data to content control:
I simply duplicate the word file, and write new Xml data when generating new files.
This is working as expected. When I update the xml part, it reflects the data from my backend.
Thought, there's a case that does not works. If a customer has no order, the template content is kept in the document. The xml data is :
<my:Data
xmlns:my="https://schemas.mycorp.com">
<my:Customer>
<my:Details>
<my:Name>Some customer</my:Name>
</my:Details>
<my:Orders>
<my:Count>0</my:Count>
<my:OrderList>
</my:OrderList>
</my:Orders>
</my:Customer>
</my:Data>
(see the empty order list).
In Word, the xml pane reflects the correct data (meaning no Order node):
But as you can see, the template content is still here.
Basically, I'd like to hide the order list when there's no order (or at least an empty table).
How can I do that?
PS: If it can help, I uploaded the word and xml files, and a small PowerShell script that injects the data : repro.zip
Thanks for sharing your files so we can better help you.
I had a difficult time trying to solve your problem with your existing Word Content Controls, XML files and the PowerShell script that added the XML to the Word document. I found what seemed to be Microsoft's VSTO example solution to your problem, but I couldn't get this to work cleanly.
I was however able to write a simple C# console application that generates a Word file based on your XML data. The OpenXML code to generate the Word file was generated code from the Open XML Productivity Tool. I then added some logic to read your XML file and generate the second table rows dynamically depending on how many orders there are in the data. I have uploaded the code for you to use if you are interested in this solution. Note: The xml data file should be in c:\temp and the generated word files will be in c:\temp also.
Another added bonus to this solution is if you were to add all of the customer data into one XML file, the application will create separate word files in your temp directory like so:
customer_<name1>.docx
customer_<name2>.docx
customer_<name3>.docx
etc.
Here is the document generated from the first xml file
Here is the document generated from the second xml file with the empty row
Hope this helps.

Combine two TCPDF documents

I'm using TCPDF to create two separate reports in different parts of my website. I would like that, in the end of the first report, the second report should be loaded.
It's different than import a PDF file, because the second report is also generated by TCPDF. Is there a way to do this?
I assume from your question that what you ultimately want to provide is one PDF file that consists of the first PDF concatenated with the second PDF.
One quick and dirty solution is to utilize the pdftk command line PDF processor and call it from within your PHP code using the exec() function. The pdftk command has many features and concatenating files is only one of them, but it does an awesome job. Depending on your hosting situation, this may or may not be an option for you.
The other option would be to use FPDI to import the two PDF files and concatenate them within your PHP code and then send the concatenated version to the user.
More information on using PFDI here:
Merge existing PDF with dynamically generated PDF using TCPDF
Given that you're already using TCPDF, importing the pre-existing file that you want to concatenate with the one you've just created shouldn't be too difficult.
Just add FPDI to your project/composer from:
https://www.setasign.com/products/fpdi/downloads/
Can you still used tcpdf.
FPDI support all the methods of tcpdf, just used new FPDI() instead new tcpdf() the result will be the same in your report, after you create your report marge the files with the code from this page:
https://www.setasign.com/products/fpdi/about/
In a loop, once set the first file and after this set the second...
If you will need help i am here for you.