• Show convenient version of this site
  • Deutsch
  • English
Contact
Newsletter
  • Products
    • ALS
      • Across Language Server
        • Translation Management
        • Terminology Management
        • Translation Memory
      • Editions
      • Interfaces
    • ATE
      • Across Translator Edition
      • Editions
      • Download
      • Across Account
    • Elanion
      • Overview
      • Login
  • Solutions
    • Customers
      • Enterprises
      • Language Service Providers
      • Translators
    • Industries
      • E-Commerce & Trade
      • Pharmaceuticals & medicine
      • IT & Software
    • Departments
      • Marketing & E-Commerce
      • Technical Documentation
      • Software User Interfaces
  • Services
    • Hosting
    • Training
    • Consulting
  • Partners
    • Language Service Providers
    • Universities
  • Company
    • Across Systems
    • News
    • Events
    • Career
    • Contact
  • Knowledge
    • Blog
    • Video Library
    • Case Studies
    • White Papers
    • Fact Sheets
    • File Formats
    • Expert Features
  • Support
    • New Functions
    • Online Help
    • FAQ
    • Support Request
    • Updates
Schedule Consultation
  • Online-Help
  • SDK
  • APIs
  • crossTerm API v1
  • crossTerm API with JavaScript
  • General Information
    • Connectors
    • LCIDs
    • GUIDs
    • Paragraph states and flags
    • crossTerm Web
    • crossTransform
      • crossTransform - examples
  • Connecting Third-party Systems
    • crossConnect for content systems
      • Requirements
      • Configuration
        • Configuring the connector
        • Job configuration
        • Testing crossConnect
      • Troubleshooting
    • crossConnect for External Editing
      • Purpose and usage
        • Use case - Machine translation
        • Use Case - Review and QA
        • Use case - Machine review
      • Requirements
      • Implementation
        • Across XLIFF format
          • Across-specific Extensions
          • <xliff> Element Attributes
          • <file> Element Extensions
          • <trans-unit> Element Extension
          • Paragraph States
          • Paragraph State Flags
          • <source> and <target> Element Content
          • <bpt> Element Attributes
          • <ph> Element Attributes
          • <x> Element Attributes
          • Across-specific Properties
          • Analysis Results
          • Sample Files
          • Across XLIFF - import, export and segmentation
          • Context information
          • Exporting best matches in Across XLIFF
          • Hyperlinks to XLIFF
        • Secure file handling with C#
        • Secure file handling with JAVA
        • Workflow and vendor configuration
          • Adding workflows to crossAutomate Host Manager
          • Adjusting preset watchfolders
          • The filter rules
          • External editing workflows
        • Sample code - Integrated solution
    • Generic File Connector
      • Process Overview
      • Exchange Folder Structure
      • Package Format
        • Control File
  • Display Texts
    • Solution approaches
    • The Across solution in detail
    • Requirements
    • Integration
    • The display text format
      • Line height vs. line spacing
      • DT-XML format structure
        • DT-XML - Main elements
        • Children of paragraphStyles and characterStyles
        • Children of the sizeInfos element
        • Children of the paragraph element
        • DT-XML v5 example
        • DT-XML v4 example
    • The display text package
      • Creating a display text package
  • APIs
    • APIs - Technology
    • crossTank API v1
      • Requirements
      • Testing the crossTank API installation
      • OData-URLs in Chrome
      • Example
    • crossTank API v2
      • Requirements
      • QuickStart
        • Searching for Translations
        • Creating Translations
      • crossTank API v2 Overview
        • Finding Translations
        • Creating Translations
        • Translation Properties
        • Formatting and Auto-Adjustment of Formatting and Numbers
      • C# Example
    • crossTerm API v1
      • Scenarios of use
        • Example - usage information
        • Example - finding terms
      • Requirements
      • Special Controllers
      • OData-URLs in Chrome
      • crossTerm API with C#
      • crossTerm API with Java
      • crossTerm API with JavaScript
    • crossTerm API v2
      • Requirements
      • QuickStart
        • Authentication Basics
        • First Request Examples
      • crossTerm API v2 Example in C#
        • Used Functions
      • crossTank API, crossTerm API v2 - Authentication
      • crossTerm API v2 - Examples of Use
        • Finding Terms of Entry
        • Searching Terminology via API
    • crossAPI SI
      • Requirements
      • Function Return Types
      • crossAPI SI and Java
        • Example: hot integration
        • Executing the hot integration example
      • List of Objects in crossAPI SI
        • AssignManager
        • Authorization
        • CheckInManager
        • CheckOutManager
        • CrossTankManager
        • CrossTermManager
        • DocumentManager
        • FileManager
        • LanguageJobManager
        • LanguageManager
        • LicenseManager
        • Message
        • ObjectManager - Overview
          • Part 1
          • Part 2
          • Part 3
        • ReportManager
          • ID values for analysis and analysis-result
        • ProjectManager - Overview
          • Part 1
          • Part 2
          • Attribute Information
        • SqlQuery
        • SystemManager
        • TaskManager
        • WanGridManager - Overview
          • Part 1
          • Part 2
      • Sample - transferring checkout files via FileManager
      • Sample - VBS
    • Text Preprocessing API
      • Introduction
      • How to browse the API
      • Sentence splitting
      • Abbreviations

crossTerm API with JavaScript

This section explains the main points of a simple search engine by way of a sample application written in HTML and JavaScript. The application uses wildcard search to find terms in crossTerm, and illustrates the usage of the $select and $expand parameters for search and querying.

If you want to reproduce this example, you can download and extract the ZIP file.

crossTermApi_JavaScript_crossTerm_Explorer

Configuration and start

  • Copy the extracted file into the Examples folder to the crossTerm API root directory (according to the installation instructions, this is C:\Program Files\across\AcrossServices\crossTerm).
  • Open the example in a browser.

URL for default installations: http://localhost/Across/CrossTerm/Examples/JS/crossTermApiExample.html

Change the crossTerm API URL to http://localhost/Across/CrossTerm/ for a default installation.

Using the crossTerm Explorer

Tip

It is assumed that your crossTerm database is not empty. You can check this with crossTerm Web or crossTerm Manager.

Search with wildcard

Search with one or more wildcards . By default, the result contains terms with all fields.

cTe_API_wildcardSuche

Results with selected fields

Select read only following fields to reduce the search results to this information.

cTa_API_suche

Term details

Click one of the term links to see term details. By default, only term fields are loaded.

cTe_API_termDetails

Expand the result information

Select items below Expand fields to read nested objects which are directly or indirectly linked with the selected term (term properties, entry, entry properties, etc.).

cTe_API_ergebnisseErweitern

Used API functions

The search form uses the WildcardSearch API function. Its parameter is a JSON structure, where query text (with or without a wildcard), source and target languages, and stemming flag are defined.

Tip

Requirements: Content-Type header should be set to application/json, HTTP method should be POST.

Optional $select parameter allows to define specific result fields. Optional $expand parameter allows to fetch nested objects (Entry and Properties, if function result is Term, for example).

var query ={
                Query : $("#query").val(),
                Parameters:{  
                    SourceLanguage : $("#query_lang").val(),
                    TargetLanguage :0,
                    UseStemming :false}};
             $.ajax({
                    type:"POST",
                    url: baseUrl +"Terms/WildcardSearch?"+ selector,
                    contentType :"application/json",
                    data :"{query: "+ JSON.stringify( query )+" }"})
cTe_API_functions_beispiel1
{"odata.metadata":"http://localhost/Across.Services.CrossTerm/odata/v1/$metadata#Terms","value":[{"Id":570,"Text":"advert","Lcid":1033,"State":"Unreleased","Created":"2013-11-25T15:05:28+07:00","Creator":"Default Supervisor","Modified":"2013-11-25T15:05:28+07:00","Modifier":"Default Supervisor","EntryId":157},{"Id":572,"Text":"advertisement","Lcid":1033,"State":"Unreleased","Created":"2013-11-25T15:05:28+07:00","Creator":"Default Supervisor","Modified":"2013-11-25T15:05:28+07:00","Modifier":"Default Supervisor","EntryId":157},{"Id":571,"Text":"advice","Lcid":1033,"State":"Unreleased","Created":"2013-11-25T15:05:28+07:00","Creator":"Default Supervisor","Modified":"2013-11-25T15:05:28+07:00","Modifier":"Default Supervisor","EntryId":157}]}

Search result (query with $select parameter: $select=Text,Id,EntryId,State):

{"odata.metadata":
 "http://localhost/Across.Services.CrossTerm/odata/v1/$metadata#Terms&$select=Text,
 Id,EntryId,State","value":[{"Text":"advert","Id":570,"EntryId":157,"State":"Unreleased"},{"Text":"advertisement","Id":572,"EntryId":157,"State":"Unreleased"},{"Text":"advice","Id":571,"EntryId":157,"State":"Unreleased"}]}

Term details view uses Terms entity set with term ID as a parameter.

Tip

$select and $expand parameters are also applicable.

$.ajax({
        url: baseUrl +"Terms("+ termId +")?"+ expand,
        contentType :"application/json"})
cTe_API_functions_beispiel2

Result (query without a $expand parameter):

{"odata.metadata":"http://localhost/Across.Services.CrossTerm/odata/v1/$metadata#Terms/@Element","Id":572,"Text":"advertisement","Lcid":1033,"State":"Unreleased","Created":"2013-11-25T15:05:28+07:00","Creator":"Default Supervisor","Modified":"2013-11-25T15:05:28+07:00","Modifier":"Default Supervisor","EntryId":157}

Result (query with a $expand parameter: $expand=Entry/Instance,Entry):

{"odata.metadata":"http://localhost/Across.Services.CrossTerm/odata/v1/$metadata#Terms/@Element","Entry":{"Instance":{"Id":1,"Name":"Default across Server","Description":"","ServerId":"5d5c79c6-2a09-4be5-a1ab-9a7fd24da123"},"Id":157,"InstanceId":1,"Created":"2013-11-25T15:05:28+07:00","Creator":"Default Supervisor","Modified":"2013-11-25T15:05:28+07:00","Modifier":"Default Supervisor"},"Id":572,"Text":"advertisement","Lcid":1033,"State":"Unreleased","Created":"2013-11-25T15:05:28+07:00","Creator":"Default Supervisor","Modified":"2013-11-25T15:05:28+07:00","Modifier":"Default Supervisor","EntryId":157}
Register for our Newsletter now

Our newsletter provides you with exclusive news about the Across Language Server, often even before the official announcement. The newsletter also provides you with early information on events, webinars, and training sessions.

  • Legal Notice
  • GTC
  • Privacy Statement
  • Cookies
  • info@across.net