Coder Social home page Coder Social logo

rmraya / fluenta Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 4.0 46.91 MB

Translation Manager for DITA projects

Home Page: https://maxprograms.com/products/fluenta.html

License: Eclipse Public License 1.0

AMPL 3.28% Clean 0.55% Batchfile 0.05% Shell 0.07% HTML 15.42% Java 80.42% CSS 0.22%
dita xliff translation java xliff-manager

fluenta's Issues

XLiff generation does not finish on very large DITA Map

I'm running on Mac OS a command line with the latest compiled Fluenta project.
Using this public Oxygen XML User's guide repo:
https://github.com/oxygenxml/userguide
attempting to create an xliff from this DITA Map:
https://github.com/oxygenxml/userguide/blob/master/DITA/UserManual.ditamap

I get a lot of warnings in the console like:

  WARNING: Undefined key for @keyref

but the export xliff process never really ends.
The DITA Map is valid in itself, it is complex, it may have duplicate keys because it uses ditaval filters to produce about 15 usermanuals from the same dita map so also the warnings that I receive in the console in my opinion are not correct.

I also tried to redirect the output to a log file like:

 sh fluenta_cli.sh -generateXLIFF abc.json > log3.txt

but I was not able to, the log file remains empty.

Remove the {{org.eclipse.swt}} dependency from the com.maxprograms.fluenta.API

We are currently building an Oxygen XML Editor plugin that integrates Fluenta into the DITA Maps Manager. We are using com.maxprograms.fluenta.API for calling Fluenta operations.

For com.maxprograms.fluenta.API.generateXLIFF method, it is used com.maxprograms.fluenta.controllers.LocalController and certain static methods are used on it from: {{ com.maxprograms.fluenta.views.XmlPreferences}} and {{ com.maxprograms.fluenta.views.ProjectPreferences}}, and these 2 classes extend org.eclipse.swt.widgets.Composite. These static methods are not related to the visual part and we do not use {{org.eclipse.swt}} in our projects, but thus we are forced to distribute swt.jar.

Is it possible to use, for example, utility classes for these methods to separate the functional part from the visual part?

API calls are missing the initializations performed in com.maxprograms.fluenta.Fluenta

We are currently building an Oxygen XML Editor plugin that integrates Fluenta into the DITA Maps Manager. We are using com.maxprograms.fluenta.API for calling Fluenta operations.

In com.maxprograms.fluenta.Fluenta there are some initializations that take place:

  • checkConfigurations();
  • System.setProperty("user.dir", Preferences.getPreferencesDir().getAbsolutePath());

Right now one needs to manually perform these before calling com.maxprograms.fluenta.API. Some ideas, not sure if the right ones:

  1. Perhaps add a new com.maxprograms.fluenta.API.checkConfigurations(File resourcesDir). This resourcesDir would be the folder where the 'catalog', 'xmlfilter' folders are located. In our case, these resources are not located in "user.dir", but in a specific folder inside the plugin.
  2. Some resources are searched for inside "user.dir" and I guess that's why System.setProperty("user.dir", Preferences.getPreferencesDir().getAbsolutePath()); gets called early on. In our case, Fluenta runs in the context of a larger application we are reluctant to change the "user.dir" property as we are unsure of the implications. For example, in Xml2Xliff.getIniFile(), "xmlfilter" is looked for inside "OpenXLIFF_HOME" or "user.dir". In our case, it would help if Fluenta would use a custom system property as well, one that we can set before calling the API, for example "fluenta.home.dir".

Exception "URI is not absolute" when generating an XLIFF for a project with a large ditamap

Hello,

We are currently building an Oxygen XML Editor plugin that integrates Fluenta into the DITA Maps Manager. We are using {{com.maxprograms.fluenta.API}} for calling Fluenta operations.

I noticed that when we try to generate an XLIFF for somewhat larger ditamaps, an exception is thrown.
I also reproduced the problem with the original Fluenta application, version 2.5.0:
image

I did not find useful information in the log (for example, what is the URI that is not absolute and triggered the exception).
The dita project on which I reproduce it is available on github: https://github.com/oxygenxml/userguide.

Update H2 Database Engine to version 2.1.214 to reduce vulnerabilities

Hello,

We are working to integrate Fluenta 3.0.0 into Oxygen "Fluenta DITA Translation" add-on. Fluenta uses the H2 Database Engine 1.4.200 which has 4 critical vulnerabilities reported:
https://mvnrepository.com/artifact/com.h2database/h2/1.4.200
They might not apply in the context in which Fluenta is using H2 (false positives), but it would be better to update H2 to version 2.1.214 in which 3 of those vulnerabilities have been resolved:
https://mvnrepository.com/artifact/com.h2database/h2/2.1.214
When we integrated Fluenta 2.6.0 we were able to bundle H2 2.1.214 and everything worked, but Fluenta 3.0.0 doesn't work with H2 2.1.214 out of the box. If we switch to 2.1.214 the actions to import/export TMX fail with errors like this:

\Fluenta-3.0.0>"C:\Program Files\Java\jdk-17.0.3.1\bin\java.exe" -cp "lib/h2-2.1.214.jar" --module-path jars -m fluenta/com.maxprograms.fluenta.Fluenta
Jan 03, 2023 1:23:12 PM com.maxprograms.swordfish.tm.InternalDatabase <init>
INFO: H2 database created
Jan 03, 2023 1:23:12 PM com.maxprograms.fluenta.views.MemoriesView exportTMX
SEVERE: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "TYPE_NAME" not found; SQL statement:
SELECT TYPE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='TUV' AND COLUMN_NAME='SEG' [42122-214]

Pass an ILogger implementation to API calls

Hello,

We are currently building an Oxygen XML Editor plugin that integrates Fluenta into the DITA Maps Manager. We are using {{com.maxprograms.fluenta.API}} for calling Fluenta operations. I've noticed that there is a {{com.maxprograms.tmengine.ILogger}} interface for notifying progress.
{{com.maxprograms.fluenta.API}} uses a {{com.maxprograms.utils.SimpleLogger}} that prints progress to console. It would be great if we could pass our own {{ILogger}} implementation.

Topic containing conkeyref with key scope skipped

I'm attaching a sample project, if you create a project and generate an xliff from the DITA Map, "export/002 Documentations/003 IND/Ranger/Ranger 7000/R71 User Guide/30283470 Ranger 7000 User Guide C/Sources/EN/Ranger 7000 User Guide.ditamap", the DITA Map contains a topic with the title "SKIPPED TITLE" which is not present in the generated xliff.
If in the "export/001 Reuse Contents/Sources/EN/reuse_contents.ditamap" I change the order of the two chapter references, the xliff will contain the title content.

export.zip

Linked DOCX file is missing

I use the Fluenta Addon in OxygenXML. A DOCX file, that is linked inside a topic, is not included during export/import. It is linked like this: <xref href="some_folder/some_file.docx" format="docx"/>
Is there an option to include files that are linked with @Xref? (for DOCX, ZIP, 7z, PDF, ...)

Mark shape element as translate=no

Let's say I have a DITA topic with an image map:

       <imagemap id="gear_pump_map">
                <image href="../images/Gear_pump_exploded.png" id="gear_pump_exploded">
                    <alt>Gear Pump</alt>
                </image>
                <area>
                    <shape>circle</shape>
                    <coords>172, 265, 14</coords>
                    <xref href="parts/bushings.dita#bushings_topic/bushings" format="dita"
                        >Bushings</xref>
                </area>
            </imagemap>

That "shape" element has the default attribute translate=no specified in the DTD.

The following translation unit is generated:

<trans-unit approved="no" id="9" xml:space="preserve">
  <source> <mrk ts="‹shape class=″+ topic/keyword ut-d/shape ″ translate=″no″​›" mtype="protected">circle</mrk> <mrk ts="‹coords class=″+ topic/ph ut-d/coords ″ translate=″no″​›" mtype="protected">172, 265, 14</mrk> <ph ctype="x-link" id="0">&lt;xref href="parts/bushings.dita#bushings_topic/bushings" class="- topic/xref " format="dita"&gt;</ph>Bushings<ph id="1">&lt;/xref&gt;</ph> </source>
    </trans-unit>

I think it should also have a translate=no attribute set on it.

Error generating XLiff for DITA Map

I'm using a local build I made with the latest code in the Fluenta GitHub repo, running the xliff generation from the command line.
I have this public Oxygen XML Blog project which can be used for tests:

https://github.com/oxygenxml/blog

I create a project for "oxygen_xml_blog.ditamap", then attempt to create an xliff for translation to fr or es, I get two similar errors reported like this one:

SEVERE: Error converting DITA Map
org.xml.sax.SAXException: Error 'Error '/Users/.../Fluenta-main/map.dtd (No such file or directory)' in file:      '/Users/.../blog/topics/dp/specializations.ditamap'' in file: '/Users/.../blog/maps/dita-articles.ditamap'
at openxliff/com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
at openxliff/com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)

and I'm not sure why, the dita-articles.ditamap is a plain DITA Map, I'm not sure why Fluenta does not resolve the public ID through the XML catalog and instead goes after the system ID.

StackOverflowError in DitaParser

One of our clients encountered a stack overflow error in DitaParser. I do not have enough details, if I manage to get a sample project from them I will try to create a sample and attach it here.

Exception in thread "Thread-25" java.lang.StackOverflowError
   ...
    at java.base/java.lang.System.getProperty(System.java:915)
    at ro.sync.basic.classloader.ContextFinder.basicFindClassLoaders(ContextFinder.java:87)
    at ro.sync.basic.classloader.ContextFinder.run(ContextFinder.java:120)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    ....
    at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
    at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(ObjectFactory.java:428)
    at org.apache.xerces.parsers.ObjectFactory.createObject(ObjectFactory.java:244)
    at org.apache.xerces.parsers.ObjectFactory.createObject(ObjectFactory.java:97)
    at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
    at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
    at com.maxprograms.xml.SAXBuilder.build(Unknown Source)
    at com.maxprograms.xml.SAXBuilder.build(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)
    at com.maxprograms.converters.ditamap.DitaParser.recurse(Unknown Source)

NoSuchFileException when a translation memory is deleted

Hello,

We are currently building an Oxygen XML Editor plugin that integrates Fluenta into the DITA Maps Manager.

Usually when we delete a memory that is not associated with a project, an exception is thrown in the console.
I noticed that although this exception appears, the memory is deleted from the database and when the application is restarted, it will no longer appear.
Do you think it would be safe to ignore this exception? (if the memory is deleted from the database, it seems to work). Or are there other causes and in fact the process was not complete?

This problem is also reproduced with Fluenta version 2.5.0. The reproduction steps are as follows:

  1. Create a new memory
  2. Remove the created memory

I put here the exception thrown in the console:
java.nio.file.NoSuchFileException: C:\Users\alex_smarandache\AppData\Roaming\Fluenta\TMEngines\1664956425828
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:275)
at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
at java.base/java.nio.file.Files.delete(Files.java:1152)
at com.maxprograms.fluenta.controllers.LocalController.deltree(Unknown Source)
at com.maxprograms.fluenta.controllers.LocalController.removeMemory(Unknown Source)
at com.maxprograms.fluenta.views.MemoriesView.removeMemory(Unknown Source)
at com.maxprograms.fluenta.views.MemoriesView$5.mouseDown(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:196)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4243)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1063)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4060)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3632)
at com.maxprograms.fluenta.MainView.show(Unknown Source)
at com.maxprograms.fluenta.Fluenta.main(Unknown Source)

Cannot build Fluenta on Windows 11

I tried to build Fluenta based on the main branch and have followed the given instructions in the README.md file, but the build fails with the following output:

Buildfile: C:\Users\stefan\workspace\Fluenta\build.xml

distclean:

clean:

init:
    [mkdir] Created dir: C:\Users\stefan\workspace\Fluenta\out
     [copy] Copying 31 files to C:\Users\stefan\workspace\Fluenta\out

compile:
    [javac] Compiling 53 source files to C:\Users\stefan\workspace\Fluenta\out
    [javac] C:\Users\stefan\workspace\Fluenta\src\com\maxprograms\fluenta\controllers\LocalController.java:593: error: pattern matching in instanceof is a preview feature and is disabled by default.
    [javac]                             if (logger instanceof AsyncLogger aLogger) {
    [javac]                                                               ^
    [javac]   (use --enable-preview to enable pattern matching in instanceof)
    [javac] C:\Users\stefan\workspace\Fluenta\src\com\maxprograms\widgets\AsyncLogger.java:87: error: pattern matching in instanceof is a preview feature and is disabled by default.
    [javac]             if (parent instanceof ImportXliffDialog dialog) {
    [javac]                                                     ^
    [javac]   (use --enable-preview to enable pattern matching in instanceof)
    [javac] error: cannot access module-info
    [javac]   bad class file: C:\Users\stefan\workspace\Fluenta\jars\openxliff.jar(/module-info.class)
    [javac]     class file has wrong version 61.0, should be 59.0
    [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac] error: cannot access module-info
    [javac]   cannot resolve modules
    [javac] 4 errors

BUILD FAILED
C:\Users\stefan\workspace\Fluenta\build.xml:40: Compile failed; see the compiler error output for details.

I can reproduce the problem also with https://github.com/rmraya/Fluenta/archive/refs/tags/v4.0.0.zip.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.