Revision: d06225919b7a
Author: jhargrave <
jhar...@gmail.com>
Date: Mon Sep 29 18:32:37 2014 UTC
Log: experimental or infrequently used projects from m27
including integration tests for simplification logic
https://code.google.com/p/okapi/source/detail?r=d06225919b7a&repo=sandbox
Added:
/applications/checkmate-webapp/WEB-INF/web.xml
/applications/checkmate-webapp/pom.xml
/applications/checkmate-webapp/src/main/java/net/sf/okapi/applications/checkmate/webapp/CheckMateWebApp.java
/applications/checkmate-webapp/src/main/java/net/sf/okapi/applications/checkmate/webapp/CheckMateWebAppConfiguration.java
/applications/checkmate-webapp/src/main/resources/checkmate16.png
/applications/longhorn/pom.xml
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/RESTInterface.java
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/lib/Configuration.java
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/lib/ProjectUtils.java
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/lib/WorkspaceUtils.java
/applications/longhorn/src/main/resources/version.properties
/applications/longhorn/src/main/webapp/WEB-INF/jboss-classloading.xml
/applications/longhorn/src/main/webapp/WEB-INF/web.xml
/applications/longhorn/src/main/webapp/css/okapi-longhorn.css
/applications/longhorn/src/main/webapp/icons/add.png
/applications/longhorn/src/main/webapp/icons/arrow_refresh.png
/applications/longhorn/src/main/webapp/icons/cancel.png
/applications/longhorn/src/main/webapp/icons/control_play_blue.png
/applications/longhorn/src/main/webapp/icons/zoom.png
/applications/longhorn/src/main/webapp/js/jquery.form.js
/applications/longhorn/src/main/webapp/js/okapi-longhorn.js
/applications/longhorn/src/main/webapp/okapi-longhorn-sample-js-client.html
/applications/longhorn/src/test/java/net/sf/okapi/applications/longhorn/ServiceTest.java
/applications/longhorn/src/test/java/net/sf/okapi/applications/longhorn/lib/ConfigurationTest.java
/applications/longhorn/src/test/java/net/sf/okapi/applications/longhorn/lib/WorkspaceUtilsTest.java
/applications/longhorn/src/test/resources/html_segment_and_text_mod.bconf
/applications/longhorn/src/test/resources/map_no_extension_to_xml.bconf
/applications/longhorn/src/test/resources/more_files.zip
/applications/longhorn/src/test/resources/okapi-longhorn-configuration-invalid.xml
/applications/longhorn/src/test/resources/okapi-longhorn-configuration-unique-working-dir-true.xml
/applications/longhorn/src/test/resources/okapi-longhorn-configuration.xml
/applications/longhorn/src/test/resources/rawdocumenttofiltereventsstep.html
/applications/longhorn/src/test/resources/test_xml
/applications/rainbow-webapp/WEB-INF/web.xml
/applications/rainbow-webapp/pom.xml
/applications/rainbow-webapp/src/main/java/net/sf/okapi/applications/rainbow/webapp/RainbowWebApp.java
/applications/rainbow-webapp/src/main/java/net/sf/okapi/applications/rainbow/webapp/RainbowWebAppConfiguration.java
/applications/rainbow-webapp/src/main/resources/rainbow16.png
/applications/ratel-webapp/WEB-INF/web.xml
/applications/ratel-webapp/pom.xml
/applications/ratel-webapp/src/main/java/net/sf/okapi/applications/ratel/webapp/RatelWebApp.java
/applications/ratel-webapp/src/main/java/net/sf/okapi/applications/ratel/webapp/RatelWebAppConfiguration.java
/applications/ratel-webapp/src/main/java/net/sf/okapi/lib/ui/segmentation/WebFileProcessingDialog.java
/applications/ratel-webapp/src/main/java/net/sf/okapi/lib/ui/segmentation/WebSRXEditor.java
/applications/ratel-webapp/src/main/resources/net/sf/okapi/lib/ui/segmentation/Res.properties
/applications/ratel-webapp/src/main/resources/ratel16.png
/applications/serval-webapp/WEB-INF/web.xml
/applications/serval-webapp/pom.xml
/applications/serval-webapp/src/main/java/net/sf/okapi/applications/serval/webapp/ServalWebApp.java
/applications/serval-webapp/src/main/java/net/sf/okapi/applications/serval/webapp/ServalWebAppConfiguration.java
/okapi-integration-tests/pom.xml
/okapi-integration-tests/simplifier-integration-tests/pom.xml
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/CommaSeparatedValuesFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/DoxygenFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/POFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/PropertiesFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RegexFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripHtmlWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripIdmlWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripJsonWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripOpenXmlWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripPlainWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripPoWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripPropertyWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripRegexWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripTableWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripUtils.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripXliffWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripXmlItsWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundTripXmlStreamWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundtripHtmlSnippetsTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundtripODFFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundtripOpenXMLSnippetsTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/RoundtripXliffSnippetTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/TXMLFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/TmxFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/VignetteFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/XINIFilterFormattingTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/XINIFilterPlaceholderTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/XMLFilterTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/XmlSnippetsTestIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/doublex/DoubleExtractionWithSimplificationAfterSerializationIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/doublex/DoubleExtractionWithSimplificationBeforeSerializationIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/java/net/sf/okapi/resourcesimplifier/integration/doublex/DoubleExtractionWithSimplifierIT.java
/okapi-integration-tests/simplifier-integration-tests/src/test/resources/Content_WithITS.xml
/okapi-integration-tests/simplifier-integration-tests/src/test/resources/dummy.txt
/okapi-integration-tests/simplifier-integration-tests/src/test/resources/net/sf/okapi/resourcesimplifier/integration/nonwellformedConfiguration.yml
/okapi-integration-tests/simplifier-integration-tests/src/test/resources/net/sf/okapi/resourcesimplifier/integration/wellformedConfiguration.yml
/okapi-integration-tests/simplifier-integration-tests/src/test/resources/simple.html
/okapi-integration-tests/xliffkit-integration-tests/pom.xml
/okapi-integration-tests/xliffkit-integration-tests/src/test/java/net/sf/okapi/tkit/integration/doublex/DoubleExtractionWithSerializationIT.java
/okapi-ui/rwt/core-ui/lib/
create_repo.info
/okapi-ui/rwt/core-ui/lib/org.eclipse.rap.rwt.supplemental.filedialog_1.5.0.20120220-1720_unsigned.jar
/okapi-ui/rwt/core-ui/lib/org.eclipse.rap.rwt.supplemental.fileupload_1.5.0.20120220-1720_unsigned.jar
/okapi-ui/rwt/core-ui/lib/org.eclipse.rap.rwt_1.5.1.20120917-1116_unsigned.jar
/okapi-ui/rwt/core-ui/lib/rwt-1.5.1.pom
/okapi-ui/rwt/core-ui/lib/rwt-filedialog-1.5.1.pom
/okapi-ui/rwt/core-ui/lib/rwt-fileupload-1.5.1.pom
/okapi-ui/rwt/core-ui/pom.xml
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/_maven.repositories
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/rwt-filedialog-1.5.1.jar
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/rwt-filedialog-1.5.1.jar.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/rwt-filedialog-1.5.1.jar.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/rwt-filedialog-1.5.1.pom
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/rwt-filedialog-1.5.1.pom.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/1.5.1/rwt-filedialog-1.5.1.pom.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/maven-metadata-local.xml
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/maven-metadata-local.xml.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-filedialog/maven-metadata-local.xml.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/_maven.repositories
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/rwt-fileupload-1.5.1.jar
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/rwt-fileupload-1.5.1.jar.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/rwt-fileupload-1.5.1.jar.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/rwt-fileupload-1.5.1.pom
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/rwt-fileupload-1.5.1.pom.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/1.5.1/rwt-fileupload-1.5.1.pom.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/maven-metadata-local.xml
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/maven-metadata-local.xml.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt-fileupload/maven-metadata-local.xml.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/_maven.repositories
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/rwt-1.5.1.jar
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/rwt-1.5.1.jar.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/rwt-1.5.1.jar.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/rwt-1.5.1.pom
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/rwt-1.5.1.pom.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/1.5.1/rwt-1.5.1.pom.sha1
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/maven-metadata-local.xml
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/maven-metadata-local.xml.md5
/okapi-ui/rwt/core-ui/repo/org/eclipse/rap/rwt/maven-metadata-local.xml.sha1
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/UserConfiguration.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/AboutDialog.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/BaseHelp.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/UIUtil.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/filedownload/DownloadServiceHandler.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/filedownload/FileDownload.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/filedownload/SaveAsDialog.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/fileupload/OkapiUploadPanel.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/misc/HelpDialog.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/misc/ProgressDialog.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/rwt/AbstractWebApp.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/rwt/AbstractWebAppConfig.java
/okapi-ui/rwt/core-ui/src/main/java/net/sf/okapi/common/ui/rwt/RwtNotImplementedException.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/custom/StyledText.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/graphics/GlyphMetrics.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/graphics/TextStyle.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/internal/widgets/UploadPanel.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/program/Program.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/widgets/DirectoryDialog.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/widgets/FileDialog.java
/okapi-ui/rwt/core-ui/src/main/java/org/eclipse/swt/widgets/MenuItem.java
/okapi-ui/rwt/core-ui/src/main/resources/about.html
/okapi-ui/rwt/core-ui/src/main/resources/img/business/close.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/conf_dialog_icon.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/conf_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/favicon.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/footer_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/footer_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/footer_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/header_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/header_left_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/header_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/header_right_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/header_wave.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/header_wave_layer.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/logo.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/menu_arrow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/perspective_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/perspective_bg_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/perspective_left_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/perspective_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_border_bottom.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_border_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_border_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_border_top.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_inactive_corner.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_inactive_corner_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_active_close_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_active_close_active_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_active_confarea_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_active_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_bg_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_conf_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_conf_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_inactive_bg_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_inactive_close_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_inactive_close_active_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_inactive_confarea_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_inactive_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_inactive_separator_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_overflow_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_overflow_active_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_overflow_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/stack_tab_overflow_inactive_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbarButtonBg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_arrow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow_arrow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow_hover_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow_layer_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/toolbar_overflow_layer_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/trans.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/viewMenu.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/viewPulldown.png
/okapi-ui/rwt/core-ui/src/main/resources/img/business/viewtoolbar_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/close.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/conf_dialog_icon.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/conf_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/favicon.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/footer_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/footer_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/footer_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/header_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/header_left_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/header_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/header_right_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/header_wave.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/header_wave_layer.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/logo.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/menu_arrow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/menu_arrow_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/menubar_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/perspective_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/perspective_bg_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/perspective_left_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/perspective_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_bottom.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_bottom_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_left_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_top.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_top_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_top_active_standalone.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_border_top_standalone.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_inactive_corner.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_inactive_corner_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_active_close_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_active_close_active_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_active_confarea_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_active_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_bg_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_conf_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_conf_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_inactive_bg_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_inactive_close_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_inactive_close_active_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_inactive_confarea_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_inactive_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_inactive_separator_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_overflow_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_overflow_active_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_overflow_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tab_overflow_inactive_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tabbar_left_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tabbar_left_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tabbar_right_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/stack_tabbar_right_inactive.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbarButtonBg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_arrow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_arrow.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_hover.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_hover_active.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_layer_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_layer_left.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/toolbar_overflow_layer_right.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/viewMenu.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/viewPulldown.png
/okapi-ui/rwt/core-ui/src/main/resources/img/fancy/viewtoolbar_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/readme
/okapi-ui/rwt/core-ui/src/main/resources/theme/business/business.css
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/fancy.css
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/browser_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/check-grayed-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/check-grayed.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/check-selected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/check-selected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/check-unselected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/check-unselected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/ctabfolder-dropdown-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/ctabfolder-dropdown.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/down-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/down.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/expanditem-collapse-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/expanditem-collapse.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/expanditem-expand-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/expanditem-expand.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/lastMonth-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/lastMonth.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/lastYear-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/lastYear.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/left-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/left.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/nextMonth-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/nextMonth.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/nextYear-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/nextYear.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/progress.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/radio-selected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/radio-selected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/radio-unselected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/radio-unselected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/right-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/right.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/shell-close-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/shell-close.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/shell-max-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/shell-max.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/shell-min-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/shell-min.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/sort-indicator-down.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/sort-indicator-up.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/table-column-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/table-column.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/tree-collapsed-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/tree-collapsed.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/tree-expanded-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/tree-expanded.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/up-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/fancy/icons/up.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/arrows/down.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/arrow-down.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/arrow-left.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/arrow-right.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/arrow-up.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/check-grayed-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/check-grayed.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/check-selected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/check-selected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/check-unselected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/check-unselected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/radio-selected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/radio-selected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/radio-unselected-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/button/radio-unselected.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/lastMonth-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/lastMonth.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/lastYear-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/lastYear.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/nextMonth-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/nextMonth.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/nextYear-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/calendar/nextYear.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ccombo/down-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ccombo/down.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/colorselector/brightness-field.jpg
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/colorselector/brightness-handle.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/colorselector/huesaturation-field.jpg
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/colorselector/huesaturation-handle.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/column/sort-indicator-down.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/column/sort-indicator-up.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/combo/down_button.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/coolitem/chevron.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/close.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/close_hover.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/ctabfolder-dropdown-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/ctabfolder-dropdown.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/maximize.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/minimize.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/ctabfolder/restore.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/cursors/alias.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/cursors/copy.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/cursors/move.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/cursors/nodrop.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/cursors/up_arrow.cur
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/datetime/down_button.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/datetime/drop_down_button.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/datetime/up_button.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/dialog/error.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/dialog/information.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/dialog/question.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/dialog/warning.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/display/browser_bg.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/expanditem/expanditem-collapse-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/expanditem/expanditem-collapse.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/expanditem/expanditem-expand-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/expanditem/expanditem-expand.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/menu/arrow.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/menu/checkbox.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/menu/menu-blank.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/menu/radiobutton.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/progressbar/bar.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/progressbar/barbg.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scale/h_line.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scale/h_marker_big.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scale/h_marker_small.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scale/v_line.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scale/v_marker_big.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scale/v_marker_small.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scrollbar/h-knob.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scrollbar/left-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scrollbar/left.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scrollbar/right-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scrollbar/right.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/scrollbar/v-knob.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/slider/left-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/slider/left.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/slider/right-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/slider/right.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/spinner/down-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/spinner/down.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/spinner/up-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/spinner/up.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/toolbar/dotted_white.gif
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tooltip/error.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tooltip/information.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tooltip/warning.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tree/tree-collapsed-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tree/tree-collapsed.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tree/tree-expanded-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/tree/tree-expanded.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-close-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-close.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-max-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-max.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-min-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-min.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-restore-hover.png
/okapi-ui/rwt/core-ui/src/main/resources/theme/resources/window/shell-restore.png
/okapi-ui/rwt/pom.xml
/okapi/libraries/lib-concurrent/pom.xml
/okapi/libraries/lib-concurrent/src/main/java/net/sf/okapi/lib/concurrent/CallablePipeline.java
/okapi/libraries/lib-concurrent/src/main/java/net/sf/okapi/lib/concurrent/CallableStep.java
/okapi/libraries/lib-concurrent/src/main/java/net/sf/okapi/lib/concurrent/SortableEvent.java
/okapi/libraries/lib-concurrent/src/main/java/net/sf/okapi/lib/concurrent/TextUnitWorkQueueStep.java
/okapi/libraries/lib-concurrent/src/main/java/net/sf/okapi/lib/concurrent/WorkQueuePipelineDriver.java
/okapi/libraries/lib-concurrent/src/test/java/TextUnitThreadedStepTestIT.java
/okapi/libraries/lib-concurrent/src/test/java/WorkQueuePipelineDriverTestIT.java
/okapi/libraries/lib-segmentation/build.properties
/okapi/libraries/lib-segmentation/pom.xml
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/CompiledRule.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/ICURegex.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/LanguageMap.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/Placeholder.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/Rule.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/RuleInfo.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/SRXDocument.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/SRXSegmenter.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/SegmentationRuleException.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/opennlp/OkapiMaxEntSegmenter.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/opennlp/OkapiSentenceDetectorFactory.java
/okapi/libraries/lib-segmentation/src/main/java/net/sf/okapi/lib/segmentation/package.html
/okapi/libraries/lib-segmentation/src/main/resources/net/sf/okapi/lib/segmentation/opennlp/sent_da.bin
/okapi/libraries/lib-segmentation/src/main/resources/net/sf/okapi/lib/segmentation/opennlp/sent_en.bin
/okapi/libraries/lib-segmentation/src/main/resources/net/sf/okapi/lib/segmentation/opennlp/sent_es.bin
/okapi/libraries/lib-segmentation/src/main/resources/net/sf/okapi/lib/segmentation/opennlp/sent_pt.bin
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/SRXDocumentTest.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/SRXSegmenterTest.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/SegmentationTest.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/TestICURegex.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/TestJavaRegex.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/TestRuleInfo.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/opennlp/SegmentationTest.java
/okapi/libraries/lib-segmentation/src/test/java/net/sf/okapi/lib/segmentation/opennlp/SegmenterTest.java
/okapi/libraries/lib-segmentation/src/test/resources/Test01.srx
/okapi/libraries/lib-segmentation/src/test/resources/TradosTest.html
/okapi/libraries/lib-segmentation/src/test/resources/TradosTest.tmx.txt
/okapi/libraries/lib-segmentation/src/test/resources/TradosTestIssues.html
/okapi/libraries/lib-segmentation/src/test/resources/TradosTestIssues.tmx.txt
/okapi/libraries/lib-segmentation/src/test/resources/chinese.txt
/okapi/libraries/lib-segmentation/src/test/resources/createGFTCPart1.pln
/okapi/libraries/lib-segmentation/src/test/resources/createGFTCPart2.pln
/okapi/libraries/lib-segmentation/src/test/resources/createGFTCPart3.pln
/okapi/libraries/lib-segmentation/src/test/resources/createGoldFileForTradosCompatibility.bat
/okapi/libraries/lib-segmentation/src/test/resources/defaultSegmentation.srx
/okapi/libraries/lib-segmentation/src/test/resources/document.xml
/okapi/libraries/lib-segmentation/src/test/resources/net/sf/okapi/lib/segmentation/Test02.srx
/okapi/libraries/lib-segmentation/src/test/resources/tradosSegmentation.srx
/okapi/libraries/lib-segmentation/src/test/resources/website_test_slim.html
/okapi/libraries/lib-segmentation/src/test/resources/website_test_slim.tmx.txt
=======================================
--- /dev/null
+++ /applications/checkmate-webapp/WEB-INF/web.xml Mon Sep 29 18:32:37 2014
UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="
http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <context-param>
+ <param-name>org.eclipse.rap.applicationConfiguration</param-name>
+
<param-value>net.sf.okapi.applications.checkmate.webapp.CheckMateWebAppConfiguration</param-value>
+ </context-param>
+
+ <listener>
+
<listener-class>org.eclipse.rwt.engine.RWTServletContextListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>checkmate-ui</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>checkmate-ui-fullscreen</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+<!--
http://localhost:8080/okapi-checkmate/ui -->
+ <servlet-mapping>
+ <servlet-name>checkmate-ui</servlet-name>
+ <url-pattern>/ui/*</url-pattern>
+ </servlet-mapping>
+
+<!--
http://localhost:8080/okapi-checkmate/ui-fs -->
+ <servlet-mapping>
+ <servlet-name>checkmate-ui-fullscreen</servlet-name>
+ <url-pattern>/ui-fs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
=======================================
--- /dev/null
+++ /applications/checkmate-webapp/pom.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,140 @@
+<project xmlns="
http://maven.apache.org/POM/4.0.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>build-applications</artifactId>
+ <version>0.27-SNAPSHOT</version>
+ </parent>
+ <artifactId>okapi-application-checkmate-webapp</artifactId>
+ <name>Okapi CheckMate (Web version)</name>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>okapi-application-checkmate</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>macosx</artifactId>
+ <groupId>org.eclipse.swt.carbon</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86_64</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>sparc</artifactId>
+ <groupId>org.eclipse.swt.gtk.solaris</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.motif.aix</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.win32.win32</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.wpf.win32</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>okapi-checkmate</finalName>
+
+<!-- Unpack to /WEB-INF/classes/ the dependency JARs with packages
replacing those same-named of SWT/okapi-core-ui, to have those hooked up
instead -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <!--
+ <artifactItem>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>okapi-application-checkmate</artifactId>
+ <version>${project.version}</version>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}/okapi-checkmate/WEB-INF/lib</outputDirectory>
+ </artifactItem>
+ -->
+ </artifactItems>
+
<outputDirectory>${project.build.directory}/okapi-checkmate/WEB-INF/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!--
+ <attachClasses>true</attachClasses>
+ <classesClassifier>classes</classesClassifier>
+ -->
+ <webXml>WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+
+<!-- Block the error "maven-dependency-plugin
(goals "copy-dependencies", "unpack") is not supported by m2e"
+see
http://www.journaldev.com/503/how-to-fix-maven-dependency-plugin-goals-copy-dependencies-unpack-is-not-supported-by-m2e-in-eclipse
-->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.0,)</versionRange>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
=======================================
--- /dev/null
+++
/applications/checkmate-webapp/src/main/java/net/sf/okapi/applications/checkmate/webapp/CheckMateWebApp.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,75 @@
+package net.sf.okapi.applications.checkmate.webapp;
+
+import net.sf.okapi.common.filters.DefaultFilters;
+import net.sf.okapi.common.filters.FilterConfigurationMapper;
+import net.sf.okapi.common.filters.IFilterConfigurationMapper;
+import net.sf.okapi.common.ui.BaseHelp;
+import net.sf.okapi.common.ui.rwt.AbstractWebApp;
+import net.sf.okapi.lib.ui.verification.QualityCheckEditor;
+
+import org.eclipse.swt.widgets.Shell;
+
+public class CheckMateWebApp extends AbstractWebApp {
+
+ @Override
+ protected void createUI(Shell shell) {
+ if (!shell.getMaximized()) shell.setBounds(50, 50, 800, 500);
+ BaseHelp help = new BaseHelp("help"); //$NON-NLS-1$
+
+ QualityCheckEditor editor = new QualityCheckEditor();
+ // Create and fill the configuration mapper
+ IFilterConfigurationMapper fcMapper = new FilterConfigurationMapper();
+ DefaultFilters.setMappings(fcMapper, false, true);
+
+ // Initialize the editor
+ editor.initialize(shell, false, help, fcMapper, null);
+
+ // Disable unsupported items on menu system
+// Menu menuBar = shell.getMenuBar();
+// Menu fileMenu = menuBar.getItem(0).getMenu();
+//
+// MenuItem loadFromClipboard = fileMenu.getItem(4);
+// loadFromClipboard.setEnabled(false);
+//
+// MenuItem fileSave = fileMenu.getItem(6);
+// fileSave.setEnabled(false);
+//
+// MenuItem fileSaveAs = fileMenu.getItem(7);
+//
+// // Remove current selection listeners
+// for (Object listener : SelectionEvent.getListeners(fileSaveAs)) {
+// SelectionEvent.removeListener(fileSaveAs, (SelectionListener)
listener);
+// }
+//
+// // Set new selection listener
+// fileSaveAs.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// (new SRXDocumentHandler()).save(getShell(), editor.getSrxDocument());
+// }
+// });
+//
+// MenuItem saveToClipboard = fileMenu.getItem(8);
+// saveToClipboard.setEnabled(false);
+//
+// Menu toolsMenu = menuBar.getItem(1).getMenu();
+// MenuItem testSegmentation = toolsMenu.getItem(0);
+//
+// // Remove current selection listeners
+// for (Object listener :
SelectionEvent.getListeners(testSegmentation)) {
+// SelectionEvent.removeListener(testSegmentation,
(SelectionListener) listener);
+// }
+//
+// // Set new selection listener
+// testSegmentation.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// segmentTextFile();
+// }
+// });
+
+ }
+
+ @Override
+ protected String getName() {
+ return "CheckMate";
+ }
+}
=======================================
--- /dev/null
+++
/applications/checkmate-webapp/src/main/java/net/sf/okapi/applications/checkmate/webapp/CheckMateWebAppConfiguration.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,28 @@
+package net.sf.okapi.applications.checkmate.webapp;
+
+import net.sf.okapi.common.ui.rwt.AbstractWebAppConfig;
+
+import org.eclipse.rwt.lifecycle.IEntryPoint;
+
+public class CheckMateWebAppConfiguration extends AbstractWebAppConfig {
+
+ @Override
+ protected String getEntryPointId() {
+ return "ui";
+ }
+
+ @Override
+ protected Class<? extends IEntryPoint> getEntryPointClass() {
+ return CheckMateWebApp.class;
+ }
+
+ @Override
+ protected String getFaviconPath() {
+ return "checkmate16.png";
+ }
+
+ @Override
+ protected String getPageTitle() {
+ return "Okapi CheckMate";
+ }
+}
=======================================
--- /dev/null
+++ /applications/checkmate-webapp/src/main/resources/checkmate16.png Mon
Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,9 @@
+‰PNG
+
+
+IHDR óÿa gAMA ±
+üa pHYs Ä Ä •+ ›IDAT8Ocd``ø Ä ÁÿÿØ•1‚
+ø ’ ¯ ŒæŸ ì=Î`¨9°Ý˜ ‰ Õ
+ p "(àˆ x
+PÚèƒ×Œ{þ[¨
+ ç¢c|VŸÎ¾ —f ¥0 ϳ ê î0Áj ²f ‚é ¤ ¦ F›NÕ€ NÐ ˜blš‰r H Ì d›aN
è ˜BlšArŒÀ@ÄšO AI„0 n÷7åu†«1 IEND®B`‚
=======================================
--- /dev/null
+++ /applications/longhorn/pom.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,213 @@
+<project xmlns="
http://maven.apache.org/POM/4.0.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>build-applications</artifactId>
+ <groupId>net.sf.okapi.applications</groupId>
+ <version>0.27-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>okapi-application-longhorn</artifactId>
+ <packaging>war</packaging>
+ <name>Okapi Longhorn</name>
+
+ <repositories>
+ <!-- For resteasy -->
+ <repository>
+ <id>jboss-original</id>
+ <name>jboss repo</name>
+
<url>
http://repository.jboss.org/nexus/content/groups/public/</url>
+ </repository>
+ </repositories>
+
+ <properties>
+ <
longhorn.war.name>okapi-longhorn</
longhorn.war.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>okapi-application-rainbow</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>macosx</artifactId>
+ <groupId>org.eclipse.swt.carbon</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86_64</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>sparc</artifactId>
+ <groupId>org.eclipse.swt.gtk.solaris</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.motif.aix</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.win32.win32</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.wpf.win32</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.okapi.lib</groupId>
+ <artifactId>okapi-lib-longhorn-api</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jettison-provider</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-2.1</artifactId>
+ <version>6.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>okapi-longhorn</finalName>
+ <resources>
+ <resource>
+ <directory>
+ src/main/resources
+ </directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.properties
+ </include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <!-- Use the following dependency in referencing projects: <dependency>
+ <groupId>net.sf.okapi.applications</groupId>
<artifactId>okapi-application-longhorn</artifactId>
+ <version>${project.version}</version>
<classifier>classes</classifier> </dependency> -->
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </resource>
+ </webResources>
+ <attachClasses>true</attachClasses>
+ <classesClassifier>classes</classesClassifier>
+ <warName>${
longhorn.war.name}</warName>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <configuration>
+ <contextPath>/okapi-longhorn</contextPath>
+ <scanIntervalSeconds>2</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ <connectors>
+ <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>9095</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <systemProperties>
+ <systemProperty>
+ <name>LONGHORN_WORKDIR</name>
+ <value>${project.build.directory}/longhorn-workdir</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>uniqueContextRoot</id>
+ <activation>
+ <property>
+ <name>useUniqueContextRoot</name>
+ </property>
+ </activation>
+ <properties>
+
<
longhorn.war.name>okapi-longhorn-${project.version}</
longhorn.war.name>
+ </properties>
+ </profile>
+ </profiles>
+</project>
=======================================
--- /dev/null
+++
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/RESTInterface.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,382 @@
+/*===========================================================================
+ Copyright (C) 2011 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+package net.sf.okapi.applications.longhorn;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import
javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import net.sf.okapi.applications.longhorn.lib.ProjectUtils;
+import net.sf.okapi.applications.longhorn.lib.WorkspaceUtils;
+import net.sf.okapi.common.LocaleId;
+import net.sf.okapi.common.Util;
+import net.sf.okapi.common.exceptions.OkapiException;
+import net.sf.okapi.lib.longhornapi.impl.rest.transport.XMLStringList;
+
+import org.apache.commons.httpclient.HttpStatus;
+import
org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
+
+/**
+ * Handles Web-Service requests and delegates them to Rainbow/Okapi.
+ * Also does the handling of the input and output files.
+ *
+ *
+ * Basic workflow for processing files with the web-service:
+ *
+ * <ol>
+ * <li> POST /projects/new
+ * <li> POST /projects/1/batchConfiguration
+ * <li> POST /projects/1/inputFiles.zip
+ * <li> PUT /projects/1/inputFiles/a.html
+ * <li> PUT /projects/1/inputFiles/b.html
+ * <li> PUT /projects/1/inputFiles/c.html
+ * <li> POST /projects/1/tasks/execute
+ * <li> GET /projects/1/outputFiles
+ * <li> GET /projects/1/outputFiles/a.out.html
+ * <li> GET /projects/1/outputFiles/b.out.html
+ * <li> GET /projects/1/outputFiles/c.out.html
+ * <li> GET /projects/1/outputFiles.zip
+ * <li> DEL /projects/1
+ * </ol>
+ */
+@Path("/projects")
+public class RESTInterface {
+
+ //TODO DEL for input file
+ //TODO DEL for output file
+ //TODO DEL /projects/outputFiles to clear output directory
+ //TODO GET for batch conf
+
+ /**
+ * Create a new project to work with.
+ *
+ * @return The new project's URI
+ */
+ @POST
+ @Path("/new")
+ public Response createProject(@Context UriInfo uriInfo) {
+
+ int projId = ProjectUtils.createNewProject();
+
+ URI projectUri = uriInfo.getAbsolutePath().resolve(projId + "");
+ return Response.created(projectUri).build();
+ }
+
+ /**
+ * @return A list of all existing project folders (Integers in numerical
order)
+ */
+ @GET
+ @Path("/")
+ @Produces(MediaType.TEXT_XML)
+ public XMLStringList getProjects() {
+
+ ArrayList<Integer> projIds = WorkspaceUtils.getProjectIds();
+ return new XMLStringList(projIds);
+ }
+
+ /**
+ * Deletes a project directory. Should be used to clean up after all
processing is done.
+ *
+ * @param projId The id of the project to delete
+ * @return
+ */
+ @DELETE
+ @Path("/{projId}")
+ public Response deleteProject(@PathParam("projId") int projId) {
+
+ Util.deleteDirectory(WorkspaceUtils.getProjectPath(projId), false);
+
+ int status = HttpStatus.SC_OK;
+ return Response.status(status).build();
+ }
+
+ /**
+ * Installs the posted batch configuration file in the project with the
given id.
+ * This batch configuration will be used to process the input files.
+ *
+ * @param projId The id of the project the batch configuration shall be
added to
+ * @param input The batch configuration file as part of a multi-part
form. The parameter must have the name from
<code>WorkspaceUtils.BATCH_CONF_PARAM</code>
+ * @return
+ */
+ @POST
+ @Path("/{projId}/batchConfiguration")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ public Response addBatchConfigurationFile(@PathParam("projId") int
projId, MultipartFormDataInput input) {
+
+ try {
+ File tmpFile = input.getFormDataPart(WorkspaceUtils.BATCH_CONF_PARAM,
File.class, null);
+ ProjectUtils.addBatchConfig(projId, tmpFile);
+ tmpFile.delete();
+ }
+ catch (IOException e) {
+ int status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ return Response.status(status).build();
+ }
+
+ int status = HttpStatus.SC_OK;
+ return Response.status(status).build();
+ }
+
+ /**
+ * Stores the posted file in the input file's directory of the project
with the given id.
+ *
+ * @param projId The id of the project the file shall be added to
+ * @param filename The file's original filename
+ * @param input The input file as part of a multi-part form. The
parameter must have the name from
+ * <code>WorkspaceUtils.BATCH_CONF_PARAM</code>
+ * @return
+ */
+ @PUT
+ @POST
+ @Path("/{projId}/inputFiles/{filename:.+}")
+ public Response addProjectInputFile(@PathParam("projId") int projId,
@PathParam("filename") String filename,
+ MultipartFormDataInput input) {
+
+ try {
+ File tmpFile = input.getFormDataPart(WorkspaceUtils.INPUT_FILE_PARAM,
File.class, null);
+ ProjectUtils.addInputFile(projId, tmpFile, filename);
+ tmpFile.delete();
+ }
+ catch (IOException e) {
+ int status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ return Response.status(status).build();
+ }
+
+ int status = HttpStatus.SC_OK;
+ return Response.status(status).build();
+ }
+
+ /**
+ * @param projId The id of a project
+ * @return A list of the names of all input files uploaded yet
+ */
+ @GET
+ @Path("/{projId}/inputFiles")
+ @Produces(MediaType.TEXT_XML)
+ public XMLStringList getProjectInputFiles(@PathParam("projId") int
projId) {
+
+ ArrayList<String> inputFiles = WorkspaceUtils.getInputFileNames(projId);
+ return new XMLStringList(inputFiles);
+ }
+
+ /**
+ * Retrieve one of the input files that were added to the project before.
+ *
+ * @param projId The id of a project
+ * @param filename The name of the input file to fetch
+ * @return The specified file from the project
+ */
+ @GET
+ @Path("/{projId}/inputFiles/{filename:.+}")
+ @Produces(MediaType.WILDCARD)
+ public File getProjectInputFile(
+ @PathParam("projId") int projId, @PathParam("filename") String
filename) {
+
+ return WorkspaceUtils.getInputFile(projId, filename);
+ }
+
+ /**
+ * Executes the uploaded batch configuration on the input files that have
been added.
+ *
+ * @param projId The id of the project to be executed
+ * @return
+ */
+ @POST
+ @Path("/{projId}/tasks/execute")
+ public Response executeProject(@PathParam("projId") int projId) {
+
+ try {
+ ProjectUtils.executeProject(projId);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ int status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ String type = MediaType.TEXT_PLAIN;
+ String body = e.toString();
+ return Response.status(status).type(type).entity(body).build();
+ }
+
+ int status = HttpStatus.SC_OK;
+ return Response.status(status).build();
+ }
+
+ /**
+ * Executes the uploaded batch configuration on the input files that have
been added.
+ *
+ * @param projId The id of the project to be executed
+ * @param sourceLanguage source language for pipeline
+ * @param targetLanguage target language for pipeline
+ * @return
+ */
+ @POST
+ @Path("/{projId}/tasks/execute/{source}/{target}")
+ public Response executeProject(@PathParam("projId") int projId,
@PathParam("source") String sourceLanguage, @PathParam("target") String
targetLanguage) {
+
+ try {
+ ProjectUtils.executeProject(projId, sourceLanguage, targetLanguage,
null);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ int status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ String type = MediaType.TEXT_PLAIN;
+ String body = e.toString();
+ return Response.status(status).type(type).entity(body).build();
+ }
+
+ int status = HttpStatus.SC_OK;
+ return Response.status(status).build();
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return A list of the names of all output files that have been
generated in that project
+ */
+ @GET
+ @Path("/{projId}/outputFiles")
+ @Produces(MediaType.TEXT_XML)
+ public XMLStringList getProjectOutputFiles(@PathParam("projId") int
projId) {
+
+ ArrayList<String> outputFiles =
WorkspaceUtils.getOutputFileNames(projId);
+ return new XMLStringList(outputFiles);
+ }
+
+ /**
+ * Retrieve one of the output files generated by Okapi/Rainbow.
+ *
+ * @param projId The id of a project
+ * @param filename The name of the input file to fetch
+ * @return The specified file from the project
+ */
+ @GET
+ @Path("/{projId}/outputFiles/{filename:.+}")
+ @Produces(MediaType.WILDCARD)
+ public File getProjectOutputFile(
+ @PathParam("projId") int projId, @PathParam("filename") String
filename) {
+
+ return WorkspaceUtils.getOutputFile(projId, filename);
+ }
+
+ @POST
+ @Path("/{projId}/inputFiles.zip")
+ public Response addProjectInputFilesFromArchive(@PathParam("projId") int
projId, MultipartFormDataInput input) {
+
+ try {
+ File tmpFile = input.getFormDataPart(WorkspaceUtils.INPUT_FILE_PARAM,
File.class, null);
+ ProjectUtils.addInputFilesFromArchive(projId, tmpFile);
+ tmpFile.delete();
+ }
+ catch (IOException e) {
+ int status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ return Response.status(status).build();
+ }
+
+ int status = HttpStatus.SC_OK;
+ return Response.status(status).build();
+ }
+
+ @GET
+ @Path("/{projId}/outputFiles.zip")
+ @Produces(MediaType.WILDCARD)
+ public File getProjectOutputFilesAsArchive(
+ @PathParam("projId") int projId) throws IOException {
+
+ //TODO how to do exception handling?
+ return WorkspaceUtils.getOutputFilesAsArchive(projId);
+ }
+
+ /**
+ * Retrieve one of the output files generated by Okapi/Rainbow inside a
ZIP file.
+ *
+ * @param projId The id of a project
+ * @param filename The name of the input file to fetch (with '.zip'
appended)
+ * @return The specified file from the project inside a ZIP.
+ */
+ @GET
+ @Path("/{projId}/outputFile.zip/{filename:.+}.zip")
+ @Produces("application/zip")
+ public File getProjectOutputFileAsZip(
+ @PathParam("projId") int projId, @PathParam("filename") String
filename) throws IOException {
+
+ final File desiredFile = WorkspaceUtils.getOutputFile(projId, filename);
+
+ File tempZip = File.createTempFile("~okapi-4_", ".zip");
+ if (0 == WorkspaceUtils.zip(Collections.singleton(desiredFile),
+ WorkspaceUtils.getOutputDirPath(projId) + File.separator, tempZip))
+ throw new OkapiException("Error while addind the output files to an
archive.");
+
+ return tempZip;
+ }
+
+ /**
+ * Executes the uploaded batch configuration on the input files that have
been added.
+ *
+ * @param projId The id of the project to be executed
+ * @param sourceLanguage source language for pipeline
+ * @param targetLanguages target languages, the first of which is used
for the pipeline, the rest stored for
+ * Textpool leveraging.
+ */
+ @POST
+ @Path("/{projId}/tasks/execute/{sourceLanguage}")
+ public Response executeProject(
+ @PathParam("projId") final int projId,
+ @PathParam("sourceLanguage") final String sourceLanguage,
+ @QueryParam("targets") final List<String> targetLanguages) {
+
+ try {
+ List<LocaleId> targetLocales =
LocaleId.convertToLocaleIds(targetLanguages);
+ ProjectUtils.executeProject(projId, sourceLanguage,
targetLanguages.get(0), targetLocales);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ final int status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ final String type = MediaType.TEXT_PLAIN;
+ final String body = createStacktraceString(e);
+ return Response.status(status).type(type).entity(body).build();
+ }
+
+ return Response.status(HttpStatus.SC_OK).build();
+ }
+
+ private String createStacktraceString(final Exception e) {
+ final StringWriter writer = new StringWriter();
+ e.printStackTrace(new PrintWriter(writer));
+ return writer.toString();
+ }
+}
=======================================
--- /dev/null
+++
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/lib/Configuration.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,167 @@
+/*===========================================================================
+ Copyright (C) 2011 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+package net.sf.okapi.applications.longhorn.lib;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import net.sf.okapi.common.exceptions.OkapiException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class Configuration {
+
+ private static final String DOUBLE_BACKSLASH = "\\\\";
+ private static final String DOUBLESLASH = "//";
+ private static final String SLASH = "/";
+ private static final String VERSION_PROPERTY = "version";
+ private static final String WORKING_DIRECTORY = "working-directory";
+ private static final String USE_UNIQUE_WORKING_DIRECTORY
= "use-unique-working-directory";
+ private final Logger LOGGER = LoggerFactory.getLogger(getClass());
+ private static final String DEF_WORKING_DIR =
System.getProperty("user.home") + File.separator +
+ "Okapi-Longhorn-Files";
+ private String versionPropertyFileName = "/version.properties";
+ private String workingDirectory;
+
+ public Configuration() {
+ LOGGER.info("The default working directory for Okapi Longhorn will be
used, " +
+ "because no other was specified: " + DEF_WORKING_DIR);
+ workingDirectory = DEF_WORKING_DIR;
+ }
+
+ public Configuration(String workingDir) {
+ workingDir = workingDir.replace("\\", File.separator);
+ workingDir = workingDir.replace(SLASH, File.separator);
+ workingDirectory = workingDir;
+ }
+
+ public Configuration(InputStream confXml) {
+ loadFromFile(confXml);
+ }
+
+ private String getAPIVersion() {
+ String path = getVersionPropertyFileName();
+ InputStream stream = getClass().getResourceAsStream(path);
+ if (stream == null)
+ return null;
+ Properties props = new Properties();
+ try {
+ props.load(stream);
+ stream.close();
+ return (String) props.get(VERSION_PROPERTY);
+ }
+ catch (IOException e) {
+ return null;
+ }
+ }
+
+ public void loadFromFile(InputStream confXml) {
+ workingDirectory = null;
+ try {
+ Document Doc = createDocumentBuilderForFile(confXml);
+ workingDirectory = getWorkingDirectory(Doc);
+ boolean useUniqueWorkingDir = getUseUniqueWorkingDir(Doc);
+ if (useUniqueWorkingDir) {
+ workingDirectory =
cleanUpPathAndRemoveLastFileSeperator(workingDirectory);
+ String version = getAPIVersion();
+ if (version == null) {
+ LOGGER.warn("No version file found. Can't create unique working
directoy for longhorn.");
+ throw new OkapiException("UseUniqueWorkingDir is set to true but no
version for longhorn found.");
+ }
+ workingDirectory = workingDirectory + "_M" + version;
+ }
+ }
+ catch (DOMException e) {
+ throw new OkapiException(e);
+ }
+ catch (SAXException e) {
+ throw new OkapiException(e);
+ }
+ catch (IOException e) {
+ throw new OkapiException(e);
+ }
+ catch (ParserConfigurationException e) {
+ throw new OkapiException(e);
+ }
+ if (workingDirectory == null)
+ throw new IllegalArgumentException("Working directory not specified in
configuration file");
+ }
+
+ private String cleanUpPathAndRemoveLastFileSeperator(String path) {
+ path = path.replace(DOUBLE_BACKSLASH, File.separator);
+ path = path.replace(DOUBLESLASH, File.separator);
+ path = path.replace(SLASH, File.separator);
+ if (path.endsWith(File.separator)) {
+ path = path.substring(0, path.length() - 1);
+ }
+ return path;
+ }
+
+ private String getWorkingDirectory(Document Doc) {
+ NodeList nodeList = Doc.getElementsByTagName(WORKING_DIRECTORY);
+ return readTextContent(nodeList);
+ }
+
+ private Document createDocumentBuilderForFile(InputStream confXml) throws
SAXException, IOException,
+ ParserConfigurationException {
+ DocumentBuilderFactory Fact = DocumentBuilderFactory.newInstance();
+ Fact.setValidating(false);
+ Document Doc = Fact.newDocumentBuilder().parse(confXml);
+ return Doc;
+ }
+
+ private String readTextContent(NodeList nodeList) {
+ String textContent = null;
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ textContent = nodeList.item(i).getTextContent();
+ }
+ return textContent;
+ }
+
+ private boolean getUseUniqueWorkingDir(Document Doc) {
+ NodeList nodeList =
Doc.getElementsByTagName(USE_UNIQUE_WORKING_DIRECTORY);
+ String useUniqueWorkingDirString = readTextContent(nodeList);
+ boolean useUniqueWorkingDir =
Boolean.parseBoolean(useUniqueWorkingDirString);
+ return useUniqueWorkingDir;
+ }
+
+ public String getWorkingDirectory() {
+ return workingDirectory;
+ }
+
+ protected String getVersionPropertyFileName() {
+ return versionPropertyFileName;
+ }
+
+ protected void setVersionPropertyFileName(String versionPropertyFileName)
{
+ this.versionPropertyFileName = versionPropertyFileName;
+ }
+}
=======================================
--- /dev/null
+++
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/lib/ProjectUtils.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,331 @@
+/*===========================================================================
+ Copyright (C) 2011 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+package net.sf.okapi.applications.longhorn.lib;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+
+import net.sf.okapi.applications.rainbow.Project;
+import net.sf.okapi.applications.rainbow.batchconfig.BatchConfiguration;
+import net.sf.okapi.applications.rainbow.lib.LanguageManager;
+import net.sf.okapi.applications.rainbow.pipeline.PipelineWrapper;
+import net.sf.okapi.applications.rainbow.pipeline.StepInfo;
+import net.sf.okapi.common.ExecutionContext;
+import net.sf.okapi.common.LocaleId;
+import net.sf.okapi.common.StreamUtil;
+import net.sf.okapi.common.Util;
+import net.sf.okapi.common.exceptions.OkapiException;
+import net.sf.okapi.common.filters.DefaultFilters;
+import net.sf.okapi.common.filters.FilterConfigurationMapper;
+import net.sf.okapi.common.plugins.PluginsManager;
+import net.sf.okapi.filters.rainbowkit.Manifest;
+import net.sf.okapi.filters.rainbowkit.RainbowKitFilter;
+import net.sf.okapi.steps.rainbowkit.creation.ExtractionStep;
+import net.sf.okapi.steps.rainbowkit.creation.Parameters;
+import net.sf.okapi.steps.rainbowkit.postprocess.MergingStep;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ProjectUtils {
+ private static final String CURRENT_PROJECT_PIPELINE
= "currentProjectPipeline";
+
+ public static synchronized int createNewProject() {
+
+ int projId = WorkspaceUtils.determineNewProjectId();
+
+ File workingDir = new File(WorkspaceUtils.getWorkingDirectory());
+ if (!workingDir.exists()) {
+ Logger localLogger = LoggerFactory.getLogger(ProjectUtils.class);
+ localLogger.info("The working directory " +
workingDir.getAbsolutePath() + " doesn't exist. " +
+ "It will be created.");
+ }
+
+ Util.createDirectories(WorkspaceUtils.getInputDirPath(projId) +
File.separator);
+ Util.createDirectories(WorkspaceUtils.getConfigDirPath(projId) +
File.separator);
+ Util.createDirectories(WorkspaceUtils.getOutputDirPath(projId) +
File.separator);
+
+ return projId;
+ }
+
+ public static void addBatchConfig(int projId, File tmpFile) {
+ PluginsManager plManager = new PluginsManager();
+ try {
+ File targetFile = WorkspaceUtils.getBatchConfigurationFile(projId);
+ StreamUtil.copy(tmpFile, targetFile);
+
+ PipelineWrapper pipelineWrapper = preparePipelineWrapper(projId,
plManager);
+
+ // install batch configuration to config directory
+ BatchConfiguration bconf = new BatchConfiguration();
+ bconf.installConfiguration(targetFile.getAbsolutePath(),
+ WorkspaceUtils.getConfigDirPath(projId), pipelineWrapper);
+ }
+ finally {
+ plManager.releaseClassLoader();
+ }
+ }
+
+ /**
+ * Loads the default filter configurations from Okapi and also the custom
filter
+ * configurations and plug-ins from the project's configuration directory
+ * (where the batch configuration should have been installed to).
+ *
+ * @param projId The id of a local project
+ * @param plug-in manager for this wrapper
+ * @return A PipelineWrapper using all available filter configurations
and plug-ins
+ */
+ private static PipelineWrapper preparePipelineWrapper(int projId,
PluginsManager plManager) {
+ // Load local plug-ins
+ plManager.discover(new File(WorkspaceUtils.getConfigDirPath(projId)),
true);
+
+ // Initialize filter configurations
+ FilterConfigurationMapper fcMapper = new FilterConfigurationMapper();
+ DefaultFilters.setMappings(fcMapper, false, true);
+ fcMapper.addFromPlugins(plManager);
+
fcMapper.setCustomConfigurationsDirectory(WorkspaceUtils.getConfigDirPath(projId));
+ fcMapper.updateCustomConfigurations();
+
+ // Load pipeline
+ ExecutionContext context = new ExecutionContext();
+ context.setApplicationName("Longhorn");
+ context.setIsNoPrompt(true);
+ PipelineWrapper pipelineWrapper = new PipelineWrapper(fcMapper,
WorkspaceUtils.getConfigDirPath(projId),
+ plManager, WorkspaceUtils.getInputDirPath(projId),
WorkspaceUtils.getInputDirPath(projId),
+ WorkspaceUtils.getOutputDirPath(projId), null, context);
+ pipelineWrapper.addFromPlugins(plManager);
+ return pipelineWrapper;
+ }
+
+ public static void addInputFile(int projId, File tmpFile, String
filename) {
+ File targetFile = WorkspaceUtils.getInputFile(projId, filename);
+ Util.createDirectories(targetFile.getAbsolutePath());
+ StreamUtil.copy(tmpFile, targetFile);
+ }
+
+ public static void executeProject(int projId) throws IOException{
+ executeProject(projId, null, null);
+ }
+
+ /**
+ * @param projId The ID of the temporary Longhorn project
+ * @param sourceLanguage The source language
+ * @param targetLanguage The main target language (for components that
don't support multiple target locales)
+ * @throws IOException
+ */
+ public static void executeProject(int projId, String sourceLanguage,
String targetLanguage) throws IOException {
+ executeProject(projId, sourceLanguage, targetLanguage, null);
+ }
+
+ /**
+ * @param projId The ID of the temporary Longhorn project
+ * @param sourceLanguage The source language
+ * @param targetLanguage The main target language (for components that
don't support multiple target locales)
+ * @param targetLocales The full list of target locales (may be null)
+ * @throws IOException
+ */
+ public static void executeProject(int projId, String sourceLanguage,
String targetLanguage, List<LocaleId> targetLocales) throws IOException {
+ PluginsManager plManager = new PluginsManager();
+ try {
+
+ // Create a pipeline wrapper
+ PipelineWrapper pipelineWrapper = preparePipelineWrapper(projId,
plManager);
+ // Load pipeline from file
+ File pipelineFile = WorkspaceUtils.getPipelineFile(projId);
+ pipelineWrapper.load(pipelineFile.getAbsolutePath());
+
+ Project rainbowProject = prepareRainbowProject(projId, sourceLanguage,
targetLanguage, pipelineWrapper);
+
+ // Adjust paths from specific steps
+ adjustStepsPaths(projId, pipelineWrapper);
+
+ // Load mapping of filter configs to file extensions
+ HashMap<String, String> filterConfigByExtension =
loadFilterConfigurationMapping(projId);
+
+ // Add files to project input list
+ if (!isTKitMergePipeline(pipelineWrapper)) {
+ addDocumentsToProject(projId, rainbowProject, filterConfigByExtension);
+ }
+ else {
+ addManifestToProject(projId, rainbowProject, filterConfigByExtension);
+ }
+
+ rainbowProject.getPathBuilder().setUseExtension(false);
+
+ // Execute pipeline
+ pipelineWrapper.execute(rainbowProject, targetLocales);
+ }
+ finally {
+ plManager.releaseClassLoader();
+ }
+ }
+
+ private static Project prepareRainbowProject(int projId, String
sourceLanguage, String targetLanguage,
+ PipelineWrapper pipelineWrapper) {
+ // Create a new, empty rainbow project
+ Project rainbowProject = new Project(new LanguageManager());
+
rainbowProject.setCustomParametersFolder(WorkspaceUtils.getConfigDirPath(projId));
+ rainbowProject.setUseCustomParametersFolder(true);
+
+ if (sourceLanguage != null){
+ rainbowProject.setSourceLanguage(new LocaleId(sourceLanguage, true));
+ }
+ if (targetLanguage != null){
+ rainbowProject.setTargetLanguage(new LocaleId(targetLanguage, true));
+ }
+
+ rainbowProject.setUtilityParameters(CURRENT_PROJECT_PIPELINE,
pipelineWrapper.getStringStorage());
+
+ // Set new input and output root
+ rainbowProject.setInputRoot(0, WorkspaceUtils.getInputDirPath(projId),
true);
+ rainbowProject.setOutputRoot(WorkspaceUtils.getOutputDirPath(projId));
+ rainbowProject.setUseOutputRoot(true);
+ return rainbowProject;
+ }
+
+ /**
+ * Adjusts input and output paths from specific steps
+ *
+ * @param pipelineWrapper The pipeline wrapper with the pipeline to be
executed
+ */
+ private static void adjustStepsPaths(int projId, PipelineWrapper
pipelineWrapper) {
+ for (StepInfo step : pipelineWrapper.getSteps()) {
+ // TKit Creation
+ if (step.stepClass.equals(ExtractionStep.class.getName())) {
+ Parameters tkitParams = new Parameters();
+ tkitParams.fromString(step.paramsData);
+
tkitParams.setPackageDirectory(WorkspaceUtils.getOutputDirPath(projId));
+ step.paramsData = tkitParams.toString();
+ }
+ //TKit Merge
+ if (step.stepClass.equals(MergingStep.class.getName())) {
+ net.sf.okapi.steps.rainbowkit.postprocess.Parameters tkitParams =
+ new net.sf.okapi.steps.rainbowkit.postprocess.Parameters();
+ tkitParams.fromString(step.paramsData);
+
tkitParams.setOverrideOutputPath(WorkspaceUtils.getOutputDirPath(projId));
+ step.paramsData = tkitParams.toString();
+ }
+ }
+ }
+
+ /**
+ * @param pipelineWrapper The pipeline wrapper with the pipeline to
execute
+ * @return true if one of the step is the Rainbow TKit Merging Step,
false otherwise
+ */
+ private static boolean isTKitMergePipeline(PipelineWrapper
pipelineWrapper) {
+ for (StepInfo step : pipelineWrapper.getSteps()) {
+ if (step.stepClass.equals(MergingStep.class.getName()))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Adds all input files from the local project directory with the
specified projId to the Rainbow project.
+ * The HashMap will be used to assign filter configurations to the files
(by the file's extension).
+ *
+ * @param projId The id of the local project in which the input files are
located
+ * @param rainbowProject The Rainbow project to which the input files
shall be added
+ * @param filterConfigByExtension The mapping from file extensions
(including dot, ".html" for example)
+ * to filter configurations (e.g. "okf_html@Customized")
+ */
+ private static void addDocumentsToProject(int projId, Project
rainbowProject,
+ HashMap<String, String> filterConfigByExtension) {
+
+ for (File inputFile : WorkspaceUtils.getInputFiles(projId)) {
+
+ String extension = Util.getExtension(inputFile.getName());
+ String filterConfigurationId = filterConfigByExtension.get(extension);
+
+ int status = rainbowProject.addDocument(
+ 0, inputFile.getAbsolutePath(), null, null, filterConfigurationId,
false);
+
+ if (status == 1)
+ throw new OkapiException("Adding document " + inputFile.getName() + "
to list of input files failed");
+ }
+ }
+
+ /**
+ * Adds all Rainbow TKit manifest files from the local project directory
with the specified projId to the Rainbow project.
+ * The HashMap will be used to assign the correct filter configuration.
+ *
+ * @param projId The id of the local project in which the input files are
located
+ * @param rainbowProject The Rainbow project to which the input files
shall be added
+ * @param filterConfigByExtension The mapping from file extensions
(including dot, ".html" for example)
+ * to filter configurations (e.g. "okf_html@Customized")
+ */
+ private static void addManifestToProject(int projId, Project
rainbowProject,
+ HashMap<String, String> filterConfigByExtension) {
+
+ for (File inputFile : WorkspaceUtils.getInputFiles(projId)) {
+
+ String extension = Util.getExtension(inputFile.getName());
+ String filterConfigurationId = filterConfigByExtension.get(extension);
+
+ if
(inputFile.getName().endsWith(RainbowKitFilter.RAINBOWKIT_PACKAGE_EXTENSION)
||
+ inputFile.getName().equals(Manifest.MANIFEST_FILENAME +
Manifest.MANIFEST_EXTENSION)) {
+
+ int status = rainbowProject.addDocument(
+ 0, inputFile.getAbsolutePath(), null, null, filterConfigurationId,
false);
+
+ if (status == 1)
+ throw new OkapiException("Adding document " + inputFile.getName() + "
to list of input files failed");
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * Loads project's file extension to filter configuration mapping.
+ *
+ * @param projId The id of the project that has the mapping file in it's
configuration sub-folder
+ * @return A HashMap with the file extension (keys) to filter
configuration (values) mapping
+ * @throws IOException If the file could not be read or it doesn't exist
+ */
+ private static HashMap<String, String> loadFilterConfigurationMapping(int
projId)
+ throws IOException {
+
+ BufferedReader fh = new BufferedReader(new
FileReader(WorkspaceUtils.getFilterMappingFile(projId)));
+ HashMap<String, String> filterConfigByExtension = new HashMap<String,
String>();
+
+ String s;
+
+ while ((s = fh.readLine()) != null) {
+ String fields[] = s.split("\t");
+ String ext = fields[0];
+ String fc = fields[1];
+
+ filterConfigByExtension.put(ext, fc);
+ }
+ fh.close();
+
+ return filterConfigByExtension;
+ }
+
+ public static void addInputFilesFromArchive(int projId, File zipFile)
throws IOException {
+ WorkspaceUtils.unzip(zipFile, WorkspaceUtils.getInputDirPath(projId));
+ }
+}
=======================================
--- /dev/null
+++
/applications/longhorn/src/main/java/net/sf/okapi/applications/longhorn/lib/WorkspaceUtils.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,454 @@
+/*===========================================================================
+ Copyright (C) 2011 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+package net.sf.okapi.applications.longhorn.lib;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+import net.sf.okapi.common.DefaultFilenameFilter;
+import net.sf.okapi.common.Util;
+import net.sf.okapi.common.exceptions.OkapiException;
+
+/**
+ * Utilities for the web-service's project and file handling.
+ */
+public final class WorkspaceUtils {
+ private static final String PLUGINS = "plugins";
+ private static final String BATCH_CONF = "settings.bconf";
+ private static final String EXTENSIONS_MAPPING = "extensions-mapping.txt";
+ private static final String INPUT = "input";
+ private static final String CONFIG = "config";
+ private static final String OUTPUT = "output";
+ private static final FilenameFilter DIRECTORY_FILTER = new
FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ File file = new File(dir.getAbsolutePath() + File.separator + name);
+ return file.isDirectory();
+ }
+ };
+ private static final FilenameFilter ANY_FILE_FILTER = new
FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ File file = new File(dir.getAbsolutePath() + File.separator + name);
+ return file.isFile();
+ }
+ };
+ private static final Comparator<File> FILE_PATH_COMPARATOR = new
Comparator<File>() {
+
+ @Override
+ public int compare(File file1, File file2) {
+ // Comparing the canonical paths doesn't have any bonuses.
+ // As the file objects are all created in the same way, we don't need
to 'normalize' them.
+ String filepath1 = file1.getAbsolutePath();
+ String filepath2 = file2.getAbsolutePath();
+ return filepath1.compareTo(filepath2);
+ }
+ };
+ private static final int BUFFER = 102400;
+
+ public static final String BATCH_CONF_PARAM = "batchConfiguration";
+ public static final String INPUT_FILE_PARAM = "inputFile";
+
+ /**
+ * @return The directory where the local projects will be created and
saved temporarily
+ */
+ public static String getWorkingDirectory() {
+ //TODO Don't re-load that every time!
+ Configuration conf = loadConfig();
+ return conf.getWorkingDirectory();
+ }
+
+ /**
+ * TODO update JavaDoc!
+ *
+ * @return The user's configuration (if
<code>System.getProperty("user.home")
+ "/okapi-longhorn-configuration.xml"</code>
+ * was found) or the default configuration
+ */
+ private static Configuration loadConfig() {
+
+ Configuration config = null;
+
+ String workdirEnvVar = System.getProperty("LONGHORN_WORKDIR");
+ String userHome = System.getProperty("user.home");
+ File userConfig = new File(userHome
+ "/okapi-longhorn-configuration.xml");
+
+ if (workdirEnvVar != null) {
+ config = new Configuration(workdirEnvVar);
+ }
+ else if (userConfig.exists()) {
+ try {
+ config = new Configuration(new FileInputStream(userConfig));
+ }
+ catch (FileNotFoundException e) {
+ // This should be impossible, because we checked for the existence of
the file
+ throw new OkapiException(e);
+ }
+ }
+ else {
+ config = new Configuration();
+ }
+
+ return config;
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The project's absolute path on the file system
+ * (without a trailing path separator)
+ */
+ public static String getProjectPath(int projId) {
+
+ return getWorkingDirectory() + File.separator + projId;
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The project's batch configuration file
+ */
+ public static File getBatchConfigurationFile(int projId) {
+
+ return new File(getProjectPath(projId) + File.separator + BATCH_CONF);
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The absolute path of the project's input files directory on
the file system
+ * (without a trailing path separator)
+ */
+ public static String getInputDirPath(int projId) {
+
+ return getProjectPath(projId) + File.separator + INPUT;
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @param filename The name of the file to return
+ * @return The input file with the specified file name that belongs to
the project
+ */
+ public static File getInputFile(int projId, String filename) {
+
+ return new File(getInputDirPath(projId) + File.separator + filename);
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return All input files belonging to the project
+ */
+ public static List<File> getInputFiles(int projId) {
+
+ return getFilesRecursivly(new File(getInputDirPath(projId)));
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return A (string) list of the file names of the project's input files
+ */
+ public static ArrayList<String> getInputFileNames(int projId) {
+
+ Collection<File> files = getInputFiles(projId);
+ return getFileNames(files, getInputDirPath(projId) + File.separator);
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The absolute path of the project's output files directory on
the file system
+ * (without a trailing path separator)
+ */
+ public static String getOutputDirPath(int projId) {
+
+ return getProjectPath(projId) + File.separator + OUTPUT;
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The absolute path of the project's configuration files
directory on the file system
+ * (without a trailing path separator)
+ */
+ public static String getConfigDirPath(int projId) {
+
+ return getProjectPath(projId) + File.separator + CONFIG;
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The first file in the project's configuration directory with
the extension ".pln" or null if none exists
+ */
+ public static File getPipelineFile(int projId) {
+ File[] pipelineFiles =
getFilteredFiles(getConfigDirPath(projId), ".pln");
+ if (pipelineFiles.length == 0)
+ return null;
+ return pipelineFiles[0];
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return The project's file extension-to-filter-configuration mapping
file
+ */
+ public static File getFilterMappingFile(int projId) {
+
+ return new File(getConfigDirPath(projId) + File.separator +
EXTENSIONS_MAPPING);
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @param filename The name of the file to return
+ * @return The output file with the given file name that belongs to the
project
+ */
+ public static File getOutputFile(int projId, String filename) {
+
+ return new File(getOutputDirPath(projId) + File.separator + filename);
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return All output files belonging to the project
+ */
+ public static List<File> getOutputFiles(int projId) {
+
+ return getFilesRecursivly(new File(getOutputDirPath(projId)));
+ }
+
+ /**
+ * @param projId The id of a local project
+ * @return A (string) list of the file names of the project's output files
+ */
+ public static ArrayList<String> getOutputFileNames(int projId) {
+
+ Collection<File> files = getOutputFiles(projId);
+ return getFileNames(files, getOutputDirPath(projId) + File.separator);
+ }
+
+ /**
+ * @param files Any collection of files
+ * @param rootDir The path that is the starting point for the returned
relative file paths (WITH trailing path separator)
+ * @return The names of the given files (including their extension and
their relative path from the root directory with '/' as path separator)
+ */
+ public static ArrayList<String> getFileNames(Collection<File> files,
String rootDir) {
+
+ ArrayList<String> relFilePaths = new ArrayList<String>();
+ for (File file : files) {
+ String relativePath =
file.getAbsolutePath().substring(rootDir.length());
+ relativePath = relativePath.replace("\\", "/");
+ relFilePaths.add(relativePath);
+ }
+ return relFilePaths;
+ }
+
+ /**
+ * @return A list of all project ids that are currently in use (in
numerical order)
+ */
+ public static ArrayList<Integer> getProjectIds() {
+
+ ArrayList<Integer> projectIds = new ArrayList<Integer>();
+ File[] subDirs = getSubdirectories(getWorkingDirectory());
+
+ if(subDirs == null)
+ // The Directory has not yet been created
+ return projectIds;
+
+ Collection<File> directories = Arrays.asList(subDirs);
+
+ for (File dir : directories) {
+ if (PLUGINS.equals(dir.getName()))
+ continue;
+ projectIds.add(Integer.parseInt(dir.getName()));
+ }
+
+ // Sort list, so new project folders are at the end.
+ // The OS may put 10 in between 1 and 2.
+ Collections.sort(projectIds);
+
+ return projectIds;
+ }
+
+ /**
+ * @return The highest project id currently in use, increased by 1
+ */
+ public static int determineNewProjectId() {
+
+ ArrayList<Integer> takenProjectIds = getProjectIds();
+
+ if (takenProjectIds.isEmpty())
+ return 1;
+
+ // List is in numerical order, so we can simply increase the last value
by 1
+ Integer highestId = takenProjectIds.get(takenProjectIds.size() - 1);
+ return highestId + 1;
+ }
+
+
+ /**
+ * Filter files in a directory by their extension.
+ *
+ * @param directory - directory where files are located
+ * @param extension - the extension used to filter files
+ * @return - list of files matching the suffix, all files in the
directory if suffix is null
+ */
+ private static File[] getFilteredFiles(String directory, String
extension) {
+ File dir = new File(directory);
+ return dir.listFiles(new DefaultFilenameFilter(extension));
+ }
+
+
+ /**
+ * Get all files in a directory (and it's sub-directories).
+ *
+ * The files are sorted by their absolute file path.
+ *
+ * @param directory - root directory
+ * @return - list all files in that directory and it's sub-directories
+ */
+ private static ArrayList<File> getFilesRecursivly(File dir) {
+
+ ArrayList<File> allFiles = new ArrayList<File>();
+
+ for (File subDir : dir.listFiles(DIRECTORY_FILTER)) {
+ allFiles.addAll(getFilesRecursivly(subDir));
+ }
+
+ File[] files = dir.listFiles(ANY_FILE_FILTER);
+ allFiles.addAll(Arrays.asList(files));
+
+ allFiles = sortFilesByPath(allFiles);
+
+ return allFiles;
+ }
+
+ /**
+ * Sorts Files by their {@link File#getAbsolutePath()}
+ *
+ * @param unsortedFiles The collection to be sorted
+ * @return A clone of the parameter collection, which is sorted by the
files' paths.
+ */
+ protected static ArrayList<File> sortFilesByPath(Collection<File>
unsortedFiles) {
+ ArrayList<File> sortedFiles = new ArrayList<File>(unsortedFiles.size());
+ sortedFiles.addAll(unsortedFiles);
+
+ Collections.sort(sortedFiles, FILE_PATH_COMPARATOR);
+
+ return sortedFiles;
+ }
+
+ /**
+ * @param directory - directory where sub-directories are located
+ * @return - list of the directory's sub-directories or null if the
directory does not exist
+ */
+ private static File[] getSubdirectories(String directory) {
+ File dir = new File(directory);
+ File[] directories = dir.listFiles(DIRECTORY_FILTER);
+ return directories;
+ }
+
+ public static File getOutputFilesAsArchive(int projId) throws IOException
{
+
+ File tempZip = File.createTempFile("~okapi-3_", ".zip");
+ if (0 == zip(getOutputFiles(projId), getOutputDirPath(projId) +
File.separator, tempZip))
+ throw new OkapiException("Error while addind the output files to an
archive.");
+
+ return tempZip;
+ }
+
+ public static void unzip(File zipFile, String targetDirectory) throws
IOException {
+
+ ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));
+
+ ZipEntry entry;
+ while ((entry = zis.getNextEntry()) != null) {
+
+ // Skip directories here. They will be created anyway.
+ if (entry.isDirectory())
+ continue;
+
+ // Skip Mac specific directories
+ if (entry.getName().contains("__MACOSX"))
+ continue;
+
+ int count;
+ byte data[] = new byte[BUFFER];
+ String targetFilePath = targetDirectory + File.separator +
entry.getName();
+
+ // Normalize separators
+ targetFilePath = targetFilePath.replace("\\", File.separator);
+ targetFilePath = targetFilePath.replace("/", File.separator);
+ Util.createDirectories(targetFilePath);
+
+ FileOutputStream fos = new FileOutputStream(targetFilePath);
+ while ((count = zis.read(data, 0, BUFFER)) != -1) {
+ fos.write(data, 0, count);
+ }
+ fos.flush();
+ fos.close();
+ }
+ zis.close();
+ }
+
+ /**
+ * @param files Files to be added to the new zip archive
+ * @param rootDirectory Root directory of the files WITH trailing path
separator (directories below will be in the archive)
+ * @param destZip The zip archive to be created
+ * @return 1 if the zip archive was created, 0 if some of the files were
outside of the specified root directory
+ * @throws IOException
+ */
+ public static int zip(Collection<File> files, String rootDirectory, File
destZip) throws IOException {
+
+ for (File file : files) {
+ if (!file.getAbsolutePath().startsWith(rootDirectory))
+ return 0;
+ }
+
+ FileOutputStream dest = new FileOutputStream(destZip);
+ BufferedInputStream origin = null;
+ ZipOutputStream out = new ZipOutputStream(new
BufferedOutputStream(dest));
+
+ byte data[] = new byte[BUFFER];
+
+ for (File file : files) {
+ FileInputStream fi = new FileInputStream(file);
+ origin = new BufferedInputStream(fi, BUFFER);
+ String entryName =
file.getAbsolutePath().substring(rootDirectory.length());
+ ZipEntry entry = new ZipEntry(entryName);
+ out.putNextEntry(entry);
+ int count;
+ while ((count = origin.read(data, 0, BUFFER)) != -1) {
+ out.write(data, 0, count);
+ }
+ origin.close();
+ }
+ out.close();
+
+ return 1;
+ }
+}
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/resources/version.properties Mon Sep 29
18:32:37 2014 UTC
@@ -0,0 +1,1 @@
+version=${project.version}
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/WEB-INF/jboss-classloading.xml
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classloading xmlns="urn:jboss:classloading:1.0"
+ name="${
longhorn.war.name}.war" domain="${
longhorn.war.name}.war"
+ export-all="NON_EMPTY" import-all="true">
+</classloading>
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/WEB-INF/web.xml Mon Sep 29
18:32:37 2014 UTC
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
+ "
http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <context-param>
+ <param-name>resteasy.resources</param-name>
+
<param-value>net.sf.okapi.applications.longhorn.RESTInterface</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>
+ org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Resteasy</servlet-name>
+ <servlet-class>
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Resteasy</servlet-name>
+ <url-pattern>/projects/*</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>okapi-longhorn-sample-js-client.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/css/okapi-longhorn.css Mon Sep
29 18:32:37 2014 UTC
@@ -0,0 +1,22 @@
+.content { font-family: sans-serif; font-size: 0.9em; margin: 8 8 8 8; }
+
+td { font-size: 0.9em; }
+
+td.head { padding: 0; margin: 0; vertical-align: top; }
+h1.head { margin: 0 0 0 0; color: white; background-color: #336699;
padding: 0.3em; }
+h2.head { vertical-align: top; margin: 2 0 0 2; color: white;
background-color: #008080;
+ font-weight: normal; padding: 0.5em 0.5em 0.5em 1.5em; font-size: 1.4em; }
+
+h2.head2 { vertical-align: top; margin: 2 0 0 0; color: white;
background-color: #008080;
+ font-weight: normal; padding: 0.5em 0.5em 0.5em 1.5em; font-size: 1.4em; }
+
+h2 { background: #DDEEFF; font-weight: bold; padding: 0.3em; margin-top:
20; font-size: 1.1em; }
+
+img {
+ vertical-align: middle;
+ border: 0;
+}
+
+a.withicon {
+text-decoration: none;
+}
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/icons/add.png Mon Sep 29
18:32:37 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/icons/arrow_refresh.png Mon Sep
29 18:32:37 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/icons/cancel.png Mon Sep 29
18:32:37 2014 UTC
@@ -0,0 +1,20 @@
+‰PNG
+
+
+IHDR óÿa gAMA ¯È7 Šé tEXtSoftware Adobe
ImageReadyqÉe< ÝIDAT8Ë¥“kk A †÷kH !)¦4„–^c› ¨¡Æ˜ 4e J›ÚK¤i(½ÑËÿ̇\
£Ä• ²Î®»;OgV7U”–Ò /
+þϙ÷œ3 `ü Æ
+Ã
+
+Feý `
+
+݇ïïàÛ òë[ä—:òÓ ä‡Wø nã F{2 2ÿ8 ³ˆÌd © A2I°¶†ŸÏâ >§wï&Bÿ; 6 Ôáü
+Y« $ ««ø•
+òì
+¯ZÂÛߎ³Œ=€D€þ•Uem¦Ó f ¿ZÅ/—ÁRÑÛmäÉ ½ÄCz/
+tBë Ì›N ìí
+æ J› ¤·½ ³¸ˆûì a€î°ü¼ÿ;¯ºrd
+¥ÌîÖ N,†XXÀ©ä' >¾îç ÇñK¥ €®îærˆùyº³³8¥ì8 x_Ã_YÁ7Í«Ìú«Í´ZÈ‹
+„šŒ== ót Ëa€§ jDÞã òô´_µÑÀÝÜÄÙØ ÍRA‚£#ºË× Åô(ÀU ¦çëÕËxf àø84ë¼Ý¹9„n®2‹õ$b'C{é MÃø9²Hj9,=ßÞË
+ÜøÝ«¼öÌ
+öÔ öR,¬Ü 2 ²Z ˾u ·šÇÙÍá˜Ù0¯(f
+Ô˜yâcRݵt‡#] Ôì«ù÷×ø ú 畸ƒýžÝ¿ IEND®B`‚
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/icons/control_play_blue.png Mon
Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,30 @@
+‰PNG
+
+
+IHDR óÿa gAMA ¯È7 Šé tEXtSoftware Adobe
ImageReadyqÉe< _IDAT8Ë¥“Mo Q †û ü ü Xºtîš.º3qcÂÆÄESW%5ÕEc
+a,QL›Ö * kª¶©‘Zé Ši, ¥
+ èP˜Áa`` ÊqÎ
+ ©ºó&ïfæ<ïù¸çŽ Àبn,‚A•I•YÕäPæá7ßñ£à5UÆ o ‹ïàŒ
+
+§éØÉ) '¸ý£$ýj/GMyy
+Æ`ì ƒ!|Ý ([£§Y† J]P.ûD –
+¥
+ Á£8³´“µb¬f¢ Ž'¿‹íŽ x$¹ ¼Ø NU³Ó#ßDI†ýpDtm¥ÐÄH
+°/, 3kpU ¡òS†·á
+°u Êõ ”øŽn²³ dî±ØŽ
+L>ú
+e  Þz € Ã
+ Ïjm"<ÉÜ98¼!
+Y40 ¿¥hì KEPËzsv èuˆ%p¡Ú ¡¥ÀE]‚åõw4²h0 ‰ p8¬Z£K`ÌXäÚ*ü™hâQ ü1 r ‰ ÉÊ%¬¹×9d‰Áq4N
+°|
+Æ@ Ï
+ÀøŒŸü˲ҰŠ.,¯¼Ô
+Ì_¾&èºØ †¤è½bàÄ
+} Μ·Èͤ‹up¸Üz
+&·?C J5è÷ €ù
+‰”;>ó‰À ¦Ë-H•ZÐíõa÷0 Vç }ˆ†ûžªÅ 3œ0˜2fC!¬ ÉR“$ȨÙíÏV™;Îôà µErlD› "Ë ëME¯ —
3§‹<Ø\
+qÚ±õ{‘FWyÞ
+¶®z7™P$ V 3Áž y ¶ Q˜w,1Sö÷ ¯òècºû"o™}¾M=Y\¡
+O Ü‚ â
+Û\ô´ÍGݦ’ÿ~Lÿóœ
+x WÌž% IEND®B`‚
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/icons/zoom.png Mon Sep 29
18:32:37 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/js/jquery.form.js Mon Sep 29
18:32:37 2014 UTC
@@ -0,0 +1,803 @@
+/*!
+ * jQuery Form Plugin
+ * version: 2.65 (09-MAR-2011)
+ * @requires jQuery v1.3.2 or later
+ *
+ * Examples and documentation at:
http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ *
http://www.opensource.org/licenses/mit-license.php
+ *
http://www.gnu.org/licenses/gpl.html
+ */
+;(function($) {
+
+/*
+ Usage Note:
+ -----------
+ Do not use both ajaxSubmit and ajaxForm on the same form. These
+ functions are intended to be exclusive. Use ajaxSubmit if you want
+ to bind your own submit handler to the form. For example,
+
+ $(document).ready(function() {
+ $('#myForm').bind('submit', function(e) {
+ e.preventDefault(); // <-- important
+ $(this).ajaxSubmit({
+ target: '#output'
+ });
+ });
+ });
+
+ Use ajaxForm when you want the plugin to manage all the event binding
+ for you. For example,
+
+ $(document).ready(function() {
+ $('#myForm').ajaxForm({
+ target: '#output'
+ });
+ });
+
+ When using ajaxForm, the ajaxSubmit function will be invoked for you
+ at the appropriate time.
+*/
+
+/**
+ * ajaxSubmit() provides a mechanism for immediately submitting
+ * an HTML form using AJAX.
+ */
+$.fn.ajaxSubmit = function(options) {
+ // fast fail if nothing selected (
http://dev.jquery.com/ticket/2752)
+ if (!this.length) {
+ log('ajaxSubmit: skipping submit process - no element selected');
+ return this;
+ }
+
+ if (typeof options == 'function') {
+ options = { success: options };
+ }
+
+ var action = this.attr('action');
+ var url = (typeof action === 'string') ? $.trim(action) : '';
+ if (url) {
+ // clean url (don't include hash vaue)
+ url = (url.match(/^([^#]+)/)||[])[1];
+ }
+ url = url || window.location.href || '';
+
+ options = $.extend(true, {
+ url: url,
+ type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue
57)
+ iframeSrc: /^https/i.test(window.location.href |
| '') ? 'javascript:false' : 'about:blank'
+ }, options);
+
+ // hook for manipulating the form data before it is extracted;
+ // convenient for use with rich editors like tinyMCE or FCKEditor
+ var veto = {};
+ this.trigger('form-pre-serialize', [this, options, veto]);
+ if (veto.veto) {
+ log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
+ return this;
+ }
+
+ // provide opportunity to alter form data before it is serialized
+ if (options.beforeSerialize && options.beforeSerialize(this, options) ===
false) {
+ log('ajaxSubmit: submit aborted via beforeSerialize callback');
+ return this;
+ }
+
+ var n,v,a = this.formToArray(options.semantic);
+ if (options.data) {
+ options.extraData = options.data;
+ for (n in options.data) {
+ if(options.data[n] instanceof Array) {
+ for (var k in options.data[n]) {
+ a.push( { name: n, value: options.data[n][k] } );
+ }
+ }
+ else {
+ v = options.data[n];
+ v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
+ a.push( { name: n, value: v } );
+ }
+ }
+ }
+
+ // give pre-submit callback an opportunity to abort the submit
+ if (options.beforeSubmit && options.beforeSubmit(a, this, options) ===
false) {
+ log('ajaxSubmit: submit aborted via beforeSubmit callback');
+ return this;
+ }
+
+ // fire vetoable 'validate' event
+ this.trigger('form-submit-validate', [a, this, options, veto]);
+ if (veto.veto) {
+ log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
+ return this;
+ }
+
+ var q = $.param(a);
+
+ if (options.type.toUpperCase() == 'GET') {
+ options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+ options.data = null; // data is null for 'get'
+ }
+ else {
+ options.data = q; // data is the query string for 'post'
+ }
+
+ var $form = this, callbacks = [];
+ if (options.resetForm) {
+ callbacks.push(function() { $form.resetForm(); });
+ }
+ if (options.clearForm) {
+ callbacks.push(function() { $form.clearForm(); });
+ }
+
+ // perform a load on the target only if dataType is not provided
+ if (!options.dataType && options.target) {
+ var oldSuccess = options.success || function(){};
+ callbacks.push(function(data) {
+ var fn = options.replaceTarget ? 'replaceWith' : 'html';
+ $(options.target)[fn](data).each(oldSuccess, arguments);
+ });
+ }
+ else if (options.success) {
+ callbacks.push(options.success);
+ }
+
+ options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr
as 3rd arg
+ var context = options.context || options; // jQuery 1.4+ supports
scope context
+ for (var i=0, max=callbacks.length; i < max; i++) {
+ callbacks[i].apply(context, [data, status, xhr || $form, $form]);
+ }
+ };
+
+ // are there files to upload?
+ var fileInputs = $('input:file', this).length > 0;
+ var mp = 'multipart/form-data';
+ var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') ==
mp);
+
+ // options.iframe allows user to force iframe mode
+ // 06-NOV-09: now defaulting to iframe mode if file input is detected
+ if (options.iframe !== false && (fileInputs || options.iframe ||
multipart)) {
+ // hack to fix Safari hang (thanks to Tim Molendijk for this)
+ // see:
http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
+ if (options.closeKeepAlive) {
+ $.get(options.closeKeepAlive, fileUpload);
+ }
+ else {
+ fileUpload();
+ }
+ }
+ else {
+ $.ajax(options);
+ }
+
+ // fire 'notify' event
+ this.trigger('form-submit-notify', [this, options]);
+ return this;
+
+
+ // private function for handling file uploads (hat tip to YAHOO!)
+ function fileUpload() {
+ var form = $form[0];
+
+ if ($(':input[name=submit],:input[id=submit]', form).length) {
+ // if there is an input with a name or id of 'submit' then we won't be
+ // able to invoke the submit fn on the form (at least not x-browser)
+ alert('Error: Form elements must not have name or id of "submit".');
+ return;
+ }
+
+ var s = $.extend(true, {}, $.ajaxSettings, options);
+ s.context = s.context || s;
+ var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id;
+ var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+
s.iframeSrc +'" />');
+ var io = $io[0];
+
+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+ var xhr = { // mock object
+ aborted: 0,
+ responseText: null,
+ responseXML: null,
+ status: 0,
+ statusText: 'n/a',
+ getAllResponseHeaders: function() {},
+ getResponseHeader: function() {},
+ setRequestHeader: function() {},
+ abort: function() {
+ this.aborted = 1;
+ $io.attr('src', s.iframeSrc); // abort op in progress
+ }
+ };
+
+ var g = s.global;
+ // trigger ajax global events so that activity/block indicators work
like normal
+ if (g && ! $.active++) {
+ $.event.trigger("ajaxStart");
+ }
+ if (g) {
+ $.event.trigger("ajaxSend", [xhr, s]);
+ }
+
+ if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
+ if (s.global) {
+ $.active--;
+ }
+ return;
+ }
+ if (xhr.aborted) {
+ return;
+ }
+
+ var timedOut = 0;
+
+ // add submitting element to data if we know it
+ var sub = form.clk;
+ if (sub) {
+ var n =
sub.name;
+ if (n && !sub.disabled) {
+ s.extraData = s.extraData || {};
+ s.extraData[n] = sub.value;
+ if (sub.type == "image") {
+ s.extraData[n+'.x'] = form.clk_x;
+ s.extraData[n+'.y'] = form.clk_y;
+ }
+ }
+ }
+
+ // take a breath so that pending repaints get some cpu time before the
upload starts
+ function doSubmit() {
+ // make sure form attrs are set
+ var t = $form.attr('target'), a = $form.attr('action');
+
+ // update form attrs in IE friendly way
+ form.setAttribute('target',id);
+ if (form.getAttribute('method') != 'POST') {
+ form.setAttribute('method', 'POST');
+ }
+ if (form.getAttribute('action') != s.url) {
+ form.setAttribute('action', s.url);
+ }
+
+ // ie borks in some cases when setting encoding
+ if (! s.skipEncodingOverride) {
+ $form.attr({
+ encoding: 'multipart/form-data',
+ enctype: 'multipart/form-data'
+ });
+ }
+
+ // support timout
+ if (s.timeout) {
+ setTimeout(function() { timedOut = true; cb(); }, s.timeout);
+ }
+
+ // add "extra" data to form if provided in options
+ var extraInputs = [];
+ try {
+ if (s.extraData) {
+ for (var n in s.extraData) {
+ extraInputs.push(
+ $('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')
+ .appendTo(form)[0]);
+ }
+ }
+
+ // add iframe to doc and submit the form
+ $io.appendTo('body');
+ io.attachEvent ? io.attachEvent('onload', cb) :
io.addEventListener('load', cb, false);
+ form.submit();
+ }
+ finally {
+ // reset attrs and remove "extra" input elements
+ form.setAttribute('action',a);
+ if(t) {
+ form.setAttribute('target', t);
+ } else {
+ $form.removeAttr('target');
+ }
+ $(extraInputs).remove();
+ }
+ }
+
+ if (s.forceSync) {
+ doSubmit();
+ }
+ else {
+ setTimeout(doSubmit, 10); // this lets dom updates render
+ }
+
+ var data, doc, domCheckCount = 50;
+
+ function cb() {
+ doc = io.document ? io.document : io.contentWindow ?
io.contentWindow.document : io.contentDocument;
+ if (!doc || doc.location.href == s.iframeSrc) {
+ // response not received yet
+ return;
+ }
+ io.detachEvent ? io.detachEvent('onload', cb) :
io.removeEventListener('load', cb, false);
+
+ var ok = true;
+ try {
+ if (timedOut) {
+ throw 'timeout';
+ }
+
+ var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
+ log('isXml='+isXml);
+ if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML
== '')) {
+ if (--domCheckCount) {
+ // in some browsers (Opera) the iframe DOM is not always traversable
when
+ // the onload callback fires, so we loop a bit to accommodate
+ log('requeing onLoad callback, DOM not available');
+ setTimeout(cb, 250);
+ return;
+ }
+ // let this fall through because server response could be an empty
document
+ //log('Could not access iframe DOM after mutiple tries.');
+ //throw 'DOMException: not available';
+ }
+
+ //log('response detected');
+ xhr.responseText = doc.body ? doc.body.innerHTML :
doc.documentElement ? doc.documentElement.innerHTML : null;
+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+ xhr.getResponseHeader = function(header){
+ var headers = {'content-type': s.dataType};
+ return headers[header];
+ };
+
+ var scr = /(json|script)/.test(s.dataType);
+ if (scr || s.textarea) {
+ // see if user embedded response in textarea
+ var ta = doc.getElementsByTagName('textarea')[0];
+ if (ta) {
+ xhr.responseText = ta.value;
+ }
+ else if (scr) {
+ // account for browsers injecting pre around json response
+ var pre = doc.getElementsByTagName('pre')[0];
+ var b = doc.getElementsByTagName('body')[0];
+ if (pre) {
+ xhr.responseText = pre.textContent;
+ }
+ else if (b) {
+ xhr.responseText = b.innerHTML;
+ }
+ }
+ }
+ else if (s.dataType == 'xml' && !xhr.responseXML &&
xhr.responseText != null) {
+ xhr.responseXML = toXml(xhr.responseText);
+ }
+
+ data = httpData(xhr, s.dataType, s);
+ }
+ catch(e){
+ log('error caught:',e);
+ ok = false;
+ xhr.error = e;
+ s.error && s.error.call(s.context, xhr, 'error', e);
+ g && $.event.trigger("ajaxError", [xhr, s, e]);
+ }
+
+ if (xhr.aborted) {
+ log('upload aborted');
+ ok = false;
+ }
+
+ // ordering of these callbacks/triggers is odd, but that's how $.ajax
does it
+ if (ok) {
+ s.success && s.success.call(s.context, data, 'success', xhr);
+ g && $.event.trigger("ajaxSuccess", [xhr, s]);
+ }
+
+ g && $.event.trigger("ajaxComplete", [xhr, s]);
+
+ if (g && ! --$.active) {
+ $.event.trigger("ajaxStop");
+ }
+
+ s.complete && s.complete.call(s.context, xhr, ok ? 'success' : 'error');
+
+ // clean up
+ setTimeout(function() {
+ $io.removeData('form-plugin-onload');
+ $io.remove();
+ xhr.responseXML = null;
+ }, 100);
+ }
+
+ var toXml = $.parseXML || function(s, doc) { // use parseXML if
available (jQuery 1.5+)
+ if (window.ActiveXObject) {
+ doc = new ActiveXObject('Microsoft.XMLDOM');
+ doc.async = 'false';
+ doc.loadXML(s);
+ }
+ else {
+ doc = (new DOMParser()).parseFromString(s, 'text/xml');
+ }
+ return (doc && doc.documentElement &&
doc.documentElement.nodeName != 'parsererror') ? doc : null;
+ };
+ var parseJSON = $.parseJSON || function(s) {
+ return window['eval']('(' + s + ')');
+ };
+
+ var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
+ var ct = xhr.getResponseHeader('content-type') || '',
+ xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if (xml && data.documentElement.nodeName === 'parsererror') {
+ $.error && $.error('parsererror');
+ }
+ if (s && s.dataFilter) {
+ data = s.dataFilter(data, type);
+ }
+ if (typeof data === 'string') {
+ if (type === 'json' || !type && ct.indexOf('json') >= 0) {
+ data = parseJSON(data);
+ } else if (type === "script" || !type && ct.indexOf("javascript") >=
0) {
+ $.globalEval(data);
+ }
+ }
+ return data;
+ };
+ }
+};
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" />
elements (if the element
+ * is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for
the element that was
+ * used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * The options argument for ajaxForm works exactly as it does for
ajaxSubmit. ajaxForm merely
+ * passes the options argument along after properly binding events for
submit elements and
+ * the form itself.
+ */
+$.fn.ajaxForm = function(options) {
+ // in jQuery 1.3+ we can fix mistakes with the ready state
+ if (this.length === 0) {
+ var o = { s: this.selector, c: this.context };
+ if (!$.isReady && o.s) {
+ log('DOM not ready, queuing ajaxForm');
+ $(function() {
+ $(o.s,o.c).ajaxForm(options);
+ });
+ return this;
+ }
+ // is your DOM ready?
http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
+ log('terminating; zero elements found by selector' + ($.isReady ? '' : '
(DOM not ready)'));
+ return this;
+ }
+
+ return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
+ if (!e.isDefaultPrevented()) { // if event has been canceled, don't
proceed
+ e.preventDefault();
+ $(this).ajaxSubmit(options);
+ }
+ }).bind('click.form-plugin', function(e) {
+ var target = e.target;
+ var $el = $(target);
+ if (!($
el.is(":submit,input:image"))) {
+ // is this a child element of the submit el? (ex: a span within a
button)
+ var t = $el.closest(':submit');
+ if (t.length == 0) {
+ return;
+ }
+ target = t[0];
+ }
+ var form = this;
+ form.clk = target;
+ if (target.type == 'image') {
+ if (e.offsetX != undefined) {
+ form.clk_x = e.offsetX;
+ form.clk_y = e.offsetY;
+ } else if (typeof $.fn.offset == 'function') { // try to use dimensions
plugin
+ var offset = $el.offset();
+ form.clk_x = e.pageX - offset.left;
+ form.clk_y = e.pageY - offset.top;
+ } else {
+ form.clk_x = e.pageX - target.offsetLeft;
+ form.clk_y = e.pageY - target.offsetTop;
+ }
+ }
+ // clear form vars
+ setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; },
100);
+ });
+};
+
+// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+$.fn.ajaxFormUnbind = function() {
+ return this.unbind('submit.form-plugin click.form-plugin');
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that
can
+ * be passed to any of the following ajax functions: $.get, $.post, or
load.
+ * Each object in the array has both a 'name' and 'value' property. An
example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password',
value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions
provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ */
+$.fn.formToArray = function(semantic) {
+ var a = [];
+ if (this.length === 0) {
+ return a;
+ }
+
+ var form = this[0];
+ var els = semantic ? form.getElementsByTagName('*') : form.elements;
+ if (!els) {
+ return a;
+ }
+
+ var i,j,n,v,el,max,jmax;
+ for(i=0, max=els.length; i < max; i++) {
+ el = els[i];
+ n =
el.name;
+ if (!n) {
+ continue;
+ }
+
+ if (semantic && form.clk && el.type == "image") {
+ // handle image inputs on the fly when semantic == true
+ if(!el.disabled && form.clk == el) {
+ a.push({name: n, value: $(el).val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value:
form.clk_y});
+ }
+ continue;
+ }
+
+ v = $.fieldValue(el, true);
+ if (v && v.constructor == Array) {
+ for(j=0, jmax=v.length; j < jmax; j++) {
+ a.push({name: n, value: v[j]});
+ }
+ }
+ else if (v !== null && typeof v != 'undefined') {
+ a.push({name: n, value: v});
+ }
+ }
+
+ if (!semantic && form.clk) {
+ // input type=='image' are not found in elements array! handle it here
+ var $input = $(form.clk), input = $input[0];
+ n =
input.name;
+ if (n && !input.disabled && input.type == 'image') {
+ a.push({name: n, value: $input.val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value:
form.clk_y});
+ }
+ }
+ return a;
+};
+
+/**
+ * Serializes form data into a 'submittable' string. This method will
return a string
+ * in the format: name1=value1&name2=value2
+ */
+$.fn.formSerialize = function(semantic) {
+ //hand off to jQuery.param for proper encoding
+ return $.param(this.formToArray(semantic));
+};
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format:
name1=value1&name2=value2
+ */
+$.fn.fieldSerialize = function(successful) {
+ var a = [];
+ this.each(function() {
+ var n =
this.name;
+ if (!n) {
+ return;
+ }
+ var v = $.fieldValue(this, successful);
+ if (v && v.constructor == Array) {
+ for (var i=0,max=v.length; i < max; i++) {
+ a.push({name: n, value: v[i]});
+ }
+ }
+ else if (v !== null && typeof v != 'undefined') {
+ a.push({name:
this.name, value: v});
+ }
+ });
+ //hand off to jQuery.param for proper encoding
+ return $.param(a);
+};
+
+/**
+ * Returns the value(s) of the element in the matched set. For example,
consider the following form:
+ *
+ * <form><fieldset>
+ * <input name="A" type="text" />
+ * <input name="A" type="text" />
+ * <input name="B" type="checkbox" value="B1" />
+ * <input name="B" type="checkbox" value="B2"/>
+ * <input name="C" type="radio" value="C1" />
+ * <input name="C" type="radio" value="C2" />
+ * </fieldset></form>
+ *
+ * var v = $(':text').fieldValue();
+ * // if no values are entered into the text inputs
+ * v == ['','']
+ * // if values entered into the text inputs are 'foo' and 'bar'
+ * v == ['foo','bar']
+ *
+ * var v = $(':checkbox').fieldValue();
+ * // if neither checkbox is checked
+ * v === undefined
+ * // if both checkboxes are checked
+ * v == ['B1', 'B2']
+ *
+ * var v = $(':radio').fieldValue();
+ * // if neither radio is checked
+ * v === undefined
+ * // if first radio is checked
+ * v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must
be 'successful'
+ * (per
http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true. If this value is
false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array. If no valid value can be
determined the
+ * array will be empty, otherwise it will contain one or more values.
+ */
+$.fn.fieldValue = function(successful) {
+ for (var val=[], i=0, max=this.length; i < max; i++) {
+ var el = this[i];
+ var v = $.fieldValue(el, successful);
+ if (v === null || typeof v == 'undefined' || (v.constructor == Array
&& !v.length)) {
+ continue;
+ }
+ v.constructor == Array ? $.merge(val, v) : val.push(v);
+ }
+ return val;
+};
+
+/**
+ * Returns the value of the field element.
+ */
+$.fieldValue = function(el, successful) {
+ var n =
el.name, t = el.type, tag = el.tagName.toLowerCase();
+ if (successful === undefined) {
+ successful = true;
+ }
+
+ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+ (t == 'checkbox' || t == 'radio') && !el.checked ||
+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+ tag == 'select' && el.selectedIndex == -1)) {
+ return null;
+ }
+
+ if (tag == 'select') {
+ var index = el.selectedIndex;
+ if (index < 0) {
+ return null;
+ }
+ var a = [], ops = el.options;
+ var one = (t == 'select-one');
+ var max = (one ? index+1 : ops.length);
+ for(var i=(one ? index : 0); i < max; i++) {
+ var op = ops[i];
+ if (op.selected) {
+ var v = op.value;
+ if (!v) { // extra pain for IE...
+ v = (op.attributes && op.attributes['value']
&& !(op.attributes['value'].specified)) ? op.text : op.value;
+ }
+ if (one) {
+ return v;
+ }
+ a.push(v);
+ }
+ }
+ return a;
+ }
+ return $(el).val();
+};
+
+/**
+ * Clears the form data. Takes the following actions on the form's input
fields:
+ * - input text fields will have their 'value' property set to the empty
string
+ * - select elements will have their 'selectedIndex' property set to -1
+ * - checkbox and radio inputs will have their 'checked' property set to
false
+ * - inputs of type submit, button, reset, and hidden will *not* be
effected
+ * - button elements will *not* be effected
+ */
+$.fn.clearForm = function() {
+ return this.each(function() {
+ $('input,select,textarea', this).clearFields();
+ });
+};
+
+/**
+ * Clears the selected form elements.
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+ return this.each(function() {
+ var t = this.type, tag = this.tagName.toLowerCase();
+ if (t == 'text' || t == 'password' || tag == 'textarea') {
+ this.value = '';
+ }
+ else if (t == 'checkbox' || t == 'radio') {
+ this.checked = false;
+ }
+ else if (tag == 'select') {
+ this.selectedIndex = -1;
+ }
+ });
+};
+
+/**
+ * Resets the form data. Causes all form elements to be reset to their
original value.
+ */
+$.fn.resetForm = function() {
+ return this.each(function() {
+ // guard against an input with the name of 'reset'
+ // note that IE reports the reset function as an 'object'
+ if (typeof this.reset == 'function' || (typeof this.reset == 'object'
&& !this.reset.nodeType)) {
+ this.reset();
+ }
+ });
+};
+
+/**
+ * Enables or disables any matching elements.
+ */
+$.fn.enable = function(b) {
+ if (b === undefined) {
+ b = true;
+ }
+ return this.each(function() {
+ this.disabled = !b;
+ });
+};
+
+/**
+ * Checks/unchecks any matching checkboxes or radio buttons and
+ * selects/deselects and matching option elements.
+ */
+$.fn.selected = function(select) {
+ if (select === undefined) {
+ select = true;
+ }
+ return this.each(function() {
+ var t = this.type;
+ if (t == 'checkbox' || t == 'radio') {
+ this.checked = select;
+ }
+ else if (this.tagName.toLowerCase() == 'option') {
+ var $sel = $(this).parent('select');
+ if (select && $sel[0] && $sel[0].type == 'select-one') {
+ // deselect all other options
+ $sel.find('option').selected(false);
+ }
+ this.selected = select;
+ }
+ });
+};
+
+// helper fn for console logging
+// set $.fn.ajaxSubmit.debug to true to enable debug logging
+function log() {
+ if ($.fn.ajaxSubmit.debug) {
+ var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
+ if (window.console && window.console.log) {
+ window.console.log(msg);
+ }
+ else if (window.opera && window.opera.postError) {
+ window.opera.postError(msg);
+ }
+ }
+};
+
+})(jQuery);
=======================================
--- /dev/null
+++ /applications/longhorn/src/main/webapp/js/okapi-longhorn.js Mon Sep 29
18:32:37 2014 UTC
@@ -0,0 +1,160 @@
+/*===========================================================================
+ Copyright (C) 2011 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+
+ var serviceUrl = window.location.pathname;
+ var projectsUrl = serviceUrl + "projects/";
+
+ //load or refresh the project list
+ function loadProjectList(){
+ $.get(projectsUrl, function(data) {
+ $("#projects").empty();
+ $(data).find("e").each(function(){
+ $("#projects").append("<tr><td><a class=\"withicon\"
OnClick=\"loadProjectDetails("+$(this).text()+");\"
href=\"#\">Project: "+$(this).text()+" <img
src=\"icons/zoom.png\"></a></td><td><a
OnClick=\"deleteProject("+$(this).text()+");\" href=\"#\"><img
src=\"icons/cancel.png\"></a></tr> ");
+ });
+ }
+ ,"xml");
+ };
+
+ //load project details
+ function loadProjectDetails(prjid){
+
+ countInputFiles = 0;
+ countOutputFiles = 0;
+
+ $("#project").empty().append(prjid);
+ $("#toggle_details").show();
+ $("#files").hide();
+
+ $.get(projectsUrl+prjid+"/inputFiles", function(data) {
+ $("#input_files").empty();
+ $(data).find("e").each(function(){
+ $("#input_files").append("<tr><td><a
href=\""+projectsUrl+prjid+"/inputFiles/"+$(this).text()+"\"
target=\"_blank\">"+$(this).text()+"</a></td></tr>");
+ countInputFiles=countInputFiles+1;
+ });
+ if(countInputFiles > 0){
+ $("#files").show();
+ }
+ }
+ ,"xml");
+
+ $.get(projectsUrl+prjid+"/outputFiles", function(data) {
+ $("#output_files").empty();
+ $(data).find("e").each(function(){
+ $("#output_files").append("<tr><td><a
href=\""+projectsUrl+prjid+"/outputFiles/"+$(this).text()+"\"
target=\"_blank\">"+$(this).text()+"</a></td></tr>");
+ countOutputFiles=countOutputFiles+1;
+ });
+ if(countOutputFiles > 0){
+ $("#files").show();
+ }
+ }
+ ,"xml");
+
+ };
+
+ //delete a project
+ function deleteProject(id){
+
+ $.ajax({
+ type: "DELETE",
+ url: projectsUrl+id,
+ complete: function(msg){
+ loadProjectList();
+ }
+ });
+
+ if($("#project").text() == id){
+ $("#toggle_details").hide();
+ }
+
+ };
+
+ function executeProject(){
+
+ $.ajax({
+ type: "POST",
+ url: projectsUrl+$("#project").text()+"/tasks/execute",
+ success: function() {
+ alert("Project "+$("#project").text()+" executed");
+ loadProjectDetails($("#project").text());
+ },
+ error: function() {
+ alert("Project "+$("#project").text()+" execution failed. Please check
batch config and input files.");
+ },
+ dataType: "xml"
+ });
+
+ };
+
+$(document).ready(function() {
+
+ $("#toggle_details").hide();
+
+ $("#list_projects").click(function() {
+ loadProjectList();
+ });
+
+ $("#create_project").click(function() {
+ $.post(projectsUrl+"new/", function(data) {
+ loadProjectList();
+ }
+ ,"xml");
+ });
+
+ $("#batchForm").ajaxForm({
+ beforeSubmit: function(formData, jqForm, options) {
+ options.url=projectsUrl+$("#project").text()+"/batchConfiguration";
+ },
+ success: function() {
+ alert("BatchConfiguration File Uploaded!");
+ loadProjectDetails($("#project").text());
+
+ }
+ });
+
+ $("#inputFileForm").ajaxForm({
+ beforeSubmit: function(formData, jqForm, options) {
+
+ //--Handles browser incompatibility in dealing with the path--
+ var fileAndPath = $("#inputFileForm :file").fieldValue()[0];
+ var lastPathDelimiter = fileAndPath.lastIndexOf("\\");
+ var lastPathDelimiterForward = fileAndPath.lastIndexOf("/");
+ var fileNameOnly;
+
+ if (lastPathDelimiter != -1){
+ fileNameOnly = fileAndPath.substring(lastPathDelimiter+1);
+ }else if (lastPathDelimiterForward != -1){
+ fileNameOnly = fileAndPath.substring(lastPathDelimiterForward+1);
+ }else{
+ fileNameOnly = fileAndPath;
+ }
+
+
options.url=projectsUrl+$("#project").text()+"/inputFiles/"+fileNameOnly;
+ },
+ success: function(responseText, statusText, xhr, $form) {
+
+ alert("Input File Uploaded!");
+ loadProjectDetails($("#project").text());
+ }
+ });
+});
+
+
+
=======================================
--- /dev/null
+++
/applications/longhorn/src/main/webapp/okapi-longhorn-sample-js-client.html
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="
http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Okapi Longhorn Sample JS Client</title>
+
+<link rel="stylesheet" type="text/css" media="screen"
href="css/okapi-longhorn.css" />
+<script
src="
https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"
type="text/javascript"></script>
+<!-- <script src="
http://github.com/malsup/form/raw/master/jquery.form.js"
type="text/javascript"></script> -->
+<script src="js/jquery.form.js" type="text/javascript"></script>
+<script src="js/okapi-longhorn.js" type="text/javascript"></script>
+
+</head>
+<body>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr class="head">
+ <td class="head" colspan="2"><h1 class="head">Okapi Longhorn Sample JS
Client</h1></td>
+ </tr>
+</table>
+<h2>Projects</h2>
+<p><a class="withicon" id="list_projects" href="#">Load/Refresh <img
src="icons/arrow_refresh.png"></a> | <a class="withicon"
id="create_project" href="#">Create <img src="icons/add.png"></a></p>
+
+<table id="projects"></table>
+
+<div id="toggle_details">
+
+<h3>Project <span id="project"></span></h3>
+
+<div id="files">
+<table>
+<tr>
+<td><b>Input Files</b></td>
+<td><b>Output Files</b></td>
+</tr>
+<tr>
+<td><table id="input_files"></table></td>
+<td><table id="output_files"></table></td>
+</tr>
+</table>
+<br>
+</div>
+<table>
+<tr><td>Specify batch config file </td><td><form id="batchForm"
method="post"><input type="file" name="batchConfiguration"><input
type="submit" value="Upload"></form></td></tr>
+<tr><td>Add input file </td><td><form id="inputFileForm"
method="post"><input type="file" name="inputFile"><input type="submit"
value="Upload"></form></td></tr>
+</table>
+
+<p><a class="withicon" OnClick="executeProject();" href="#">Execute <img
src="icons/control_play_blue.png"> </a></p>
+
+</div>
+</body>
+</html>
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/java/net/sf/okapi/applications/longhorn/ServiceTest.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,292 @@
+/*===========================================================================
+ Copyright (C) 2011 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+package net.sf.okapi.applications.longhorn;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import net.sf.okapi.common.StreamUtil;
+import net.sf.okapi.lib.longhornapi.LonghornFile;
+import net.sf.okapi.lib.longhornapi.LonghornProject;
+import net.sf.okapi.lib.longhornapi.LonghornService;
+import net.sf.okapi.lib.longhornapi.impl.rest.RESTService;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ServiceTest {
+ private static final String SERVICE_BASE_URL
= "
http://localhost:9095/okapi-longhorn";
+ private static LonghornService ws;
+ private static LonghornProject emptyProj;
+ private static LonghornProject preparedProj;
+ private static File inputFile;
+ private static File inputZip;
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ ws = new RESTService(new URI(SERVICE_BASE_URL));
+
+ URL input1 =
ServiceTest.class.getResource("/rawdocumenttofiltereventsstep.html");
+ inputFile = new File(input1.toURI());
+
+ URL input2 = ServiceTest.class.getResource("/more_files.zip");
+ inputZip = new File(input2.toURI());
+
+ URL bconfUrl =
ServiceTest.class.getResource("/html_segment_and_text_mod.bconf");
+ File bconf = new File(bconfUrl.toURI());
+
+ preparedProj = ws.createProject();
+ preparedProj.addBatchConfiguration(bconf);
+ preparedProj.addInputFile(inputFile, inputFile.getName());
+ preparedProj.addInputFile(inputFile, "samefile/" + inputFile.getName());
+ }
+
+ @Before
+ public void prep() throws Exception {
+ emptyProj = ws.createProject();
+ }
+
+ @After
+ public void cleanup() {
+ if (emptyProj != null)
+ emptyProj.delete();
+ }
+
+ @AfterClass
+ public static void cleanupFinal() {
+ if (preparedProj != null)
+ preparedProj.delete();
+ }
+
+ @Test
+ public void wrongUrlThrowsException() throws Exception {
+ try {
+ ws = new RESTService(new URI(SERVICE_BASE_URL + "wrong_url"));
+ fail("Invalid URL should have caused Exception");
+ }
+ catch (IllegalArgumentException e) {
+ }
+ }
+
+ @Test
+ public void createAndDeleteProjects() {
+ int projCountBefore = ws.getProjects().size();
+
+ LonghornProject proj = ws.createProject();
+ assertEquals(projCountBefore + 1, ws.getProjects().size());
+
+ proj.delete();
+ assertEquals(projCountBefore, ws.getProjects().size());
+ }
+
+ @Test
+ public void newProjectIsEmpty() {
+ assertEquals(0, emptyProj.getInputFiles().size());
+ assertEquals(0, emptyProj.getOutputFiles().size());
+ }
+
+ @Test
+ public void addingInputFile() throws FileNotFoundException {
+ emptyProj.addInputFile(inputFile, inputFile.getName());
+ assertEquals(1, emptyProj.getInputFiles().size());
+ assertEquals(0, emptyProj.getOutputFiles().size());
+ ArrayList<LonghornFile> inputFiles = emptyProj.getInputFiles();
+ assertEquals("rawdocumenttofiltereventsstep.html",
inputFiles.get(0).getRelativePath());
+ }
+
+ @Test
+ public void addingInputFileInSubdir() throws FileNotFoundException {
+ emptyProj.addInputFile(inputFile, "samefile/" + inputFile.getName());
+ assertEquals(1, emptyProj.getInputFiles().size());
+ assertEquals(0, emptyProj.getOutputFiles().size());
+ ArrayList<LonghornFile> inputFiles = emptyProj.getInputFiles();
+ assertEquals("samefile/rawdocumenttofiltereventsstep.html",
inputFiles.get(0).getRelativePath());
+ }
+
+ @Test
+ public void addingInputFilesFromZip() throws FileNotFoundException {
+ emptyProj.addInputFilesFromZip(inputZip);
+
+ ArrayList<LonghornFile> inputFiles = emptyProj.getInputFiles();
+ assertEquals(2, inputFiles.size());
+ assertEquals(0, emptyProj.getOutputFiles().size());
+
+ // Are the input file names as expected (with 1 file in a sub-directory)?
+ ArrayList<String> relFilePaths = new ArrayList<String>();
+ for (LonghornFile f : inputFiles) {
+ relFilePaths.add(f.getRelativePath());
+ }
+ assertTrue(relFilePaths.contains("searchandreplacestep.html"));
+ assertTrue(relFilePaths.contains("subdir1/segmentationstep.html"));
+ }
+
+ @Test
+ public void executePipelineCreatesOutputFiles() throws
FileNotFoundException {
+ preparedProj.executePipeline();
+
+ ArrayList<LonghornFile> inputFiles = preparedProj.getInputFiles();
+ ArrayList<LonghornFile> outputFiles = preparedProj.getOutputFiles();
+
+ // Should be the same number of files with this config
+ assertEquals(inputFiles.size(), outputFiles.size());
+
+ // Are the names as expected?
+ ArrayList<String> relFilePaths = new ArrayList<String>();
+ for (LonghornFile f : outputFiles) {
+ relFilePaths.add(f.getRelativePath());
+ }
+ assertTrue(relFilePaths.contains("rawdocumenttofiltereventsstep.html"));
+
assertTrue(relFilePaths.contains("samefile/rawdocumenttofiltereventsstep.html"));
+ }
+
+ @Test
+ public void executePipelineWithLangParametersCreatesOutputFiles() throws
FileNotFoundException {
+ preparedProj.executePipeline("en", "de");
+
+ ArrayList<LonghornFile> inputFiles = preparedProj.getInputFiles();
+ ArrayList<LonghornFile> outputFiles = preparedProj.getOutputFiles();
+
+ // Should be the same number of files with this config
+ assertEquals(inputFiles.size(), outputFiles.size());
+
+ // Are the names as expected?
+ ArrayList<String> relFilePaths = new ArrayList<String>();
+ for (LonghornFile f : outputFiles) {
+ relFilePaths.add(f.getRelativePath());
+ }
+ assertTrue(relFilePaths.contains("rawdocumenttofiltereventsstep.html"));
+
assertTrue(relFilePaths.contains("samefile/rawdocumenttofiltereventsstep.html"));
+ }
+
+ @Test
+ public void executePipelineWithMultipleTargetLangsCreatesOutputFiles()
throws FileNotFoundException {
+ preparedProj.executePipeline("en", Arrays.asList("de", "it", "fr"));
+
+ ArrayList<LonghornFile> inputFiles = preparedProj.getInputFiles();
+ ArrayList<LonghornFile> outputFiles = preparedProj.getOutputFiles();
+
+ // Should be the same number of files with this config
+ assertEquals(inputFiles.size(), outputFiles.size());
+
+ // Are the names as expected?
+ ArrayList<String> relFilePaths = new ArrayList<String>();
+ for (LonghornFile f : outputFiles) {
+ relFilePaths.add(f.getRelativePath());
+ }
+ assertTrue(relFilePaths.contains("rawdocumenttofiltereventsstep.html"));
+
assertTrue(relFilePaths.contains("samefile/rawdocumenttofiltereventsstep.html"));
+ }
+
+ @Test
+ public void fetchSingleOutputFile() throws IOException {
+ preparedProj.executePipeline();
+
+ ArrayList<LonghornFile> outputFiles = preparedProj.getOutputFiles();
+ assertEquals(2, outputFiles.size());
+
+ for (LonghornFile of : outputFiles) {
+ File outputFile = downloadFileToTemp(of.openStream());
+
+ assertNotNull(outputFile);
+ assertTrue(outputFile.exists());
+ assertTrue(outputFile.length() > 0);
+ outputFile.delete();
+ }
+ }
+
+ @Test
+ public void fetchOutputFilesAsZip() throws FileNotFoundException {
+ preparedProj.executePipeline();
+
+ InputStream zippedOutputFiles = preparedProj.getOutputFilesAsZip();
+ assertNotNull(zippedOutputFiles);
+ }
+
+ @Test
+ public void fetchOutputFilesAsZipThrowsExceptionForNoFiles() throws
FileNotFoundException {
+ try {
+ emptyProj.getOutputFilesAsZip();
+ fail("No output files should cause an exception.");
+ }
+ catch (IllegalStateException e) {
+ }
+ }
+
+ @Test
+ public void fetchOutputFileAsZip() throws FileNotFoundException {
+ preparedProj.executePipeline();
+
+ ArrayList<LonghornFile> outputFiles = preparedProj.getOutputFiles();
+ LonghornFile firstOutputFile = outputFiles.get(0);
+ InputStream zippedFile = firstOutputFile.openStreamToZip();
+ assertNotNull(zippedFile);
+ }
+
+ @Test
+ public void executePipelineForFilesWithNoExtension() throws Exception {
+ URL input = ServiceTest.class.getResource("/test_xml");
+ File inputFileWithNoExtension = new File(input.toURI());
+
+ URL bconfUrl = ServiceTest.class.getResource(
+ "/map_no_extension_to_xml.bconf");
+ File bconf = new File(bconfUrl.toURI());
+
+ emptyProj.addBatchConfiguration(bconf);
+ emptyProj.addInputFile(
+ inputFileWithNoExtension, inputFileWithNoExtension.getName());
+ emptyProj.executePipeline();
+
+ ArrayList<LonghornFile> inputFiles = emptyProj.getInputFiles();
+ ArrayList<LonghornFile> outputFiles = emptyProj.getOutputFiles();
+
+ // Should be the same number of files with this config
+ assertEquals(inputFiles.size(), outputFiles.size());
+
+ // Are the names as expected?
+ ArrayList<String> relFilePaths = new ArrayList<String>();
+ for (LonghornFile f : outputFiles) {
+ relFilePaths.add(f.getRelativePath());
+ }
+ assertTrue(relFilePaths.contains("test_xml"));
+ }
+
+ private File downloadFileToTemp(InputStream remoteFile) throws
IOException {
+
+ File tempFile = File.createTempFile("~okapi-5_", "outfile");
+ StreamUtil.copy(remoteFile, tempFile);
+ remoteFile.close();
+ return tempFile;
+ }
+}
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/java/net/sf/okapi/applications/longhorn/lib/ConfigurationTest.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,86 @@
+/*
+ *
===========================================================================
Copyright (C) 2011 by the Okapi Framework
+ * contributors
-----------------------------------------------------------------------------
This library is free
+ * software; you can redistribute it and/or modify it under the terms of
the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
+ * This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU Lesser General Public License for more
+ * details. You should have received a copy of the GNU Lesser General
Public License along with this library; if not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place, Suite
330, Boston, MA 02111-1307 USA See also the full
+ * LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+ *
===========================================================================
+ */
+
+package net.sf.okapi.applications.longhorn.lib;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ConfigurationTest {
+
+ private static final String
OKAPI_LONGHORN_CONFIGURATION_USE_UNIQUE_WORKING_DIR
= "/okapi-longhorn-configuration-unique-working-dir-true.xml";
+ private static final String OKAPI_LONGHORN_CONFIGURATION
= "/okapi-longhorn-configuration.xml";
+ private static final String
OKAPI_LONGHORN_CONFIGURATION_INVALID_WORKING_DIR
= "/okapi-longhorn-configuration-invalid-working-dir.xml";
+
+ @Test
+ public void addVersionToWorkingDirPathIfUseUniqueWorkingDirPathIsTrue() {
+ InputStream configFileStream = this.getClass().getResourceAsStream(
+ OKAPI_LONGHORN_CONFIGURATION_USE_UNIQUE_WORKING_DIR);
+ Configuration conf = new Configuration(configFileStream);
+ String workingDir = conf.getWorkingDirectory();
+ Assert.assertTrue(workingDir.contains("M0."));
+ }
+
+ @Test
+ public void
dontAddVersionToWorkingDirPathIfUseUniqueWorkingDirPathIsFalse() {
+ InputStream configFileStream =
this.getClass().getResourceAsStream(OKAPI_LONGHORN_CONFIGURATION);
+ Configuration conf = new Configuration(configFileStream);
+ String workingDir = conf.getWorkingDirectory();
+ Assert.assertFalse(workingDir.contains("M0."));
+ }
+
+ @Test
+ public void throwExceptionForInvalidFile() {
+ try {
+ InputStream configFileStream = this.getClass().getResourceAsStream(
+ OKAPI_LONGHORN_CONFIGURATION_INVALID_WORKING_DIR);
+ new Configuration(configFileStream);
+ Assert.fail();
+ }
+ catch (RuntimeException e) {
+ Assert.assertTrue(true);
+ }
+
+ }
+
+ @Test
+ public void
throwExceptionIfNoVersionIsFoundAndUseUniqueWorkingDirIsTrue() {
+ try {
+ InputStream configFileStream = this.getClass().getResourceAsStream(
+ OKAPI_LONGHORN_CONFIGURATION_INVALID_WORKING_DIR);
+ Configuration conf = new Configuration();
+ conf.setVersionPropertyFileName("");
+ conf.loadFromFile(configFileStream);
+ Assert.fail();
+ }
+ catch (RuntimeException e) {
+ Assert.assertTrue(true);
+ }
+
+ }
+
+ @Test
+ public void ignoreFileSeperatorOnEndOfWorkingDirPathWhenAddingVersion() {
+ InputStream configFileStream = this.getClass().getResourceAsStream(
+ OKAPI_LONGHORN_CONFIGURATION_USE_UNIQUE_WORKING_DIR);
+ Configuration conf = new Configuration(configFileStream);
+ String workingDir = conf.getWorkingDirectory();
+ assertTrue("The configured directory does not contain a version
extension",
+ workingDir.contains("longhorn-files_M0."));
+
+ }
+}
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/java/net/sf/okapi/applications/longhorn/lib/WorkspaceUtilsTest.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,111 @@
+/*
+ *
===========================================================================
Copyright (C) 2013 by the Okapi Framework
+ * contributors
-----------------------------------------------------------------------------
This library is free
+ * software; you can redistribute it and/or modify it under the terms of
the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
+ * This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU Lesser General Public License for more
+ * details. You should have received a copy of the GNU Lesser General
Public License along with this library; if not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place, Suite
330, Boston, MA 02111-1307 USA See also the full
+ * LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+ *
===========================================================================
+ */
+
+package net.sf.okapi.applications.longhorn.lib;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.junit.Test;
+
+public class WorkspaceUtilsTest {
+
+ private static final String LONGHORN_WORKDIR = "LONGHORN_WORKDIR";
+ private static final String WORKING_DIR_IN_TEMP =
System.getProperty("java.io.tmpdir") + File.separator + "longhorn-files";
+
+ @Test
+ public void loadWorkingDirFromSystemConfig() {
+ System.setProperty(LONGHORN_WORKDIR, WORKING_DIR_IN_TEMP);
+ assertEquals(WORKING_DIR_IN_TEMP, WorkspaceUtils.getWorkingDirectory());
+ }
+
+ @Test
+ public void sortDoesNotReturnTheSameCollectionObject() {
+ Collection<File> unsortedFiles = new ArrayList<File>();
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertNotSame(unsortedFiles, sortedFiles);
+ }
+
+ @Test
+ public void orderedListWithFilesDoesntChange() {
+ File f1 = new File("a.xml");
+ File f2 = new File("b.xml");
+ Collection<File> unsortedFiles = Arrays.asList(f1, f2);
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertEquals(f1, sortedFiles.get(0));
+ assertEquals(f2, sortedFiles.get(1));
+ }
+
+ @Test
+ public void orderedListWithFilesInSameDirectoryDoesntChange() {
+ File f1 = new File("1/a.xml");
+ File f2 = new File("1/b.xml");
+ Collection<File> unsortedFiles = Arrays.asList(f1, f2);
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertEquals(f1, sortedFiles.get(0));
+ assertEquals(f2, sortedFiles.get(1));
+ }
+
+ @Test
+ public void orderedListWithFilesInDifferentDirectoryDoesntChange() {
+ File f1 = new File("1/a.xml");
+ File f2 = new File("2/a.xml");
+ Collection<File> unsortedFiles = Arrays.asList(f1, f2);
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertEquals(f1, sortedFiles.get(0));
+ assertEquals(f2, sortedFiles.get(1));
+ }
+
+ @Test
+ public void unorderedListWithFilesGetsSorted() {
+ File f1 = new File("a.xml");
+ File f2 = new File("b.xml");
+ Collection<File> unsortedFiles = Arrays.asList(f2, f1);
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertEquals(f1, sortedFiles.get(0));
+ assertEquals(f2, sortedFiles.get(1));
+ }
+
+ @Test
+ public void unorderedListWithFilesInSameDirectoryGetsSorted() {
+ File f1 = new File("1/a.xml");
+ File f2 = new File("1/b.xml");
+ Collection<File> unsortedFiles = Arrays.asList(f2, f1);
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertEquals(f1, sortedFiles.get(0));
+ assertEquals(f2, sortedFiles.get(1));
+ }
+
+ @Test
+ public void unorderedListWithFilesInDifferentDirectoryGetsSorted() {
+ File f1 = new File("1/a.xml");
+ File f2 = new File("2/a.xml");
+ Collection<File> unsortedFiles = Arrays.asList(f2, f1);
+ ArrayList<File> sortedFiles =
WorkspaceUtils.sortFilesByPath(unsortedFiles);
+
+ assertEquals(f1, sortedFiles.get(0));
+ assertEquals(f2, sortedFiles.get(1));
+ }
+
+}
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/resources/html_segment_and_text_mod.bconf
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,4306 @@
+ batchConf alternate-default.srx '<?xml version="1.0"
encoding="UTF-8"?>
+<!--This set of rules was developed by the languagetools project under
LGPL license.
+The original document is located here:
+
http://languagetool.cvs.sourceforge.net/viewvc/languagetool/JLanguageTool/src/resource/segment.srx
+-->
+<srx xmlns="
http://www.lisa.org/srx20"
xmlns:okpsrx="
http://okapi.sf.net/srx-extensions" version="2.0">
+<header segmentsubflows="yes" cascade="no">
+<formathandle type="start" include="no"></formathandle>
+<formathandle type="end" include="yes"></formathandle>
+<formathandle type="isolated" include="yes"></formathandle>
+<okpsrx:options oneSegmentIncludesAll="no" trimLeadingWhitespaces="yes"
trimTrailingWhitespaces="yes"></okpsrx:options>
+<okpsrx:sample language="en_two" useMappedRules="no">{0>Utopia.<0}
+Po zakończeniu jego kadencji (pod koniec maja br.) zamierzam ubiegać
siÄ™ o wybór do zarzÄ
+du. (5 tys.) złotych. Tu jest 5 ww. autorów, np. Józek. Zrobiłem wiele
dobrego itd. Współczynniki załamania. On nie. Określone współczynniki
załamania itd.Ten proces prowadzi.
+Pochodził z rodziny Roberta E. Po wojnie wyzwolił się. Jerzy W. Urban,
doktor psychiatra. Patrz art. 3 ust. 3. To piękne m. st. Warszawa.
+Ik vind dat R. Baars een slechte (!) programmeur is. Als voetballer wordt
hij nooit een prof. Maar prof. N.A.W. Th.Ch. Janssen wordt dat wel. Maar of
dat zo blijft ... dat weet ik niet. Hij is m.a.w. een beginneling. Ook
moet je rekening houden met af-
+gebroken regels.En soms vergeet je het begin gewoon. "Ik ben gek" zei
hij "op voetbal." Of je dat wil horen is niet duidelijk.
+
+U.S. Dist. Judge William G. Bush and Gen. J. Nugent Jr. Dumont, as well as
William B. Hartslef Jr. are here. Dr. Jekyll and Mr. Hyde welcome you.
+It [really!] works. This is e.g. Mr. Smith, who talks slowly... And this
is another sentence. Leave me alone!, he yelled. I am in the U.S. Army.
Charles (Ind.) said he. Let's go to the U. S. A. He won't. Really. On p. 6
there's nothing. Sentence ends here. (Another one). Let's meet at 5 p.m. It
was Thursday. I met her at 5 p.m. and went to the movies. There are dogs,
cats etc. and you should know it.</okpsrx:sample>
+<okpsrx:rangeRule></okpsrx:rangeRule>
+</header>
+<body>
+<languagerules>
+<languagerule languagerulename="Polish">
+<rule break="no">
+<beforebreak>\badw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bafr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bakad\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bal\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bam\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bamer\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\barch\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bart\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bartyst\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bastr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\baustr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bbałt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bbdb\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bbł\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bbm\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bbr\.\p{Pe}?\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bbryt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcentr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bces\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bchem\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bchiń\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bchir\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bc.k\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bc.o\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcyg\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcyw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcyt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bczes\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bczw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcd\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bczyt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bćw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bćwicz\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdaw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdcn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdekl\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdemokr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdet\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdiec\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdł\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdop\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdost\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdosł\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bh.c\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bds\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdst\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bduszp\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdypl\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\begz\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bekol\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bekon\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\belektr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bem\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bew\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bfab\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bfarm\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bfot\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bfr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgat\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgastr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgeogr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgeol\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgimn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgłęb\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgm\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgodz\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgórn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgosp\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bgram\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bhist\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bhiszp\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bhr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bhot\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bid\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bin\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bim\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\biron\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bjn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkard\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkat\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkatol\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bk.k\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkk\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkol\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bk.p.a\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkpc\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bk.p.c\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkpt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bk.r\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkrak\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bk.r.o\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkryt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bkult\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\blaic\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\błac\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bniem\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bwoj\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Nn]p\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bpol\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\
bm.in\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bpt\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcdn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bjw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bnb\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\brys\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\btj\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Tt]zw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\btzn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzob\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bang\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bul\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bpl\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bal\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bk\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bok\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<!--Include the incorrect form "tyś." (5 tyś. zł)-->
+<rule break="no">
+<beforebreak>\bty[sÅ›]\.\p{Pe}?\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bww\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bur\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzm\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bżyd\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bżarg\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bżyw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bwył\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bup\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\btow\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bo\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b([sS]p|st|spółdz|społ|spółgł|
sto[łw])\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzew\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzewn\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzdr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzazw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzast\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzaw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzał\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzal\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzam\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzak\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzakł\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzagr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bzach\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\badw\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\blek\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bmec\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdoc\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdyr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\binż\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(?iu)mgr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[dD]r\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Rr]ed\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(?iu)prof\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bhab\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[kK]s\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(?iu)gen\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(?iu)por\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Pp]rzyp\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\betc\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<!--These can appear at the end of sentence, so watch out for the next
letter: it shouldn't be uppercase.-->
+<rule break="no">
+<beforebreak>\bit[dp]\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bproc\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[rwn]\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bit[dp]\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcdn\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bjw\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bn\.e\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bw\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bnn\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[dm]l\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bdag\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[cd]?m\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Zz][Å Å‚]\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Gg][rR]\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[d]?kg\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bml[nd]\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bnpl\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bpkt\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[ptw]g\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcos\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcosec\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bsec\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bsin\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\brkm\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bust\.\s</beforebreak>
+<afterbreak>\d</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\d+\.\s</beforebreak>
+<afterbreak>\p{Ll}|\p{Lu}{2,}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\p{L}\.\s</beforebreak>
+<afterbreak>\p{L}\.\s</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\p{L}\.</beforebreak>
+<afterbreak>\p{L}\.</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\.\p{L}+\.\s</beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<!--single lowercase chars at the end of sentence except for r, w, n-->
+<rule break="no">
+<beforebreak>\s[\p{L}&&[^rwn]]\.\s+</beforebreak>
+<afterbreak>\p{Ll}\p{Ll}|\p{Lu}[\p{Punct}\p{Lu}]</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>['"„][\.!?…]['"†]\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>["†']\s*</beforebreak>
+<afterbreak>\s*\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[!?]+\p{Pe} </beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[\p{Ps}][!?]+[\p{Pe}] </beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[\[\(]*\.\.\.[\]\)]* </beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[\[\(]*…[\]\)]* </beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\p{Lu}\.\s\p{Lu}\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\p{Lu}\.\p{Lu}\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\p{Lu}\p{Ll}\.\s?</beforebreak>
+<afterbreak>\p{Lu}[^\p{Lu}]</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\.\p{Lu}\p{Ll}\.\s?</beforebreak>
+<afterbreak>\p{Lu}[^\p{Lu}]</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[^\.]\s[A-Z]\.\s</beforebreak>
+<afterbreak>\p{Ll}|\p{Lu}\p{Ll}\p{Ll}+</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bDz\.\s?U\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<!--heuristic: no vowels = abbreviation-->
+<rule break="no">
+<beforebreak>[\p{Ll}&&[^aeouiyÄ™Ä
+ó]][\p{Ll}&&[^aeouiyÄ™Ä
+ó]]+\.\s</beforebreak>
+<afterbreak>\p{Ll}+</afterbreak>
+</rule>
+<rule break="yes">
+<beforebreak>[\.!?…]['"\p{Pe}\u00BB\u2019\u201D\u203A\u0002]*\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="yes">
+<beforebreak>[\.!?…]['»"†\p{Pe}]*</beforebreak>
+<afterbreak>\p{Lu}[^\p{Lu}]</afterbreak>
+</rule>
+<rule break="yes">
+<beforebreak>\s\p{L}[\.!?…]\s</beforebreak>
+<afterbreak>\p{Lu}\p{Ll}</afterbreak>
+</rule>
+</languagerule>
+<languagerule languagerulename="English">
+<rule break="no">
+<beforebreak>\b[nN]o\.\s</beforebreak>
+<afterbreak>\p{N}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(pp|[Vv]iz|i\.?\s*e|[Vvol]|[Rr]col|maj|Lt|[Ff]ig|[Ff]igs|
[Vv]iz|[Vv]ols|[Aa]pprox|[Ii]ncl|Pres|[Dd]ept|min|max|[Gg]ovt|lb|ft|
c\.?\s*f|vs)\.\s</beforebreak>
+<afterbreak>[^\p{Lu}]|I</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b[Ff]igs?\.\s</beforebreak>
+<afterbreak>\p{N}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\be\.g\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bvs\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\besp\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<!--"Etc." can end the sentence, so we check for the uppercase letter
after it.-->
+<rule break="no">
+<beforebreak>\b[Ee]tc\.\s</beforebreak>
+<afterbreak>[^p{Lu}]</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bJan\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bFeb\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bMar\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bApr\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bJun\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bJul\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bAug\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bSept?\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bOct\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bNov\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bDec\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bPh\.?D\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bet\b\s\bal\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(St|Gen|Hon|Prof|Dr|Mr|Ms|Mrs|[JS]r|Col|Maj|Brig|Sgt|Capt|
Cmnd|Sen|Rev|Rep|Revd)\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b(St|Gen|Hon|Prof|Dr|Mr|Ms|Mrs|[JS]r|Col|Maj|Brig|Sgt|Capt|
Cmnd|Sen|Rev|Rep|Revd)\.\s[A-Z]\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bcf\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bInc\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bCorp\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bBros\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bDist\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\bCo\.\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[\[\(]*…[\]\)]* </beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\p{Ps}[!?]+\p{Pe} </beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>[\.!?…]+\p{Pe} </beforebreak>
+<afterbreak>\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>["†']\s*</beforebreak>
+<afterbreak>\s*\p{Ll}</afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>['"„][\.!?…]['"†]\s</beforebreak>
+<afterbreak></afterbreak>
+</rule>
+<rule break="no">
+<beforebreak>\b\p{L}\.\s</beforebreak>
+<afterbreak>\p{L}\.\s</afterbreak>
+</rule>
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /applications/longhorn/src/test/resources/map_no_extension_to_xml.bconf
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,29 @@
+ batchConf ÿÿÿÿ <?xml version="1.0" encoding="UTF-8"?>
+<rainbowPipeline version="1"><step
class="net.sf.okapi.steps.common.RawDocumentToFilterEventsStep"></step>
+<step class="net.sf.okapi.steps.textmodification.TextModificationStep">#v1
+type.i=1
+addPrefix.b=false
+prefix={START_
+addSuffix.b=false
+suffix=_END}
+applyToExistingTarget.b=false
+addName.b=false
+addID.b=false
+markSegments.b=false
+applyToBlankEntries.b=true
+expand.b=false
+script.i=0</step>
+<step
class="net.sf.okapi.steps.common.FilterEventsToRawDocumentStep"></step>
+</rainbowPipeline>
+ ! okf_xml .wxl okf_xml-WixLocalization .html okf_html .srt
+okf_regex-srt .mif okf_mif .xini okf_xini .csv
+okf_table_csv
+.properties okf_properties .txt
+okf_mosestext .ttx okf_ttx .docx
+okf_openxml .lang okf_properties-skypeLang .idml okf_idml .xlf
okf_xliff .json okf_json .archive
+okf_archive .txp
+okf_transifex .ts okf_ts .rdf okf_xml-MozillaRDF .yml
+okf_railsyaml .odt okf_openoffice .dtd okf_dtd .resx
+okf_xml-resx .php okf_phpcontent .txml okf_txml .rkp okf_rainbowkit-package .pentm
+okf_pensieve .xml okf_xml .rtf
+okf_tradosrtf .po okf_po .tmx okf_tmx .rkm okf_rainbowkit .dita okf_xmlstream-dita
=======================================
--- /dev/null
+++ /applications/longhorn/src/test/resources/more_files.zip Mon Sep 29
18:32:37 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/resources/okapi-longhorn-configuration-invalid.xml
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,2 @@
+<use-unique-working-directory>True</use-unique-working-directory>
+<working-directory>D:\\</working-directory>
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/resources/okapi-longhorn-configuration-unique-working-dir-true.xml
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,4 @@
+<longhorn-config>
+ <use-unique-working-directory>True</use-unique-working-directory>
+ <working-directory>testData/longhorn-files/</working-directory>
+</longhorn-config>
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/resources/okapi-longhorn-configuration.xml
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,1 @@
+<working-directory>longhorn-files-from-user-home</working-directory>
=======================================
--- /dev/null
+++
/applications/longhorn/src/test/resources/rawdocumenttofiltereventsstep.html
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,49 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Steps - Raw Document to Filter Events</title>
+<link rel="stylesheet" type="text/css" href="../help.css">
+</head>
+<body>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr class="head">
+ <td class="head" colspan="2"><h1 class="head">Okapi Framework -
Steps</h1>
+ <h2 class="head2">Raw Document to Filter Events Step</h2></td>
+ </tr>
+ <tr>
+ <td class="smalltoc"><p>
+ - <a href="#overview">Overview</a><br>
+ - <a href="#parameters">Parameters</a></td>
+ <td class="hmenu">
+ <div class="hmenu"><table align="right"><tr>
+ <td><a href="index.html">Steps</a></td>
+ <td><a
href="
http://okapi.opentag.com/devguide/index.html">Developer's
Guide</a></td>
+ <td><a href="
http://okapi.opentag.com">Okapi Framework</a></td>
+ </tr></table></div>
+ </td>
+ </tr>
+</table>
+
+<p class="notice">If you are using an Okapi Tool after the M9 release, you
should be using the wiki online help:<br>
+<a target="_top"
href="
http://www.opentag.com/okapi/wiki/index.php?title=Raw_Document_to_Filter_Events_Step">
http://www.opentag.com/okapi/wiki/index.php?title=Raw_Document_to_Filter_Events_Step</a></p>
+
+<h2><a name="overview"></a>Overview</h2>
+<p>This step extracts the content of a raw document into a set of filter
events.</p>
+<p>Takes: Raw document<br>
+Sends: Filter events</p>
+<p>This step is used to take a raw document with an associated filter
+configuration and send the filter events down the pipeline. It basically
extract
+the content and structure information of the input so steps that take
filter
+events as input can be used. This step is generally the first one of the
+pipeline, but it can be placed after any step that sends a raw
document.</p>
+<p>To merge back filter events into a raw document use the <b>
+<a href="filtereventstorawdocumentstep.html">Filter Events to Raw
Document</a></b>
+step.</p>
+<h2><a name="parameters"></a>Parameters</h2>
+<p>This step has no user parameters. All the parameters are provided by the
+calling application.</p>
+<p> </p>
+
+</body>
+</html>
=======================================
--- /dev/null
+++ /applications/longhorn/src/test/resources/test_xml Mon Sep 29 18:32:37
2014 UTC
@@ -0,0 +1,3 @@
+<doc>
+ <p>The quick brown fox jumps over the lazy dog.</p>
+</doc>
=======================================
--- /dev/null
+++ /applications/rainbow-webapp/WEB-INF/web.xml Mon Sep 29 18:32:37 2014
UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="
http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <context-param>
+ <param-name>org.eclipse.rap.applicationConfiguration</param-name>
+
<param-value>net.sf.okapi.applications.rainbow.webapp.RainbowWebAppConfiguration</param-value>
+ </context-param>
+
+ <listener>
+
<listener-class>org.eclipse.rwt.engine.RWTServletContextListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>rainbow-ui</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>rainbow-ui-fullscreen</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+<!--
http://localhost:8080/okapi-rainbow/ui -->
+ <servlet-mapping>
+ <servlet-name>rainbow-ui</servlet-name>
+ <url-pattern>/ui/*</url-pattern>
+ </servlet-mapping>
+
+<!--
http://localhost:8080/okapi-rainbow/ui-fs -->
+ <servlet-mapping>
+ <servlet-name>rainbow-ui-fullscreen</servlet-name>
+ <url-pattern>/ui-fs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
=======================================
--- /dev/null
+++ /applications/rainbow-webapp/pom.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,138 @@
+<project xmlns="
http://maven.apache.org/POM/4.0.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>build-applications</artifactId>
+ <version>0.27-SNAPSHOT</version>
+ </parent>
+ <artifactId>okapi-application-rainbow-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Okapi Rainbow (Web version)</name>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>okapi-application-rainbow</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>macosx</artifactId>
+ <groupId>org.eclipse.swt.carbon</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86_64</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>sparc</artifactId>
+ <groupId>org.eclipse.swt.gtk.solaris</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.motif.aix</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.win32.win32</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.wpf.win32</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>okapi-rainbow</finalName>
+
+<!-- Unpack to /WEB-INF/classes/ the dependency JARs with packages
replacing those same-named of SWT/okapi-core-ui, to have those hooked up
instead -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>okapi-application-rainbow</artifactId>
+ <version>${project.version}</version>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}/okapi-rainbow/WEB-INF/lib</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.directory}/okapi-rainbow/WEB-INF/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!--
+ <attachClasses>true</attachClasses>
+ <classesClassifier>classes</classesClassifier>
+ -->
+ <webXml>WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+
+<!-- Block the error "maven-dependency-plugin
(goals "copy-dependencies", "unpack") is not supported by m2e"
+see
http://www.journaldev.com/503/how-to-fix-maven-dependency-plugin-goals-copy-dependencies-unpack-is-not-supported-by-m2e-in-eclipse
-->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.0,)</versionRange>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
=======================================
--- /dev/null
+++
/applications/rainbow-webapp/src/main/java/net/sf/okapi/applications/rainbow/webapp/RainbowWebApp.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,63 @@
+package net.sf.okapi.applications.rainbow.webapp;
+
+import net.sf.okapi.applications.rainbow.MainForm;
+import net.sf.okapi.common.ui.rwt.AbstractWebApp;
+
+import org.eclipse.swt.widgets.Shell;
+
+public class RainbowWebApp extends AbstractWebApp {
+
+ @Override
+ protected void createUI(Shell shell) {
+ if (!shell.getMaximized()) shell.setBounds(50, 50, 800, 500);
+ new MainForm(shell, null); // populate the shell
+
+ // Disable unsupported items on menu system
+// Menu menuBar = shell.getMenuBar();
+// Menu fileMenu = menuBar.getItem(0).getMenu();
+//
+// MenuItem loadFromClipboard = fileMenu.getItem(4);
+// loadFromClipboard.setEnabled(false);
+//
+// MenuItem fileSave = fileMenu.getItem(6);
+// fileSave.setEnabled(false);
+//
+// MenuItem fileSaveAs = fileMenu.getItem(7);
+//
+// // Remove current selection listeners
+// for (Object listener : SelectionEvent.getListeners(fileSaveAs)) {
+// SelectionEvent.removeListener(fileSaveAs, (SelectionListener)
listener);
+// }
+//
+// // Set new selection listener
+// fileSaveAs.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// (new SRXDocumentHandler()).save(getShell(), editor.getSrxDocument());
+// }
+// });
+//
+// MenuItem saveToClipboard = fileMenu.getItem(8);
+// saveToClipboard.setEnabled(false);
+//
+// Menu toolsMenu = menuBar.getItem(1).getMenu();
+// MenuItem testSegmentation = toolsMenu.getItem(0);
+//
+// // Remove current selection listeners
+// for (Object listener :
SelectionEvent.getListeners(testSegmentation)) {
+// SelectionEvent.removeListener(testSegmentation,
(SelectionListener) listener);
+// }
+//
+// // Set new selection listener
+// testSegmentation.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// segmentTextFile();
+// }
+// });
+
+ }
+
+ @Override
+ protected String getName() {
+ return "Rainbow";
+ }
+}
=======================================
--- /dev/null
+++
/applications/rainbow-webapp/src/main/java/net/sf/okapi/applications/rainbow/webapp/RainbowWebAppConfiguration.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,28 @@
+package net.sf.okapi.applications.rainbow.webapp;
+
+import net.sf.okapi.common.ui.rwt.AbstractWebAppConfig;
+
+import org.eclipse.rwt.lifecycle.IEntryPoint;
+
+public class RainbowWebAppConfiguration extends AbstractWebAppConfig {
+
+ @Override
+ protected String getEntryPointId() {
+ return "ui";
+ }
+
+ @Override
+ protected Class<? extends IEntryPoint> getEntryPointClass() {
+ return RainbowWebApp.class;
+ }
+
+ @Override
+ protected String getFaviconPath() {
+ return "rainbow16.png";
+ }
+
+ @Override
+ protected String getPageTitle() {
+ return "Okapi Rainbow";
+ }
+}
=======================================
--- /dev/null
+++ /applications/rainbow-webapp/src/main/resources/rainbow16.png Mon Sep
29 18:32:37 2014 UTC
@@ -0,0 +1,20 @@
+‰PNG
+
+
+IHDR óÿa gAMA ¯È7 Šé
pHYs t t Þf x tEXtSoftware Paint.NET v3.5.87;€] "IDAT8O•’=nƒ@
+7˜Ö på* +WtÈ
+7@4vCÉ ¦@T¾@ºˆ‹
+ôé‘+ç
+9 Ï3+ HØÅ èI»ÚyßüìnÌì
+à ‚ ˆG™ªªö]× eo†aøžÇ.Öišrß÷˜Ô4
+ʲ´û$Ið’y2¨é_ 5fYf³H
+E ò<纮I³ E±^ ö.Áñ ªyµlß¡ÂÆV Éɘ $Öã øÙÆÀî
+ÌWì俉 c¹
+€¶q8løt
+@ÔJÀ} â höËå
+ªO
+Ð äcY 4»ª ÀÞ Ü rµð @böAðu{V ä0g‘ "S^
+ñw
+0~È•_ ¸!zÍ®
+b½ "ƒ;³
+’fjí`õzUrì~ÞÒF< ÚÏžó !²TÄÓ3 ª IEND®B`‚
=======================================
--- /dev/null
+++ /applications/ratel-webapp/WEB-INF/web.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="
http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <context-param>
+ <param-name>org.eclipse.rap.applicationConfiguration</param-name>
+
<param-value>net.sf.okapi.applications.ratel.webapp.RatelWebAppConfiguration</param-value>
+ </context-param>
+
+ <listener>
+
<listener-class>org.eclipse.rwt.engine.RWTServletContextListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>ratel-ui</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>ratel-ui-fullscreen</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+<!--
http://localhost:8080/okapi-ratel/ui -->
+ <servlet-mapping>
+ <servlet-name>ratel-ui</servlet-name>
+ <url-pattern>/ui/*</url-pattern>
+ </servlet-mapping>
+
+<!--
http://localhost:8080/okapi-ratel/ui-fs -->
+ <servlet-mapping>
+ <servlet-name>ratel-ui-fullscreen</servlet-name>
+ <url-pattern>/ui-fs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
=======================================
--- /dev/null
+++ /applications/ratel-webapp/pom.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,108 @@
+<project xmlns="
http://maven.apache.org/POM/4.0.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>build-applications</artifactId>
+ <version>0.27-SNAPSHOT</version>
+ </parent>
+ <artifactId>okapi-application-ratel-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Okapi Ratel (Web version)</name>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.okapi.lib</groupId>
+ <artifactId>okapi-lib-segmentation-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>okapi-ratel</finalName>
+
+<!-- Unpack to /WEB-INF/classes/ the dependency JARs with packages
replacing those same-named of SWT/okapi-core-ui, to have those hooked up
instead -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>net.sf.okapi.lib</groupId>
+ <artifactId>okapi-lib-segmentation-ui</artifactId>
+ <version>${project.version}</version>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.directory}/okapi-ratel/WEB-INF/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!--
+ <attachClasses>true</attachClasses>
+ <classesClassifier>classes</classesClassifier>
+ -->
+ <webXml>WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+
+<!-- Block the error "maven-dependency-plugin
(goals "copy-dependencies", "unpack") is not supported by m2e"
+see
http://www.journaldev.com/503/how-to-fix-maven-dependency-plugin-goals-copy-dependencies-unpack-is-not-supported-by-m2e-in-eclipse
-->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.0,)</versionRange>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
=======================================
--- /dev/null
+++
/applications/ratel-webapp/src/main/java/net/sf/okapi/applications/ratel/webapp/RatelWebApp.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,97 @@
+package net.sf.okapi.applications.ratel.webapp;
+
+import net.sf.okapi.common.ui.BaseHelp;
+import net.sf.okapi.common.ui.rwt.AbstractWebApp;
+import net.sf.okapi.lib.ui.segmentation.WebSRXEditor;
+
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+
+public class RatelWebApp extends AbstractWebApp {
+
+// private String testInputPath;
+// private String testOutputPath;
+// private boolean htmlOutput;
+// private WebSRXEditor editor;
+// private BaseHelp help;
+
+ @Override
+ protected void createUI(Shell shell) {
+ if (!shell.getMaximized()) shell.setSize(800, 500);
+ new WebSRXEditor(shell, false, new BaseHelp("help")); // populate the
shell
+
+ // Disable unsupported items on menu system
+ Menu menuBar = shell.getMenuBar();
+ Menu fileMenu = menuBar.getItem(0).getMenu();
+
+ MenuItem loadFromClipboard = fileMenu.getItem(4);
+ loadFromClipboard.setEnabled(false);
+
+// MenuItem fileSave = fileMenu.getItem(6);
+// fileSave.setEnabled(false);
+//
+// MenuItem fileSaveAs = fileMenu.getItem(7);
+//
+// // Remove current selection listeners
+// for (Object listener : SelectionEvent.getListeners(fileSaveAs)) {
+// SelectionEvent.removeListener(fileSaveAs, (SelectionListener)
listener);
+// }
+//
+// // Set new selection listener
+// fileSaveAs.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// (new SRXDocumentHandler()).save(getShell(), editor.getSrxDocument());
+// }
+// });
+
+ MenuItem saveToClipboard = fileMenu.getItem(8);
+ saveToClipboard.setEnabled(false);
+
+// Menu toolsMenu = menuBar.getItem(1).getMenu();
+// MenuItem testSegmentation = toolsMenu.getItem(0);
+//
+// // Remove current selection listeners
+// for (Object listener :
SelectionEvent.getListeners(testSegmentation)) {
+// SelectionEvent.removeListener(testSegmentation,
(SelectionListener) listener);
+// }
+//
+// // Set new selection listener
+// testSegmentation.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// segmentTextFile();
+// }
+// });
+
+// if( !shell.getMaximized() && shellBounds.x == 0 && shellBounds.y ==
0 ) {
+// shell.setLocation(100, 50);
+// shell.setSize(600, 450);
+// }
+ }
+
+ @Override
+ protected String getName() {
+ return "Ratel";
+ }
+
+// private void segmentTextFile () {
+// try {
+// // Get the input file
+// WebFileProcessingDialog dlg = new WebFileProcessingDialog(getShell(),
help);
+// String[] result = dlg.showDialog(testInputPath, testOutputPath,
htmlOutput);
+// if ( result == null ) return; // Canceled
+// testInputPath = result[0];
+// testOutputPath = result[1];
+// htmlOutput = (result[2]!=null);
+//
+// // Process
+// editor.getFileProcessor().process(testInputPath, testOutputPath,
htmlOutput, editor.getSegmenter());
+// // TODO Check concurrency
+// FileDownload.open(testOutputPath);
+// }
+// catch ( Throwable e ) {
+// Dialogs.showError(getShell(), e.getLocalizedMessage(), null);
+// }
+// }
+
+}
=======================================
--- /dev/null
+++
/applications/ratel-webapp/src/main/java/net/sf/okapi/applications/ratel/webapp/RatelWebAppConfiguration.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,28 @@
+package net.sf.okapi.applications.ratel.webapp;
+
+import net.sf.okapi.common.ui.rwt.AbstractWebAppConfig;
+
+import org.eclipse.rwt.lifecycle.IEntryPoint;
+
+public class RatelWebAppConfiguration extends AbstractWebAppConfig {
+
+ @Override
+ protected String getEntryPointId() {
+ return "ui";
+ }
+
+ @Override
+ protected Class<? extends IEntryPoint> getEntryPointClass() {
+ return RatelWebApp.class;
+ }
+
+ @Override
+ protected String getFaviconPath() {
+ return "ratel16.png";
+ }
+
+ @Override
+ protected String getPageTitle() {
+ return "Okapi Ratel";
+ }
+}
=======================================
--- /dev/null
+++
/applications/ratel-webapp/src/main/java/net/sf/okapi/lib/ui/segmentation/WebFileProcessingDialog.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,260 @@
+/*===========================================================================
+ Copyright (C) 2008-2009 by the Okapi Framework contributors
+-----------------------------------------------------------------------------
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See also the full LGPL text here:
http://www.gnu.org/copyleft/lesser.html
+===========================================================================*/
+
+package net.sf.okapi.lib.ui.segmentation;
+
+import java.io.File;
+
+import net.sf.okapi.common.IHelp;
+import net.sf.okapi.common.Util;
+import net.sf.okapi.common.ui.Dialogs;
+import net.sf.okapi.common.ui.OKCancelPanel;
+import net.sf.okapi.common.ui.UIUtil;
+import net.sf.okapi.common.ui.fileupload.OkapiUploadPanel;
+
+import org.eclipse.rwt.lifecycle.UICallBack;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.widgets.UploadPanel;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+public class WebFileProcessingDialog {
+
+ private Shell shell;
+ //private Text edInput;
+ //private Text edOutput;
+ private OkapiUploadPanel uploadPanel;
+ private String inputPath;
+ private String outputPath;
+ private Button chkHtmlOutput;
+ private String[] result = null;
+ private IHelp help;
+ private boolean uploading;
+
+ @SuppressWarnings("serial")
+ public WebFileProcessingDialog (Shell parent,
+ IHelp helpParam)
+ {
+ help = helpParam;
+ shell = new Shell(parent, SWT.CLOSE | SWT.TITLE | SWT.RESIZE |
SWT.APPLICATION_MODAL);
+ shell.setText(Res.getString("testFileDlg.caption")); //$NON-NLS-1$
+ UIUtil.inheritIcon(shell, parent);
+ shell.setLayout(new GridLayout());
+
+ Composite cmpTmp = new Composite(shell, SWT.BORDER);
+ cmpTmp.setLayout(new GridLayout(1, false));
+ GridData gdTmp = new GridData(GridData.FILL_HORIZONTAL);
+ cmpTmp.setLayoutData(gdTmp);
+
+ Label label = new Label(cmpTmp, SWT.NONE);
+ label.setText(Res.getString("testFileDlg.inputPath")); //$NON-NLS-1$
+// label.setText("<a href=\"
http://code.google.com/p/okapi/"
target=\"_blank\">Okapi Framework</a>");
+// label.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
+ gdTmp = new GridData();
+ gdTmp.horizontalAlignment = SWT.FILL;
+ gdTmp.grabExcessHorizontalSpace = true;
+ gdTmp.horizontalSpan = 1;
+ label.setLayoutData(gdTmp);
+
+ uploadPanel = new OkapiUploadPanel(cmpTmp, UploadPanel.FULL);
+ gdTmp = new GridData();
+ gdTmp.horizontalAlignment = SWT.FILL;
+ gdTmp.horizontalSpan = 1;
+ uploadPanel.setLayoutData(gdTmp);
+
+// edInput = new Text(cmpTmp, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
+// gdTmp = new GridData(GridData.FILL_BOTH);
+// edInput.setLayoutData(gdTmp);
+//
+// final FileUpload browseButton = new FileUpload(cmpTmp, SWT.PUSH);
+// browseButton.setText("Browse..."); //$NON-NLS-1$
+// browseButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false,
false, 1, 1));
+// browseButton.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+//// String[] paths = Dialogs.browseFilenames(shell,
Res.getString("testFileDlg.getInputCaption"), false, //$NON-NLS-1$
+//// null, Res.getString("testFileDlg.getInputFileTypes"),
Res.getString("testFileDlg.getInputFilter")); //$NON-NLS-1$ //$NON-NLS-2$
+//// if ( paths == null ) return;
+//// inputPath = paths[0];
+// inputPath = browseButton.getFileName();
+// edInput.setText(Util.getFilename(inputPath, true));
+//// edInput.selectAll();
+//// edInput.setFocus();
+// updateOutputPath();
+// }
+// });
+
+// label = new Label(cmpTmp, SWT.NONE);
+// label.setText(Res.getString("testFileDlg.outputPath")); //$NON-NLS-1$
+// gdTmp = new GridData();
+// gdTmp.horizontalSpan = 2;
+// label.setLayoutData(gdTmp);
+//
+// edOutput = new Text(cmpTmp, SWT.BORDER | SWT.SINGLE);
+// gdTmp = new GridData(GridData.FILL_HORIZONTAL);
+// edOutput.setLayoutData(gdTmp);
+//
+// Button btGetOutput = new Button(cmpTmp, SWT.PUSH);
+// btGetOutput.setText("..."); //$NON-NLS-1$
+// btGetOutput.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// String path = Dialogs.browseFilenamesForSave(shell,
Res.getString("testFileDlg.getOutputCaption"), //$NON-NLS-1$
+// null, null,
+// Res.getString("testFileDlg.getOutputFileTypes"),
Res.getString("testFileDlg.getOutputFilter")); //$NON-NLS-1$ //$NON-NLS-2$
+// if ( path == null ) return;
+//// edOutput.setText(path);
+//// edOutput.selectAll();
+//// edOutput.setFocus();
+// }
+// });
+
+ chkHtmlOutput = new Button(cmpTmp, SWT.CHECK);
+ chkHtmlOutput.setText(Res.getString("testFileDlg.createHTML"));
//$NON-NLS-1$
+ gdTmp = new GridData();
+ gdTmp.horizontalSpan = 2;
+ chkHtmlOutput.setLayoutData(gdTmp);
+ chkHtmlOutput.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateOutputPath();
+ }
+ });
+
+ //--- Dialog-level buttons
+
+ SelectionAdapter okCancelActions = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ result = null;
+ uploading = false;
+ if ( e.widget.getData().equals("h") ) { //$NON-NLS-1$
+ if ( help != null ) help.showWiki("Ratel - Test Segmentation on a
File");
+ return;
+ }
+ if ( e.widget.getData().equals("o") ) { //$NON-NLS-1$
+ //if ( !saveData() ) return;
+ uploading = uploadPanel.start();
+ return; // The form is closed by upload handler when finishes
+ }
+ shell.close();
+ };
+ };
+ OKCancelPanel pnlActions = new OKCancelPanel(shell, SWT.NONE,
okCancelActions, true);
+ pnlActions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ shell.setDefaultButton(pnlActions.btOK);
+ UICallBack.activate( WebFileProcessingDialog.class.getName() +
hashCode() ); // !!!
+
+ shell.addShellListener( new ShellAdapter() { // !!!
+ private static final long serialVersionUID = 1L;
+ @Override
+ public void shellClosed( ShellEvent e ) {
+ if (uploading)
+ saveData();
+ UICallBack.deactivate( WebFileProcessingDialog.class.getName() +
hashCode() ); // !!!
+ }
+ } );
+
+ shell.pack();
+ shell.setMinimumSize(shell.getSize());
+ Point startSize = shell.getMinimumSize();
+ if ( startSize.x < 600 ) startSize.x = 600;
+ shell.setSize(startSize);
+ Dialogs.centerWindow(shell, parent);
+ }
+
+ public String[] showDialog (String inputPath,
+ String outputPath,
+ boolean htmlOutput)
+ {
+ shell.open();
+ this.inputPath = Util.isEmpty(inputPath) ? "" : inputPath;
+ this.outputPath = Util.isEmpty(outputPath) ? "" : outputPath;
+ chkHtmlOutput.setSelection(htmlOutput);
+
+ //edInput.setText(Util.getFilename(this.inputPath, true));
+ updateOutputPath();
+
+ while ( !shell.isDisposed() ) {
+ if ( !shell.getDisplay().readAndDispatch() )
+ shell.getDisplay().sleep();
+ }
+ return result;
+ }
+
+ private boolean saveData () {
+ try {
+ result = null;
+// if ( edInput.getText().length() == 0 ) {
+// edInput.selectAll();
+// edInput.setFocus();
+// return false;
+// }
+// if (Util.isEmpty(uploadPanel.getSelectedFilename())) {
+// return false;
+// }
+// if ( edOutput.getText().length() == 0 ) {
+// edOutput.selectAll();
+// edOutput.setFocus();
+// return false;
+// }
+ this.inputPath = uploadPanel.getFileName();
+ updateOutputPath();
+ result = new String[3];
+ result[0] = this.inputPath;
+ result[1] = this.outputPath; //edOutput.getText();
+ result[2] = (chkHtmlOutput.getSelection() ? "html" : null);
//$NON-NLS-1$
+ return true;
+ }
+ catch ( Exception e) {
+ Dialogs.showError(shell, e.getLocalizedMessage(), null);
+ return false;
+ }
+ }
+
+ private String makeHtmlOutputPath (String inputPath) {
+ if (Util.isEmpty(inputPath)) return ""; //$NON-NLS-1$
+ return inputPath + ".html"; //$NON-NLS-1$
+ }
+
+ private String makeNonHtmlOutputPath (String inputPath) {
+ if (Util.isEmpty(inputPath)) return ""; //$NON-NLS-1$
+ String ext = Util.getExtension(inputPath);
+ String filename = Util.getFilename(inputPath, false);
+ return Util.getDirectoryName(inputPath) + File.separator +
+ filename + Res.getString("testFileDlg.outputExtension") + ext;
//$NON-NLS-1$
+ }
+
+ private void updateOutputPath () {
+ if ( chkHtmlOutput.getSelection() ) {
+ //edOutput.setText(makeHtmlOutputPath(edInput.getText()));
+ outputPath = makeHtmlOutputPath(inputPath);
+ }
+ else {
+ //edOutput.setText(makeNonHtmlOutputPath(edInput.getText()));
+ outputPath = makeNonHtmlOutputPath(inputPath);
+ }
+ }
+}
=======================================
--- /dev/null
+++
/applications/ratel-webapp/src/main/java/net/sf/okapi/lib/ui/segmentation/WebSRXEditor.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,124 @@
+package net.sf.okapi.lib.ui.segmentation;
+
+import java.io.File;
+
+import net.sf.okapi.common.FileUtil;
+import net.sf.okapi.common.IHelp;
+import net.sf.okapi.common.Util;
+import net.sf.okapi.common.ui.filedownload.FileDownload;
+import net.sf.okapi.common.ui.filedownload.SaveAsDialog;
+
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+
+public class WebSRXEditor extends SRXEditor {
+
+ private Shell parent;
+ private IHelp helpParam;
+ private String serverPath;
+ private String clientPath;
+ private File tempFile;
+
+ public WebSRXEditor(Shell parent, boolean asDialog, IHelp helpParam) {
+ super(parent, asDialog, helpParam);
+ this.parent = parent;
+ this.helpParam = helpParam;
+// Rectangle shellBounds = shell.getBounds();
+
+ // Disable unsupported items on menu system
+ Menu menuBar = parent.getMenuBar();
+ Menu fileMenu = menuBar.getItem(0).getMenu();
+
+ MenuItem loadFromClipboard = fileMenu.getItem(4);
+ loadFromClipboard.setEnabled(false);
+
+// MenuItem fileSave = fileMenu.getItem(6);
+// fileSave.setEnabled(false);
+//
+// MenuItem fileSaveAs = fileMenu.getItem(7);
+//
+// // Remove current selection listeners
+// for (Object listener : SelectionEvent.getListeners(fileSaveAs)) {
+// SelectionEvent.removeListener(fileSaveAs, (SelectionListener)
listener);
+// }
+//
+// // Set new selection listener
+// fileSaveAs.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// (new SRXDocumentHandler()).save(getShell(), editor.getSrxDocument());
+// }
+// });
+
+ MenuItem saveToClipboard = fileMenu.getItem(8);
+ saveToClipboard.setEnabled(false);
+
+// Menu toolsMenu = menuBar.getItem(1).getMenu();
+// MenuItem testSegmentation = toolsMenu.getItem(0);
+//
+// // Remove current selection listeners
+// for (Object listener :
SelectionEvent.getListeners(testSegmentation)) {
+// SelectionEvent.removeListener(testSegmentation,
(SelectionListener) listener);
+// }
+//
+// // Set new selection listener
+// testSegmentation.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// segmentTextFile();
+// }
+// });
+
+// if( !shell.getMaximized() && shellBounds.x == 0 && shellBounds.y ==
0 ) {
+// shell.setLocation(100, 50);
+// shell.setSize(600, 450);
+// }
+ }
+
+ protected void loadSRXDocument_rulesLoaded(String path) {
+ serverPath = path;
+ clientPath = Util.getFilename(path, true);
+ }
+
+ @Override
+ protected String saveSRXDocument_getPath() {
+ SaveAsDialog dlg = new SaveAsDialog(parent,
Res.getString("edit.saveDocCaption"));
+ String result = dlg.showDialog(clientPath);
+ if (Util.isEmpty(result)) return null;
+
+ clientPath = result;
+ if (Util.isEmpty(serverPath)) {
+ // serverPath was not set, no file was uploaded, we create a temp file
+ // FIXME: delete temp file
+ tempFile = FileUtil.createTempFile("~okapi-6_");
+ serverPath = tempFile.getAbsolutePath();
+ }
+ return serverPath;
+ }
+
+ @Override
+ protected String updateCaption_getFileName(String srxPath) {
+ return clientPath;
+ }
+
+ @Override
+ protected void saveSRXDocument_afterSave(String path, boolean saveAsMode)
{
+ if (saveAsMode) {
+ FileDownload fd = new FileDownload();
+ fd.open(serverPath, clientPath);
+ }
+ }
+
+ @Override
+ protected String[] segmentTextFile_getPaths(String testInputPath,
+ String testOutputPath, boolean htmlOutput) {
+ // Get the input file
+ WebFileProcessingDialog dlg = new WebFileProcessingDialog(parent,
helpParam);
+ return dlg.showDialog(testInputPath, testOutputPath, htmlOutput);
+ }
+
+ @Override
+ protected void segmentTextFile_processResult(String testOutputPath) {
+ FileDownload fd = new FileDownload();
+ fd.open(testOutputPath, Util.getFilename(testOutputPath, true));
+ }
+}
=======================================
--- /dev/null
+++
/applications/ratel-webapp/src/main/resources/net/sf/okapi/lib/ui/segmentation/Res.properties
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,86 @@
+SRXEditor.aboutCaption=About Ratel
+SRXEditor.aboutDescription=Ratel - Okapi Segmentation Rules Editor
+SRXEditor.defaultSetName=default
+SRXEditor.untitled=Untitled
+edit.captionApp=Ratel
+edit.currentLangRules=Language rules currently displayed:
+edit.groupAndOptions=&Groups and Options...
+edit.btAddRule=&Add...
+edit.btEditRule=&Edit...
+edit.btRemoveRule=&Remove
+edit.moveUp=Move &Up
+edit.moveDown=Move &Down
+edit.maskRule=&Mask Rule...
+edit.charInfo=Char &Info...
+edit.maskRuleDesc=Enter the regular expression for the mask rule. Leave
the field empty to not use any mask rule.\nNote: This is an extension to
SRX.
+edit.charInfoCaption=Character Information
+edit.error=Error:
+edit.loadDocCaption=Open SRX Document
+edit.loadDocFileTypes=SRX Documents\tAll Files
+edit.loadDocFilters=*.srx\t*.*
+edit.saveDocVersionWarning=The file will be saved as SRX 2.0.\nDo you want
to proceed?
+edit.saveDocCaption=Save SRX Document
+edit.saveDocFileTypes=SRX Documents
+edit.saveDocFilters=*.srx
+edit.maskRuleCaption=Mask Rule Expression
+edit.confirmSave=The segmentation rules have been modified but not
saved.\nDo you want to save them?
+edit.sampleNote=Sample text (use <x>...</x> and <x/> to represent in-line
codes):
+edit.testOnlyGroup=Test on the current set of rules only
+edit.testLanguage=Test on the rules for this language code:
+GroupsAndOptionsDialog.docComments=Document comments
+GroupsAndOptionsDialog.headerComments=Header comments:
+langMap.caption=Edit Language Map
+langMap.groupName=Name of the language rule associated with the regular
expression:
+langMap.regexLabel=Regular expression describing the language map:
+options.caption=Groups And Options
+options.grpOptions=Options
+options.grpExtensions=Extensions (not part of the SRX standard)
+options.segmentSubFlow=Segment sub-flow items
+options.includeStartCodes=Include opening in-line codes
+options.cascade=Cascade language maps matching
+options.includeEndCodes=Include closing in-line codes
+options.trimLeadingWS=Trim leading white-spaces
+options.includeIsolatedCodes=Include isolated in-line codes
+options.trimtrailingWS=Trim trailing white-spaces
+options.includeAllInOne=Include all text for single segments
+options.useJavaRegex=Use the Java regular expressions engine (not ICU)
+options.grpLangRules=Language Rules
+options.addRules=Add...
+options.renameRules=Rename...
+options.removeRules=Remove...
+options.grpLangMaps=Language Maps
+options.addMap=Add...
+options.editMap=Edit...
+options.removeMap=Remove
+options.moveUpMap=Move Up
+options.moveDownMap=Move Down
+options.defaultGroupName=group%d
+options.newGroupCaption=New Rules
+options.renameGroupCaption=Rename Rules
+options.groupNameLabel=Name of the rules:
+options.sameNameError=The name "%s" exists already.\nPlease choose another
one.
+options.confirmRemoveRules=This command will delete all thes rules grouped
under '%s'.\nDo you want to proceed with the deletion?
+options.badNamesError=Number of language maps associated with non-existing
rules: %d\n(%s)\nDo you want to proceed closing the dialog?
+RuleDialog.comments=Comments:
+ruleDlg.actionLabel=Action for this rule:
+ruleDlg.afterLabel=Expression after the position:
+ruleDlg.beforeLabel=Expression before the position:
+ruleDlg.caption=Edit Rule
+ruleDlg.isBreak=Insert a segment break at this position
+ruleDlg.notBreak=Do not break at this position
+ruleTable.afterBreak=After Break
+ruleTable.beforeBreak=Before Break
+ruleTable.break=Break
+ruleTable.noBreak=No-Break
+ruleTable.type=Type
+testFileDlg.caption=Test Segmentation on a File
+testFileDlg.createHTML=Create HTML output
+testFileDlg.getInputCaption=Input Test File
+testFileDlg.getInputFileTypes=Text Files\tAll Files
+testFileDlg.getInputFilter=*.txt\t*.*
+testFileDlg.getOutputCaption=Output Test File
+testFileDlg.getOutputFileTypes=Text Files\tAll Files
+testFileDlg.getOutputFilter=*.txt\t*.*
+testFileDlg.inputPath=Upload a test file to segment (plain text in UTF-8):
+testFileDlg.outputExtension=.segmented
+testFileDlg.outputPath=Full path of the output file:
=======================================
--- /dev/null
+++ /applications/ratel-webapp/src/main/resources/ratel16.png Mon Sep 29
18:32:37 2014 UTC
@@ -0,0 +1,7 @@
+‰PNG
+
+
+IHDR óÿa gAMA ±
+üa >IDAT8Ocü
+” ¨ Cðb :l€aÔ€ÿ8à ¢ èÁ A1ˆ+ j >x
+ÀžBH ƒQ på3âÄ V \Á“ ò IEND®B`‚
=======================================
--- /dev/null
+++ /applications/serval-webapp/WEB-INF/web.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="
http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <context-param>
+ <param-name>org.eclipse.rap.applicationConfiguration</param-name>
+
<param-value>net.sf.okapi.applications.serval.webapp.ServalWebAppConfiguration</param-value>
+ </context-param>
+
+ <listener>
+
<listener-class>org.eclipse.rwt.engine.RWTServletContextListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>serval-ui</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>serval-ui-fullscreen</servlet-name>
+ <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+ </servlet>
+
+<!--
http://localhost:8080/okapi-serval/ui -->
+ <servlet-mapping>
+ <servlet-name>serval-ui</servlet-name>
+ <url-pattern>/ui/*</url-pattern>
+ </servlet-mapping>
+
+<!--
http://localhost:8080/okapi-serval/ui-fs -->
+ <servlet-mapping>
+ <servlet-name>serval-ui-fullscreen</servlet-name>
+ <url-pattern>/ui-fs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
=======================================
--- /dev/null
+++ /applications/serval-webapp/pom.xml Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,131 @@
+<project xmlns="
http://maven.apache.org/POM/4.0.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>build-applications</artifactId>
+ <version>0.27-SNAPSHOT</version>
+ </parent>
+ <artifactId>okapi-application-serval-webapp</artifactId>
+ <name>Okapi Serval (Web version)</name>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.okapi.applications</groupId>
+ <artifactId>okapi-application-serval</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>macosx</artifactId>
+ <groupId>org.eclipse.swt.carbon</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86_64</artifactId>
+ <groupId>org.eclipse.swt.gtk.linux</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>sparc</artifactId>
+ <groupId>org.eclipse.swt.gtk.solaris</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>ppc</artifactId>
+ <groupId>org.eclipse.swt.motif.aix</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.win32.win32</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>x86</artifactId>
+ <groupId>org.eclipse.swt.wpf.win32</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>okapi-serval</finalName>
+
+<!-- Unpack to /WEB-INF/classes/ the dependency JARs with packages
replacing those same-named of SWT/okapi-core-ui, to have those hooked up
instead -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>net.sf.okapi</groupId>
+ <artifactId>okapi-core-ui-rwt</artifactId>
+ <version>${project.version}</version>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.directory}/okapi-serval/WEB-INF/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!--
+ <attachClasses>true</attachClasses>
+ <classesClassifier>classes</classesClassifier>
+ -->
+ <webXml>WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+
+<!-- Block the error "maven-dependency-plugin
(goals "copy-dependencies", "unpack") is not supported by m2e"
+see
http://www.journaldev.com/503/how-to-fix-maven-dependency-plugin-goals-copy-dependencies-unpack-is-not-supported-by-m2e-in-eclipse
-->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.0,)</versionRange>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
=======================================
--- /dev/null
+++
/applications/serval-webapp/src/main/java/net/sf/okapi/applications/serval/webapp/ServalWebApp.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,72 @@
+package net.sf.okapi.applications.serval.webapp;
+
+import net.sf.okapi.applications.serval.ServalForm;
+import net.sf.okapi.common.ui.rwt.AbstractWebApp;
+
+import org.eclipse.swt.widgets.Shell;
+
+public class ServalWebApp extends AbstractWebApp {
+
+ @Override
+ protected void createUI(Shell shell) {
+ if (!shell.getMaximized()) shell.setBounds(50, 50, 800, 500);
+ //BaseHelp help = new BaseHelp("help"); //$NON-NLS-1$
+
+ //ServalForm editor = new ServalForm(shell);
+ new ServalForm(shell);
+// // Create and fill the configuration mapper
+// IFilterConfigurationMapper fcMapper = new FilterConfigurationMapper();
+// DefaultFilters.setMappings(fcMapper, false, true);
+//
+// // Initialize the editor
+// editor.initialize(shell, false, help, fcMapper, null);
+
+ // Disable unsupported items on menu system
+// Menu menuBar = shell.getMenuBar();
+// Menu fileMenu = menuBar.getItem(0).getMenu();
+//
+// MenuItem loadFromClipboard = fileMenu.getItem(4);
+// loadFromClipboard.setEnabled(false);
+//
+// MenuItem fileSave = fileMenu.getItem(6);
+// fileSave.setEnabled(false);
+//
+// MenuItem fileSaveAs = fileMenu.getItem(7);
+//
+// // Remove current selection listeners
+// for (Object listener : SelectionEvent.getListeners(fileSaveAs)) {
+// SelectionEvent.removeListener(fileSaveAs, (SelectionListener)
listener);
+// }
+//
+// // Set new selection listener
+// fileSaveAs.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// (new SRXDocumentHandler()).save(getShell(), editor.getSrxDocument());
+// }
+// });
+//
+// MenuItem saveToClipboard = fileMenu.getItem(8);
+// saveToClipboard.setEnabled(false);
+//
+// Menu toolsMenu = menuBar.getItem(1).getMenu();
+// MenuItem testSegmentation = toolsMenu.getItem(0);
+//
+// // Remove current selection listeners
+// for (Object listener :
SelectionEvent.getListeners(testSegmentation)) {
+// SelectionEvent.removeListener(testSegmentation,
(SelectionListener) listener);
+// }
+//
+// // Set new selection listener
+// testSegmentation.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent event) {
+// segmentTextFile();
+// }
+// });
+
+ }
+
+ @Override
+ protected String getName() {
+ return "Serval";
+ }
+}
=======================================
--- /dev/null
+++
/applications/serval-webapp/src/main/java/net/sf/okapi/applications/serval/webapp/ServalWebAppConfiguration.java
Mon Sep 29 18:32:37 2014 UTC
@@ -0,0 +1,28 @@
+package net.sf.okapi.applications.serval.webapp;
+
+import net.sf.okapi.common.ui.rwt.AbstractWebAppConfig;
+
+import org.eclipse.rwt.lifecycle.IEntryPoint;
+
+public class ServalWebAppConfiguration extends AbstractWebAppConfig {
+
+ @Override
+ protected String getEntryPointId() {
+ return "ui";
+ }
+
+ @Override
+ protected Class<? extends IEntryPoint> getEntryPointClass() {
+ return ServalWebApp.class;
+ }
+
+ @Override
+ protected String getFaviconPath() {
+ return null;
+ }
+
+ @Override
+ protected String getPageTitle() {
+ return "Okapi Serval";
+ }
+}
=======================================
***Additional files exist in this changeset.***