<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed Materials - Property of IBM

     IBM SPSS Products: Text Analytics

     (C) Copyright IBM Corp. 2003, 2011

     US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
     Schedule Contract with IBM Corp.  -->
<Extension version="1.0" debug="false">
  <ExtensionDetails id="text_mining_translate" label="Text Mining Translate" version="1.0"
    providerTag="SPSS Inc." copyright="(c) 2006 SPSS Inc." description="SPSS Translate Node"/>
  <Resources>
    <HelpInfo id="help" type="native" path="/com.ibm.spss.ta.help/"/>
    <Bundle id="translations.translate" type="properties" path="messages"/>
    <SharedLibrary id="TMWBTranslate" path="spss.TMWBServer/bin/Translator"/>    
	<JarFile id="stas" path="../spss.TMWBClient/stas.jar"/>
	<JarFile id="tmwb" path="../spss.TMWBClient/lib/tmwb.jar"/>

	<JarFile id="Translator" path="../spss.TMWBClient/Translator.jar"/>
  <JarFile id="TableLayout-bin-jdk1.5-2009-08-26" path="../spss.TMWBClient/lib/TableLayout-bin-jdk1.5-2009-08-26.jar"/>

  </Resources>
  <Node id="translate" type="dataTransformer" customPalette="text_mining" relativePosition="after"
    relativeTo="textlinkanalysis" label="Translate" labelKey="translatenode.LABEL"
    helpLink="textmining/tmfc/tmfc_translate_intro.htm"
    description="Translates text data into another language for text mining"
    descriptionKey="translatenode_tooltip.LABEL">
    <Properties>
      <!-- =========== Fields Tab Property  =========== -->
      <Property name="text" valueType="string"/>
      <Property name="method" valueType="enum">
        <Enumeration>
          <Enum value="ReadText" label="Actual text" labelKey="method.ReadText.LABEL"/>
          <Enum value="ReadPath" label="Pathnames to documents" labelKey="method.ReadPath.LABEL"/>
        </Enumeration>
      </Property>
      <!-- Encoding -->
      <Property name="encoding" valueType="enum">
        <Enumeration>
          <!-- Empty string means automatic encoding -->
          <Enum value="" label="Automatic" labelKey="encoding.automatic.LABEL"/>
          <Enum value="utf8" label="UTF-8" labelKey="encoding.utf8.LABEL"/>
          <Enum value="utf16" label="UTF-16" labelKey="encoding.utf16.LABEL"/>
          <Enum value="ISO8859-1" label="ISO-8859-1" labelKey="encoding.iso8859.LABEL"/>
          <Enum value="US-ascii" label="US ascii" labelKey="encoding.ascii.LABEL"/>
          <Enum value="CP850" label="CP850" labelKey="encoding.cp850.LABEL"/>
          <!--Latin1 encoding-->
          <Enum value="Latin1" label="Latin1" labelKey="encoding.Latin1.LABEL"/>
          <!--Chinese encoding-->
          <Enum value="Big5" label="Big5" labelKey="encoding.Big5.LABEL"/>
          <Enum value="Big5-HKSCS" label="Big5-HKSCS" labelKey="encoding.Big5-HKSCS.LABEL"/>
          <Enum value="GB18030" label="GB18030" labelKey="encoding.GB18030.LABEL"/>
          <Enum value="GB2312" label="GB2312" labelKey="encoding.GB2312.LABEL"/>
          <Enum value="GBK" label="GBK" labelKey="encoding.GBK.LABEL"/>
          <!--Japanese encoding-->
          <Enum value="eucJP" label="eucJP" labelKey="encoding.eucJP.LABEL"/>
          <Enum value="JIS7" label="JIS7" labelKey="encoding.JIS7.LABEL"/>
          <Enum value="Shift-JIS" label="Shift-JIS" labelKey="encoding.Shift-JIS.LABEL"/>
          <!--Korean-->
          <Enum value="eucKR" label="eucKR" labelKey="encoding.eucKR.LABEL"/>
          <!--Tamil encoding-->
          <Enum value="TSCII" label="TSCII" labelKey="encoding.TSCII.LABEL"/>
          <!--Unicode, 16 bit encoding-->
          <Enum value="ucs2" label="ucs2" labelKey="encoding.ucs2.LABEL"/>
          <!--Russian encoding-->
          <Enum value="KOI8-R" label="KOI8-R" labelKey="encoding.KOI8-R.LABEL"/>
          <!--Ukrainian encoding-->
          <Enum value="KOI8-U" label="KOI8-U" labelKey="encoding.KOI8-U.LABEL"/>
          <!--Central European encoding-->
          <Enum value="ISO8859-2" label="ISO8859-2" labelKey="encoding.ISO8859-2.LABEL"/>
          <Enum value="ISO8859-3" label="ISO8859-3" labelKey="encoding.ISO8859-3.LABEL"/>
          <Enum value="CP1250" label="CP1250" labelKey="encoding.CP1250.LABEL"/>
          <!--Baltic encoding-->
          <Enum value="ISO8859-4" label="ISO8859-4" labelKey="encoding.ISO8859-4.LABEL"/>
          <Enum value="CP1257" label="CP1257" labelKey="encoding.CP1257.LABEL"/>
          <!--Cyrillic encoding-->
          <Enum value="ISO8859-5" label="ISO8859-5" labelKey="encoding.ISO8859-5.LABEL"/>
          <Enum value="CP1251" label="CP1251" labelKey="encoding.CP1251.LABEL"/>
          <!--Arabic encoding-->
          <Enum value="ISO8859-6" label="ISO8859-6" labelKey="encoding.ISO8859-6.LABEL"/>
          <Enum value="CP1256" label="CP1256" labelKey="encoding.CP1256.LABEL"/>
          <!--Greek encoding-->
          <Enum value="ISO8859-7" label="ISO8859-7" labelKey="encoding.ISO8859-7.LABEL"/>
          <Enum value="CP1253" label="CP1253" labelKey="encoding.CP1253.LABEL"/>
          <!--Hebrew, visually & logically ordered encoding-->
          <Enum value="ISO8859-8" label="ISO8859-8" labelKey="encoding.ISO8859-8.LABEL"/>
          <Enum value="ISO8859-8-i" label="ISO8859-8-i" labelKey="encoding.ISO8859-8-i.LABEL"/>
          <Enum value="CP1255" label="CP1255" labelKey="encoding.CP1255.LABEL"/>
          <!--Turkish encoding-->
          <Enum value="ISO8859-9" label="ISO8859-9" labelKey="encoding.ISO8859-9.LABEL"/>
          <Enum value="CP1254" label="CP1254" labelKey="encoding.CP1254.LABEL"/>
          <!--IS08859 encoding-->
          <Enum value="ISO8859-10" label="ISO8859-10" labelKey="encoding.ISO8859-10.LABEL"/>
          <Enum value="ISO8859-13" label="ISO8859-13" labelKey="encoding.ISO8859-13.LABEL"/>
          <Enum value="ISO8859-14" label="ISO8859-14" labelKey="encoding.ISO8859-14.LABEL"/>
          <!--Western encoding-->
          <Enum value="ISO8859-15" label="ISO8859-15" labelKey="encoding.ISO8859-15.LABEL"/>
          <Enum value="CP1252" label="CP1252" labelKey="encoding.CP1252.LABEL"/>
          <!--IBM encoding-->
          <Enum value="IBM 850" label="IBM 850" labelKey="encoding.IBM_850.LABEL"/>
          <Enum value="IBM 866" label="IBM 866" labelKey="encoding.IBM_866.LABEL"/>
          <!--Apple Roman encoding-->
          <Enum value="Apple Roman" label="Apple Roman" labelKey="encoding.Apple_Roman.LABEL"/>
          <!--Thai encoding-->
          <Enum value="TIS-620" label="TIS-620" labelKey="encoding.TIS-620.LABEL"/>
          <Enum value="CP874" label="CP874" labelKey="encoding.CP874.LABEL"/>
          <Enum value="CP1258" label="CP1258" labelKey="encoding.CP1258.LABEL"/>
        </Enumeration>
      </Property>
      <!-- =========== Language Tab Property =========== -->
      <!--Source language-->	  
      <Property name="translate_from_id" valueType="String"/>
      <Property name="translate_from" valueType="String"/>      
      <Property name="translate_to_id" valueType="String"/>
      <Property name="translate_to" valueType="String"/>
      <Property name="lpid" valueType="String"/>
      <Property name="lw_port" valueType="string"/>
      <Property name="lw_hostname" valueType="string"/>
      <Property name="lw_server_type" valueType="string"/>      
      <Property name="user_id" valueType="string"/>
	  <Property name="account_id" valueType="string"/>
      <Property name="url" valueType="string"/>
      <Property name="apiKey" valueType="encryptedString"/>
	  <Property name="touch_point_id" valueType="string"/>
	  <Property name="touch_point_name" valueType="string"/>	  
      <Property name="use_previous_translation" valueType="string"/>
      <Property name="translation_label" valueType="string"/>	

      <!-- =========== Field name localisation =========== -->    
      <Property name="translated_field_suffix" valueType="string" defaultValueKey="translatedFieldSuffix.LABEL" />
      <Property name="error_field_suffix"      valueType="string" defaultValueKey="errorFieldSuffix.LABEL" />  
    </Properties>	
    
    <!-- =========== User Interface Defenition =========== -->    
	<UserInterface>
      <Icons>
        <Icon type="smallNode" imagePath="sm_tmfc_translate.gif"/>
        <Icon type="standardNode" imagePath="lg_tmfc_translate.gif"/>
      </Icons>
      <Tabs>        
        <!-- =========== Language Tap UI definition =========== -->
        <Tab label="Translation" labelKey="newLangab.LABEL" helpLink="textmining/tmfc/tmfc_translate_translation.htm">
			<PropertiesPanel>
				<SingleFieldChooserControl property="text" label="Text field" labelKey="text_field.LABEL"/>
					<RadioButtonGroupControl property="method" label="Text field represents" rows="1" labelKey="text_field_represents.LABEL">
						<Layout gridColumn="0" gridWidth="2"/>
					</RadioButtonGroupControl>
					<ComboBoxControl property="encoding" label="Input encoding" labelKey="encoding.LABEL">
						<Enabled>
							<Condition control="method" op="equals" value="ReadPath"/>
						</Enabled>
					</ComboBoxControl>
				<ExtensionObjectPanel id="panel1" panelClass="com.spss.translator.ui.TranslationPanel"/>
			</PropertiesPanel>-->			
        </Tab>        
      </Tabs>
    </UserInterface>
    
    <!-- =========== Execution =========== -->
    <Execution>
      <Module libraryId="TMWBTranslate" name="TMTranslation">
        <StatusCodes>
          <StatusCode code="0" status="error" message="Initialization Error"  messageKey="initError.LABEL"/>
          <StatusCode code="1" status="error" message="Internal Error" messageKey="internalError.LABEL"/>
          <StatusCode code="2" status="error" message="Invalid Metadata" messageKey="invalidMetadataError.LABEL"/>
          <StatusCode code="3" status="error" message="Hostname Error" messageKey="hostnameError.LABEL"/>
          <StatusCode code="4" status="error" message="Port number Error" messageKey="portNumberError.LABEL"/>
          <StatusCode code="5" status="error" message="Invalid input field type" messageKey="invalidInputFieldTypeError.LABEL"/>
          <StatusCode code="6" status="error" message="Missing or invalid Text Analytics for IBM SPSS Modeler Premium license" messageKey="missingTMFCLicenseError.LABEL"/>
          <StatusCode code="7" status="error" 
            message="No valid license was found for the language selected in the node. This product must be licensed for each language you intend to use"
            messageKey="missingLanguageLicenseError.LABEL"/>
          <StatusCode code="8" status="error" message="No translation server selected in the node" messageKey="invalidTranslationServer.LABEL"/>
          <StatusCode code="10" status="success" message="Processed {0} rows" messageKey="processedNumberRows.LABEL"/>
          <StatusCode code="11" status="warning" message="No translation was presisted" messageKey="noTranslationPresisted.LABEL"/>
          <StatusCode code="12" status="warning" message="No translation was presisted since a label was not given" messageKey="noTranslationPresistedLabelNotGiven.LABEL"/>

	  <StatusCode code="13" status="error" message="Error requesting LPInfo"                    messageKey="ErrorRequestingLPInfo.LABEL"/>
          <StatusCode code="14" status="error" message="Error performing User request"              messageKey="ErrorPerformingUserRequest.LABEL"/>
          <StatusCode code="15" status="error" message="Error performing translation async request" messageKey="ErrorPerformingTranslationAsyncRequest.LABEL"/>
          <StatusCode code="16" status="error" message="General error"                              messageKey="GeneralError.LABEL"/>
          <StatusCode code="17" status="error" message="Unable to read source text from file"       messageKey="UnableReadingSourceText.LABEL"/>
          <StatusCode code="18" status="error" message="Unable to create LWAccess Object"           messageKey="UnableCreatingLWAccessObject.LABEL"/>
          <StatusCode code="19" status="error" message="No custom dictionary specified"             messageKey="NoCustomDictionarySpecified.LABEL"/>

        </StatusCodes>
      </Module>
    </Execution>
    
    <!-- =========== Data Model Definition =========== -->
    <!-- This tells Clementine that the node's output data model is based on the input data model  with some extra fields added -->
    <OutputDataModel mode="extend" method="sharedLibrary" libraryId="TMWBTranslate">
    </OutputDataModel>
  </Node>
</Extension>
