You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2017/04/23 20:48:05 UTC

svn commit: r1792392 - in /ctakes/trunk: ctakes-distribution/src/main/bin/ ctakes-gui/src/main/java/org/apache/ctakes/gui/component/ ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/

Author: seanfinan
Date: Sun Apr 23 20:48:04 2017
New Revision: 1792392

URL: http://svn.apache.org/viewvc?rev=1792392&view=rev
Log:
ctakes - 424 : Submitter GUI launch scripts
Clear logger panel document when it reaches int.max - 5k to prevent overflow.

Added:
    ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.bat
      - copied, changed from r1791645, ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat
    ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.sh
      - copied, changed from r1791645, ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh
Modified:
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/component/LoggerPanel.java
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/PiperRunner.java

Copied: ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.bat (from r1791645, ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat)
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.bat?p2=ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.bat&p1=ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat&r1=1791645&r2=1792392&rev=1792392&view=diff
==============================================================================
--- ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.bat (original)
+++ ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.bat Sun Apr 23 20:48:04 2017
@@ -18,25 +18,8 @@
 :: under the License.
 ::
 ::
-::   Runs the pipeline in the piper file specified by -p {piperfile}
-::   with any other provided parameters.  Standard parameters are:
-::   -i , --inputDir {inputDirectory}
-::   -o , --outputDir {outputDirectory}
-::   -s , --subDir {subDirectory}  (for i/o)
-::   --xmiOut {xmiOutputDirectory} (if different from -o)
-::   -l , --lookupXml {dictionaryConfigFile} (fast only)
-::   --user {umlsUsername}
-::   --pass {umlsPassword}
-::   -? , --help
-::
-::   Other parameters may be declared in the piper file using the cli command:
-::     cli {parameterName}={singleCharacter}
-::   For instance, for declaration of ParagraphAnnotator path to regex file optional parameter PARAGRAPH_TYPES_PATH,
-::   in the custom piper file add the line:
-::     cli PARAGRAPH_TYPES_PATH=t
-::   and when executing this script use:
-::      runPiperFile -p path/to/my/custom.piper -t path/to/my/custom.bsv  ...
-::
+::   Runs the pipeline in a piper file.
+::::
 :: Requires JAVA JDK 1.8+
 ::
 
@@ -62,7 +45,7 @@ if exist "%JAVA_HOME%\bin\java.exe" set
 cd %CTAKES_HOME%
 set CLASS_PATH=%CTAKES_HOME%\desc\;%CTAKES_HOME%\resources\;%CTAKES_HOME%\lib\*
 set LOG4J_PARM=-Dlog4j.configuration=file:\%CTAKES_HOME%\config\log4j.xml
-set PIPE_RUNNER=org.apache.ctakes.core.pipeline.PiperFileRunner
+set PIPE_RUNNER=org.apache.ctakes.gui.pipeline.PiperRunner
 java -cp "%CLASS_PATH%" %LOG4J_PARM% -Xms512M -Xmx3g %PIPE_RUNNER% %*
 cd %CURRENT_DIR%
 

Copied: ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.sh (from r1791645, ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh)
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.sh?p2=ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.sh&p1=ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh&r1=1791645&r2=1792392&rev=1792392&view=diff
==============================================================================
--- ctakes/trunk/ctakes-distribution/src/main/bin/runPiperFile.sh (original)
+++ ctakes/trunk/ctakes-distribution/src/main/bin/runPiperSubmitter.sh Sun Apr 23 20:48:04 2017
@@ -18,24 +18,7 @@
 # under the License.
 #
 #
-#   Runs the pipeline in the piper file specified by -p (piperfile)
-#   with any other provided parameters.  Standard parameters are:
-#     -i , --inputDir {inputDirectory}
-#     -o , --outputDir {outputDirectory}
-#     -s , --subDir {subDirectory}  (for i/o)
-#     --xmiOut {xmiOutputDirectory} (if different from -o)
-#     -l , --lookupXml {dictionaryConfigFile} (fast only)
-#     --user {umlsUsername}
-#     --pass {umlsPassword}
-#     -? , --help
-#
-#   Other parameters may be declared in the piper file using the cli command:
-#     cli {parameterName}={singleCharacter}
-#   For instance, for declaration of ParagraphAnnotator path to regex file optional parameter PARAGRAPH_TYPES_PATH,
-#   in the custom piper file add the line:
-#     cli PARAGRAPH_TYPES_PATH=t
-#   and when executing this script use:
-#      runPiperFile -p path/to/my/custom.piper -t path/to/my/custom.bsv  ...
+#   Runs the pipeline in a piper file.
 #
 # Requires JAVA JDK 1.8+
 #
@@ -56,4 +39,4 @@ PRGDIR=`dirname "$PRG"`
 [ -z "$CTAKES_HOME" ] && CTAKES_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
 
 cd $CTAKES_HOME
-java -cp $CTAKES_HOME/desc/:$CTAKES_HOME/resources/:$CTAKES_HOME/lib/* -Dlog4j.configuration=file:$CTAKES_HOME/config/log4j.xml -Xms512M -Xmx3g org.apache.ctakes.core.pipeline.PiperFileRunner "$@"
+java -cp $CTAKES_HOME/desc/:$CTAKES_HOME/resources/:$CTAKES_HOME/lib/* -Dlog4j.configuration=file:$CTAKES_HOME/config/log4j.xml -Xms512M -Xmx3g org.apache.ctakes.gui.pipeline.PiperRunner "$@"

Modified: ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/component/LoggerPanel.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/component/LoggerPanel.java?rev=1792392&r1=1792391&r2=1792392&view=diff
==============================================================================
--- ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/component/LoggerPanel.java (original)
+++ ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/component/LoggerPanel.java Sun Apr 23 20:48:04 2017
@@ -20,6 +20,7 @@ import java.util.Collection;
  */
 final public class LoggerPanel extends JScrollPane {
 
+   static private final int MAX_DOC_LENGTH = Integer.MAX_VALUE - 5000;
 
    static public LoggerPanel createLoggerPanel( final Level... levels ) {
       final LoggerPanel panel = new LoggerPanel( levels );
@@ -75,6 +76,10 @@ final public class LoggerPanel extends J
    public void appendText( final String text ) {
       SwingUtilities.invokeLater( () -> {
          try {
+            if (_textAreaDoc.getLength() >= MAX_DOC_LENGTH ) {
+               // clear log if it gets too long.  Not the best solution, but good enough for now.
+               _textAreaDoc.remove( 0, _textAreaDoc.getLength() );
+            }
             _textAreaDoc.insertString( _textAreaDoc.getLength(), text, null );
          } catch ( BadLocationException blE ) {
             //

Modified: ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/PiperRunner.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/PiperRunner.java?rev=1792392&r1=1792391&r2=1792392&view=diff
==============================================================================
--- ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/PiperRunner.java (original)
+++ ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/pipeline/PiperRunner.java Sun Apr 23 20:48:04 2017
@@ -17,7 +17,7 @@ final public class PiperRunner {
    static private final Logger LOGGER = Logger.getLogger( "PiperRunner" );
 
    static private JFrame createFrame() {
-      final JFrame frame = new JFrame( "cTAKES Simple Pipeline Fabricator" );
+      final JFrame frame = new JFrame( "cTAKES Piper File Submitter" );
       frame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE );
       // Use 1024 x 768 as the minimum required resolution (XGA)
       // iPhone 3 : 480 x 320 (3:2, HVGA)