You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mb...@apache.org on 2007/05/10 18:42:22 UTC

svn commit: r536930 - in /incubator/uima/uimaj/trunk/uima-docbooks/src/docbook: references/ref.pear.xml tools/tools.pear.installer.xml

Author: mbaessler
Date: Thu May 10 09:42:20 2007
New Revision: 536930

URL: http://svn.apache.org/viewvc?view=rev&rev=536930
Log:
UIMA-351

update the UIMA reference and the UIMA tools documentation with the new
pearSpecifier resource. 

JIRA ticket https://issues.apache.org/jira/browse/UIMA-351

Modified:
    incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/references/ref.pear.xml
    incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/tools/tools.pear.installer.xml

Modified: incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/references/ref.pear.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/references/ref.pear.xml?view=diff&rev=536930&r1=536929&r2=536930
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/references/ref.pear.xml (original)
+++ incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/references/ref.pear.xml Thu May 10 09:42:20 2007
@@ -621,6 +621,8 @@
   // PEAR package component ID
   String mainComponentID = instPear
      	.getInstallationDescriptor().getMainComponentId();
+  // PEAR package pear descriptor
+  String pearDescPath = instPear.getComponentPearDescPath();
 
   // print out settings
   System.out.println("PEAR package class path: " + classpath);
@@ -629,9 +631,10 @@
    	+ mainComponentDescriptor);
   System.out.println("PEAR package mainComponentID: " 
    	+ mainComponentID);
+  System.out.println("PEAR package specifier path: " + pearDescPath); 	
 
   } catch (PackageInstallerException ex) {
-    // catch PackageInstallerException - pear installation failed
+    // catch PackageInstallerException - PEAR installation failed
     ex.printStackTrace();
     System.out.println("PEAR installation failed");
   } catch (IOException ex) {
@@ -640,9 +643,9 @@
   }</programlisting></para>
 	  
 	  <para>
-	    To run a PEAR package after it was installed using the PEAR API see the sample below. It use the UIMA classloader
-	    extension to set the classpath of the installed PEAR dynamically. For more details about the APIs please refer
-	    to the JavaDocs.
+	    To run a PEAR package after it was installed using the PEAR API see the example below. It use the 
+	    generated PEAR specifier that was automatically created during the PEAR installation. 
+	    For more details about the APIs please refer to the JavaDocs.
 	  
 
       <programlisting>File installDir = new File("/home/user/uimaApp/installedPears");
@@ -655,19 +658,12 @@
   PackageBrowser instPear = PackageInstaller.installPackage(
   	installDir, pearFile, doVerification);
 
-  // Create resouce manager and set PEAR package classpath
+  // Create a default resouce manager
   ResourceManager rsrcMgr = UIMAFramework.newDefaultResourceManager();
-  // Set PEAR package classpath and use it also to resolve resources
-  rsrcMgr.setExtensionClassPath(
-      	instPear.buildComponentClassPath(), true);
-  // Set PEAR package datapath 
-  if(instPear.getComponentDataPath() != null) {
-        rsrcMgr.setDataPath(instPear.getComponentDataPath());
-  }
-
-  // Create analysis engine from the installed PEAR package
-  XMLInputSource in = new XMLInputSource(instPear
-      	.getInstallationDescriptor().getMainComponentDesc());
+
+  // Create analysis engine from the installed PEAR package using
+  // the created PEAR specifier
+  XMLInputSource in = new XMLInputSource(instPear.getComponentPearDescPath());
   ResourceSpecifier specifier = UIMAFramework.getXMLParser()
       	.parseResourceSpecifier(in);
   AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(
@@ -686,6 +682,24 @@
    
     </section>
 
+  </section>
+  
+    <section id="ugr.ref.pear.specifier">
+    <title>PEAR package descriptor</title>
+    
+    <para>To run an installed PEAR package directly in the UIMA framework the <literal>pearSpecifier</literal> 
+    XML descriptor can be used. Typically during the PEAR installation such an specifier is automatically generated 
+    and contains all the necessary settings to run the installed PEAR package. The generated PEAR descriptor
+    is located in the component root directory of the installed PEAR package and has a filename like 
+    &lt;componentID&gt;_pear.xml.</para>
+    <para>The PEAR package descriptor looks like:</para>
+    <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<pearSpecifier xmlns="http://uima.apache.org/resourceSpecifier">
+   <pearPath>/home/user/uimaApp/installedPears/testpear</pearPath>
+</pearSpecifier>]]>
+    </programlisting>
+    <para>The <literal>pearPath</literal> setting in the descriptor must point to the component root directory 
+    of the installed PEAR package.</para>
   </section>
   
 </chapter>

Modified: incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/tools/tools.pear.installer.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/tools/tools.pear.installer.xml?view=diff&rev=536930&r1=536929&r2=536930
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/tools/tools.pear.installer.xml (original)
+++ incubator/uima/uimaj/trunk/uima-docbooks/src/docbook/tools/tools.pear.installer.xml Thu May 10 09:42:20 2007
@@ -73,13 +73,14 @@
     throws an exception, you can find more information about the problem in the uima.log file
     in the current working directory. The log file can be viewed with the CVD.</para>
   
-  <para>PEAR Installer creates a file named <literal>setenv.txt</literal> file in the
+  <para>PEAR Installer creates a file named <literal>setenv.txt</literal> in the
     <literal>&lt;component_root&gt;/metadata</literal> directory. This file contains
-    environment variables required to run your component in any UIMA application. For
-    instance, if you want to run your component in the Collection Processing Engine
-    Configurator GUI application, you need to add the environment variables settings from
-    the component&apos;s <literal>setenv.txt</literal> file to the <literal>cpeGui.bat
-    (cpeGui.sh)</literal> script file in the <literal>&lt;UIMA_HOME&gt;/bin</literal>
-    directory.</para>
+    environment variables required to run your component in any UIMA application. 
+    It also creates a PEAR descriptor (see also <olink targetdoc="&uima_docs_ref;"
+      targetptr="ugr.ref.pear.specifier"/>)
+    file named <literal>&lt;componentID&gt;_pear.xml</literal> 
+    in the <literal>&lt;component_root&gt;</literal> directory that can be used to directly run
+    the installed pear file in your application.
+    </para>
   
 </chapter>