- General Information
- Connecting Third-party Systems
- crossConnect for content systems
- crossConnect for External Editing
- Purpose and usage
- 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
- Sample code - Integrated solution
- Across XLIFF format
- Generic File Connector
- Display Texts
- APIs
- APIs - Technology
- crossTank API v1
- crossTank API v2
- crossTerm API v1
- crossTerm API v2
- crossAPI SI
- Requirements
- Function Return Types
- crossAPI SI and Java
- List of Objects in crossAPI SI
- Sample - transferring checkout files via FileManager
- Sample - VBS
- Text Preprocessing API
crossTerm API with JavaScript
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.
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.
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 )+" }"})
{"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.
$select and $expand parameters are also applicable.
$.ajax({ url: baseUrl +"Terms("+ termId +")?"+ expand, contentType :"application/json"})
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}