You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/08/25 20:40:56 UTC
svn commit: r1161684 - in /incubator/lcf/trunk: ./ framework/
framework/engine-scripts/ site/src/documentation/content/xdocs/
Author: kwright
Date: Thu Aug 25 18:40:56 2011
New Revision: 1161684
URL: http://svn.apache.org/viewvc?rev=1161684&view=rev
Log:
Get it straight how we're supposed to actually start the script interpreter.
Added:
incubator/lcf/trunk/framework/engine-scripts/
incubator/lcf/trunk/framework/engine-scripts/run-script.bat (with props)
incubator/lcf/trunk/framework/engine-scripts/run-script.sh (with props)
incubator/lcf/trunk/framework/engine-scripts/setclasspath.bat (with props)
incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml (with props)
Modified:
incubator/lcf/trunk/build.xml
incubator/lcf/trunk/framework/build.xml
incubator/lcf/trunk/site/src/documentation/content/xdocs/included-connectors.xml
incubator/lcf/trunk/site/src/documentation/content/xdocs/site.xml
Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1161684&r1=1161683&r2=1161684&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Thu Aug 25 18:40:56 2011
@@ -938,6 +938,10 @@
<copy todir="dist/processes">
<fileset dir="framework/dist/processes"/>
</copy>
+ <mkdir dir="dist/script-engine"/>
+ <copy todir="dist/script-engine">
+ <fileset dir="framework/dist/script-engine"/>
+ </copy>
<mkdir dir="dist/web"/>
<copy todir="dist/web">
<fileset dir="framework/dist/web"/>
Modified: incubator/lcf/trunk/framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/build.xml?rev=1161684&r1=1161683&r2=1161684&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/build.xml (original)
+++ incubator/lcf/trunk/framework/build.xml Thu Aug 25 18:40:56 2011
@@ -385,8 +385,8 @@
</target>
<target name="script-engine" depends="jar-script-engine,jar-core">
- <mkdir dir="dist/script-engine/lib"/>
- <copy todir="dist/script-engine/lib">
+ <mkdir dir="dist/script-engine/jar"/>
+ <copy todir="dist/script-engine/jar">
<fileset dir="lib">
<include name="commons-codec*.jar"/>
<include name="commons-collections*.jar"/>
@@ -396,12 +396,15 @@
<include name="json.jar"/>
</fileset>
</copy>
- <copy todir="dist/script-engine/lib">
+ <copy todir="dist/script-engine/jar">
<fileset dir="build/jar">
<include name="mcf-core.jar"/>
<include name="mcf-script-engine.jar"/>
</fileset>
</copy>
+ <copy todir="dist/script-engine/script">
+ <fileset dir="engine-scripts"/>
+ </copy>
</target>
<target name="example" depends="war-crawler-ui,war-api-service,war-authority-service,jar-jetty-runner,jar-core,jar-agents,jar-pull-agent">
Added: incubator/lcf/trunk/framework/engine-scripts/run-script.bat
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/engine-scripts/run-script.bat?rev=1161684&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/engine-scripts/run-script.bat (added)
+++ incubator/lcf/trunk/framework/engine-scripts/run-script.bat Thu Aug 25 18:40:56 2011
@@ -0,0 +1,35 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements. See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem check that JAVA_HOME is set
+if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+if not exist "%MCF_HOME%\script-engine\jar" goto nolcfhome
+rem save existing path here
+set OLDDIR=%CD%
+cd "%MCF_HOME%\script-engine"
+set CLASSPATH=.
+for %%f in (jar/*) do call script\setclasspath.bat %%f
+rem restore old path here
+cd "%OLDDIR%"
+"%JAVA_HOME%\bin\java" -classpath "%CLASSPATH%" org.apache.manifoldcf.scriptengine.ScriptParser %*
+goto done
+:nojavahome
+echo Environment variable JAVA_HOME is not set properly.
+goto done
+:nolcfhome
+echo Environment variable MCF_HOME is not set properly.
+goto done
+:done
Propchange: incubator/lcf/trunk/framework/engine-scripts/run-script.bat
------------------------------------------------------------------------------
svn:eol-style = CRLF
Added: incubator/lcf/trunk/framework/engine-scripts/run-script.sh
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/engine-scripts/run-script.sh?rev=1161684&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/engine-scripts/run-script.sh (added)
+++ incubator/lcf/trunk/framework/engine-scripts/run-script.sh Thu Aug 25 18:40:56 2011
@@ -0,0 +1,49 @@
+#!/bin/bash -e
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [[ $OSTYPE == "cygwin" ]] ; then
+ PATHSEP=";"
+else
+ PATHSEP=":"
+fi
+
+#Make sure environment variables are properly set
+if [ -e "$JAVA_HOME"/bin/java ] ; then
+ if [ -e "$MCF_HOME"/script-engine/jar ] ; then
+
+ # Build the classpath
+ CLASSPATH=""
+ for filename in $(ls -1 "$MCF_HOME"/script-engine/jar) ; do
+ if [ -n "$CLASSPATH" ] ; then
+ CLASSPATH="$CLASSPATH""$PATHSEP""$MCF_HOME"/script-engine/jar/"$filename"
+ else
+ CLASSPATH="$MCF_HOME"/script-engine/jar/"$filename"
+ fi
+ done
+
+ "$JAVA_HOME/bin/java" -cp "$CLASSPATH" org.apache.manifoldcf.scriptengine.ScriptParser "$@"
+ exit $?
+
+ else
+ echo "Environment variable MCF_HOME is not properly set." 1>&2
+ exit 1
+ fi
+
+else
+ echo "Environment variable JAVA_HOME is not properly set." 1>&2
+ exit 1
+fi
Propchange: incubator/lcf/trunk/framework/engine-scripts/run-script.sh
------------------------------------------------------------------------------
svn:eol-style = LF
Added: incubator/lcf/trunk/framework/engine-scripts/setclasspath.bat
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/engine-scripts/setclasspath.bat?rev=1161684&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/engine-scripts/setclasspath.bat (added)
+++ incubator/lcf/trunk/framework/engine-scripts/setclasspath.bat Thu Aug 25 18:40:56 2011
@@ -0,0 +1,16 @@
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements. See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+set CLASSPATH=%CLASSPATH%;%MCF_HOME%\script-engine\jar\%1
Propchange: incubator/lcf/trunk/framework/engine-scripts/setclasspath.bat
------------------------------------------------------------------------------
svn:eol-style = CRLF
Modified: incubator/lcf/trunk/site/src/documentation/content/xdocs/included-connectors.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/content/xdocs/included-connectors.xml?rev=1161684&r1=1161683&r2=1161684&view=diff
==============================================================================
--- incubator/lcf/trunk/site/src/documentation/content/xdocs/included-connectors.xml (original)
+++ incubator/lcf/trunk/site/src/documentation/content/xdocs/included-connectors.xml Thu Aug 25 18:40:56 2011
@@ -41,6 +41,7 @@
<tr><td>RSS</td><td> Pure Java </td><td> N/A </td><td> N/A </td><td>Atom, RSS 2.0, others </td></tr>
<tr><td>Web</td><td> Pure Java </td><td>N/A</td><td> N/A </td><td>HTML Version 1.0, 1.1, 2.0, Atom, RSS 2.0, others </td></tr>
<tr><td>LiveLink (OpenText)</td><td> Pure Java </td><td> Win </td><td> LAPI 9.7.1 </td><td> Tested with 9.2.0 - 9.7.1 </td></tr>
+ <tr><td>Open Search Server</td><td> Pure Java </td><td> N/A</td><td> Unknown </td><td> Unknown </td></tr>
<tr><td>Documentum (EMC)</td><td> Win, RedHat </td><td> Win, RedHat </td><td> Tested with DFC 5.3 SP5 </td><td> Tested against 5.3, 6.0, and 6.5 servers </td></tr>
<tr><td>SharePoint (MSFT)</td><td>Pure Java </td><td>Win</td><td> N/A </td><td> Tested with SharePoint 2003 (2.0), 2007 (3.0) </td></tr>
<tr><td>Meridio (Autonomy)</td><td> Pure Java </td><td> Win </td><td> N/A </td><td> Tested with Meridio 4.1, 5.0 </td></tr>
Added: incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml?rev=1161684&view=auto
==============================================================================
--- incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml (added)
+++ incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml Thu Aug 25 18:40:56 2011
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
+ "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<document>
+
+ <header>
+ <title>ManifoldCF Scripting Language</title>
+ </header>
+
+ <body>
+ <section>
+ <title>Overview</title>
+ <p></p>
+ <p>The ManifoldCF scripting language allows symbolic communication with the ManifoldCF API Service
+ in order to define connections and jobs, and perform crawls. The language provides support for JSON-like hierarchical
+ documents, as well as the ability to construct properly encoded REST URLs. It also has support for simple control flow
+ and error handling.</p>
+ </section>
+
+ <section>
+ <title>How to use the script interpreter</title>
+ <p></p>
+ <p>The ManifoldCF script interpreter can be used in two ways - either as a real-time shell (executing a script as it is typed),
+ or interpreting a script file. The main class of the interpreter is <em>org.apache.manifoldcf.scriptengine.ScriptParser</em>,
+ and the two ways of invoking it are:</p>
+ <source>
+java -cp ... org.apache.manifoldcf.scriptengine.ScriptParser
+ </source>
+ <p>or:</p>
+ <source>
+java -cp ... org.apache.manifoldcf.scriptengine.ScriptParser <script_file> <arg1> ... <argN>
+ </source>
+ <p>If you choose to invoke ScriptParser in interactive mode, simply type your script one line at a time. Any errors will be reported immediately,
+ and the ScriptParser will accordingly exit. You can also type ^Z to terminate the script.</p>
+ <p>If you use ScriptParser with a scripting file, that file will be read and interpreted. The arguments you provide will be loaded into an array
+ of strings, which is accessible from your script as the variable named <em>__args__</em>.</p>
+ <section>
+ <title>Running the scripting language by hand</title>
+ <p></p>
+ <p>When you build ManifoldCF, the required dependent jars for the scripting language are copied to <em>dist/script-engine/jar</em>.
+ You can run the interpreter in interactive mode by typing:</p>
+ <source>
+cd dist
+script-engine\script\run-script.bat <args>
+ </source>
+ <p>Or, on Linux:</p>
+ <source>
+cd dist
+script-engine/script/run-script.sh <args>
+ </source>
+ </section>
+ <section>
+ <title>Running the scripting language using Ant</title>
+ <p></p>
+ <p>You can also start the scripting language interpreter with all the correct required jars using Ant. Simple type the following:</p>
+ <source>
+cd framework
+ant run-script-engine
+ </source>
+ <p>This will start the scripting language interpreter in interactive mode only.</p>
+ </section>
+ <section>
+ <title>Running the scripting language using Maven</title>
+ <p></p>
+ <p>You can also run the scripting language interpreter using maven. The commands are:</p>
+ <source>
+cd framework/script-engine
+mvn exec:exec
+ </source>
+ <p>This, once again, will start the interpreter in interactive mode.</p>
+ </section>
+ </section>
+
+ </body>
+
+</document>
Propchange: incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/trunk/site/src/documentation/content/xdocs/script.xml
------------------------------------------------------------------------------
svn:keywords = Id
Modified: incubator/lcf/trunk/site/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/content/xdocs/site.xml?rev=1161684&r1=1161683&r2=1161684&view=diff
==============================================================================
--- incubator/lcf/trunk/site/src/documentation/content/xdocs/site.xml (original)
+++ incubator/lcf/trunk/site/src/documentation/content/xdocs/site.xml Thu Aug 25 18:40:56 2011
@@ -33,6 +33,7 @@
<dev label="API Documentation" href="programmatic-operation.html"/>
<dev label="Javadoc" href="javadoc.html"/>
<dev label="Building and Deploying" href="how-to-build-and-deploy.html"/>
+ <dev label="Scripting Language" href="script.html"/>
<dev label="End-user Documentation (HTML)" href="end-user-documentation.html"/>
<dev label="End-user Documentation (PDF)" href="end-user-documentation.pdf"/>
</docs>