- 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
Secure file handling with JAVA
For reading EWU (External Editing Work Unit) files and creating ERU (External Editing Response Unit) files there are the vendor-specific libraries.
Each vendor gets his own library for his Trusted Across Integration Solution which contains the secret encryption keys for reading and writing the files.
Across Java vendor library is based on Java-COM bridge library named Jacob. So it requires also Across COM component for vendors.
Distribution
The distribution package contains Across Java vendor library and Jacob library components: across.vendor-bin
In addition you will receive your individual C# vendor assembly.
Installation
- To install the Across Java vendor library, do the following:
- Unzip the archive content to a folder.
- Register the Across COM component for vendors for x86 or x64.
The mode depends on the Java VM version installed. - As the assemblies are .NET assemblies, make sure .NET 4.5.1 is installed.
- For registering useC:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe (instead of regsvr) with parameter /codebase.
For instance:
>C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe Across.ExternalProcessing.Congree.VendorName.dll /codebase
- Ignore the warning RegAsm : warning RA0000 returned by the RegAsm.exe tool.
Parameters and Usage
Add the following parameters to Java virtual machine:
Parameter | Description |
-classpath | add path to across.vendor.jar and jacob.jar to the classpath |
-Djava.library.path | add path to the folder with jacob*.dll files |
-Dcom.jacob.autogc=true | strongly recommended to set the parameter up to avoid high memory consumption |
Usage
import java.util.Date;import across.externalprocessing.vendor.AcrossInputStream;import across.externalprocessing.vendor.AcrossOutputStream;publicclass RunAcross {public RunAcross(){}/*** Runs the Across connect sample.*@param args 2 parameters are required:*0- name of the input file.*1- name of the output file. */publicstaticvoid main(String[] args){// Create Across input stream. AcrossInputStream in =new AcrossInputStream(args[0]);// Create Across output stream. AcrossOutputStream out =new AcrossOutputStream(args[1]);int count =0;try{// 4k buffer is minimal recommended buffer size.// Small buffer can lead to performance issues.byte[] buffer =newbyte[8192];// Read data from the input stream.int n =-1;while((n = in.read(buffer,0, buffer.length))!=-1){// Increase total read count. count += n;// Write data to the output stream. out.write(buffer,0, n);}}catch(Exception e){ e.printStackTrace(System.out);}finally{try{// Close streams. in.close(); out.close();}catch(Exception ex){ ex.printStackTrace(System.out);}}// Print results.System.out.println(String.format("The %d bytes were read from the stream", count));// Read line to pause before exit.System.console().readLine();}}