Converting RTF to PDF from System - alfresco

I've createad a rule to transform any file to PDF and copy this one to another folder.
So i can add a file named: "test.rtf" and then the rule create a test.pdf into folder "PDF"..
Till here its ok. If i add a file through alfresco (add content button) it works perfectly...
By the way, on the system that i've developed when i try to add a file then i get my file .rtf correctly in the folder, but the pdf file converted and copied goes without any content...
If i send a rtf file with a table with 10 rows and into the rows i right "testing" then the pdf created goes with the table, and with 10 empty rows...
Someone knows the reason for that?
Im not sure, but maybe when i send the file by the system alfresco starts to convert and copy before completing to create the rtf... someone already got some problem like this one?

The problem you're getting in is that Alfresco first creates an empty file with all the meta-data and then updates the file with the associated content.
So you can do 2 things:
1: create a rule which is triggered on update, instead on create/inbound
2: create a rule which triggers a Javascript file, which will do the transformation and will check on the content size.
Hence it's better to create a rule which checks the content on size.
Create a JavaScript file in Data Dictionary/Scripts.
Check the JavaScript API
Something like this:
if (document != null && document.size > 0){
document.transformDocument("application/rtf");
}

Related

Cannot place custom items on client hotbar/toolbar

Whenever I make a custom item, I am unable to drag it onto a hotbar. When I try to pick it up the icon turns to a question mark and will not stick to a hotkey.
For example, I made an exact copy of the Murloc Costume (id 33079) at id 50017 (which was a free slot on my DB). The original I can put on a hotbar. The custom one I cannot.
Here's a gif of the issue
Answer: if it's not in the client side DBC's, it will not work properly.
From ReynoldsCahoon on the AC Discord:
I just modified a DBC recently. I had to use a tool (I used Ladik's MPQ Editor) to extract the specific DBC I wanted to modify, and then I used WDBX to open the DBC and manipulate it. In WDBX you can output it in a variety of formats (like CSV or SQL) so you can modify the values any way you like, and then reimport (via CSV or SQL) the values back in.
I loosely followed the guide here: https://model-changing.net/tutorials/article/23-41-creating-your-first-mpq-patch/
I exported a DBC containing all of the Character Titles in the game. Erased all of them, and then imported a bunch of new values of my own choosing. Instead of importing that back into the MPQ I got it from, I created a new MPQ called patch-4.mpq that I placed in my client WotLK/Data/ directory, and then on the server, I placed the DBC file into the worldserver/data/dbc/ directory, replacing the original DBC.
I think this can optionally be overwritten in the database, by using the associated _dbc table to override values from the dbc files (someone correct me if this part is wrong).

How to create a link that downloads a new file instead of opening the source file (rmarkdown)

My rmarkdown code produces a html document. This document lists out the process that needs to be followed by front line staff at month end. The process flow requires users to open xl files, update a few fields (such as report month etc) and then run macros.
I have used hyperlink to the original XL files as follows
[click to opel xl file](path/and/file names)
The above link opens the original file and the user is able to
overwrite the original file, I don’t want this to happen.
I want the hyperlink to generate a new file that would be downloaded
so that nothing happens to the original file. How to do this?
Please could you kindly help me out.
Thanks in advance
After extensive research, this can't be done using conventional rmarkdown!

2sxc | Display multiple files with Adam upload

I can upload multiple files (documents in this case) at the same time very well. Is it possible to have a hyperlink field with multiple adam files dropped into it or even a plus ('+') icon to add another without having to drop on another app each time?
UPDATE:
Sorry I overlooked ADAM 1.2 (link below) feature to use hyperlink 'Library' for multi file selection.
https://2sxc.org/en/blog/post/introducing-adam-1-2-with-folders-metadata-and-c-sharp-api
I have been able multi select now but still having difficulty with using the file picker to create the folder structure I wish to achieve:
I read from link above:
You can create even another content-type - like Application Group Metadata - which you can use as folder-metadata. This allows the editor to tag each folder with additional information.
I do not fully understand how to use this 'folder-metadata' to achieve the same thing as the file manager allows me to do by specifying where each file is to be stored?

WARNING: All changes made in this file will be lost

So I have a general question. When you convert your .ui file into a .py file with pyuic, on the top part of the .py file it says:
WARNING! All changes made in this file will be lost!
Is is serious ? How will changes made in the file lost ?
I'm sorry I realise this is not a smart question but I just want to make sure what this is about and that it will not comprise anything afterwards!
Since this is a generated file, it is a result, not a source. Thus:
When you distribute your project, you shouldn't be distributing that file. So, whatever you do to the file, won't reach your customers anyway.
Whenever your project is built and the source .ui file is changed, the output will be regenerated - and whatever changes you made to the output file, thus lost.
What this means is: You’ve used a .uic file to generate a .py file, therefore if you modify the later manually ( i.e : create a class , or adding a comment etc...) and subsequently re-generate a file via puic those will be lost.
That’s why you should create a main.py file and import the generated .py file into it leaving the original untouched.
If at a later stage you need to add a button and a label for example, you do so via qdesigner which gets you your new .uic file you create a .py
with the puic and voila your gui is modified your old .py erased by the new one but everything in your main.py stays the same.
Hope this makes sense..
Provided you have generated .py file from the .ui file and will not be making any changes in the .ui file, changes will persist.

InDesign CS5 Script: How can you display a directory?

I have a script that:
creates a new folder
scans an InDesign document for images
formats the images and copies them to the new folder
When the script is done doing all of this I want it to bring to focus the new folder directory (in Windows).
As of now I am displaying the folder-path in an alert window, but I would rather it open the directory (if it isn't already) so the user can see the new files.
I wish I could just call one of these:
myNewFolder.bringToFront() : works only on program focus, i.e. -- BridgeTalk.bringToFront("photoshop")
myNewFolder.open() : seems to apply only to file I/O operations
myNewFolder.show() : seems to apply only to the Window object
...but none of these work.
EDIT: new ActiveXObject("Scripting.FileSystemObject") does not work either...
You have to use the execute method.
myFolder.execute();

Resources