an option or extension to export changes made to the document - libreoffice-writer

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

Related

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.

Filter file system file selection dialog by ContentTypeId

In the Eclipse plugins we're developing, we've defined a custom content type, using the org.eclipse.core.contenttype.contentTypes extension point. We're successfully using the content type to enable or disable UI components, based on, e.g., whether the user is editing a file of that type.
I'd like to take this ones step further and also use it to filter files in a file selection dialog, such that it only shows files that match the content type.
I have found that filtering a JFace Viewer this way is possible, so for files in the workspace, we could use an ElementTreeSelectionDialog and add a ViewerFilter.
Is there a way to do the same for a file selection dialog of the entire file system (instead of filtering by file extension)? Or is this impossible because it's restricted to the OS's filtering?
The standard SWT FileDialog can only be filtered by file extension and cannot be extended.
You could write your own file selection dialog using the normal Java File or Path APIs with a tree viewer and a viewer filter.
Because the files are outside of the workspace you can't use any of the IResource, IFile, IFolder APIs. However you can still use the IContentTypeManager interface which gives you access to your content types.
IContentTypeManager manager = Platform.getContentTypeManager();
If the file extension is enough to distinguish the files you can just use:
IContentType contentType = manager.findContentTypeFor("the file name");
If you need to use the content describers use:
InputStream stream = ... new FileInputStream(....
IContentType contentType = manager.findContentTypeFor(stream, "the file name");
stream.close();

How can I rename file uploaded to s3 using javascript api?

'pickAndStore' method allows me to specify full path to the file, but I don't know it's extension at this point (file path has to be defined before file is uploaded, so it's not possible to provide a path with correct extension).
if I use 'pick' and then 'store' I have 2 files (because both methods uploads file to the s3). I can delete 'old' file, but it's not optimal and can be pain (take ages) with really big files.
Is there any better solution? Ideally to rename existing file.
Currently, there is no workaround for renaming file.
However, in our Javascript API v2 we are planing to add new callback function. onStart callback will be fired after user pick file but before file uploading. There could be option like renaming file based on original filename.
We will keep you updated.

Joomla template parameters and params.ini - file becomes unwritable after save

I am using wamp on Win XP SP3 and creating a Joomla template with changeable parameters.
initially the message is
The parameter file \templates\ssc_2010\params.ini is
writable!
once I make changes everything works as expected, except now i get the message:
The parameter file \templates\ssc_2010\params.ini is
unwritable!
One solution is to brows to the directory, right click the file, select properties, and uncheck read-only. Again the file is writable but once I modify the parameters again it becomes read only again. I'm quite lazy and would like to prevent this from happening again, I've notice this happening in past projects, but now I have to work a lot with parameters so it becomes quite boring doing manual labor like that :P
There is a bug in Joomla 1.5 that causes the message to be displayed.
A security feature was added that makes the template files unwritable until just before save, where they are made writable, saved, then made unwritable again.
Try to make a change, then go back and check the preview. You will see that the change was actually made.
If you want to fix the annoying unwritable message, add the following code to
administrator/components/controller.php around line 179, just after setting the FTP credentials:
$file = $client->path.DS.'templates'.DS.$template.DS.'params.ini';
// Try to make the params file writeable
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0755')) {
JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template parameter file writable'));
}
This will make the file writable during the edit load process, and before the file's status is posted in the template.
Then for security, in case the edit screen is closed without saving, search for the following lines:
require_once (JPATH_COMPONENT.DS.'admin.templates.html.php');
TemplatesView::editTemplate($row, $lists, $params, $option, $client, $ftp, $template);
and paste the following code just AFTER these lines but before the closing brace:
// Try to make the params file unwriteable
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0555')) {
JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template parameter file unwritable'));
}
That will make the file unwritable again.
This is the same code that is used in the saveTemplate() function. We are just doing it again before we display the status of the file on the edit screen. If the process fails because of your web server's configuration, you will get warning messages, BEFORE you've made a bunch of changes to your template. :)
P.S. Remember to save a copy of this file separately, so that you can redo the changes when you upgrade Joomla! (if they haven't fixed this themselves yet.)
This sounds like a user rights problem within Windows - have a look a the security permissions for the directory in which the file you are editing is located, and check that the user "IUSR_xxx" (where xxx is the name of your computer) has full control.
If this doesn't work, then can you tell us what version of Windows you are running as this may help...
Matt