TIF 2021.2.0 Release Information 2021-04-23
PDF Watermark and Images
In addition to text, PDF watermark functionality supports now also images.
An example job configuration:
<Job>
...
<FileModifier>
...
<PDFWatermark>
<Definition>
<ImageFileName>c:\images\myimage.png</ImageFileName>
<!-- X/Y are optional, placed in center of page by default. -->
<!--
<ImageStartX>10</ImageStartX>
<ImageStartY>20</ImageStartY>
-->
</Definition>
...
</PDFWatermark>
</FileModifier>
</Job>
Trigger Create/Update Integration via Job Events
There is a new job event handler <CreateUpdate>
that can be used to trigger a create/update integration.
The handler is applicable with outbound ENOVIA/3DEXPERIENCE jobs that receive a response payload from some destination. The response payload is used as input for the create/update integration.
An example configuration:
<Job>
...
<TransferData>
...
<Destinations>
<Http id="http-1" />
</Destinations>
</TransferData>
<Events>
<Success>
<!-- Uses response from destination http-1. -->
<CreateUpdate inputFrom="http-1" config="tvc:createconfig/MyIntegration.xml">
</Success>
</Events>
</Job>
The triggered create/update integration is executed in a separate job/service context that is visible in TIF Admin UI.
You may define the display name for the service by setting attribute displayName
in the create/update configuration.
Pass Input to New Job
<NewJob>
job event handler supports passing an input payload to new job.
This is applicable when both parent and new jobs are of type outbound ENOVIA/3DEXPERIENCE jobs, and the parent receives a response payload from some destination. In this case, the response payload can be used as input.
An example configuration:
<Job>
...
<TransferData>
...
<Destinations>
<Http id="http-1" />
</Destinations>
</TransferData>
<Events>
<Success>
<!-- Uses response from destination http-1. -->
<NewJob copyObjectId="true" usesInput="true" inputFrom="http-1" jobcfg="tvc:jobcfg/MyJob.xml" />
</Success>
</Events>
</Job>
When a job receives an input, it can be utilized in different ways. One option is to use <InputContent>
fraction in a payload configuration to include and/or transform the input:
<Payload>
<InputContent>
<Transformer xslt="tvc:xslt/MyTransformer.xslt"/>
</InputContent>
</Payload>
The input payload is also accessible by custom job executors and Java payload fractions.
Below is a custom job executor that reads the input with the help of com.technia.tif.enovia.payload.PayloadUtils
utility class.
package com.acme.tif.executor;
import com.technia.tif.core.ExtractionException;
import com.technia.tif.enovia.job.EnoviaJob;
import com.technia.tif.enovia.job.JobExecutor;
import com.technia.tif.enovia.payload.PayloadData;
import com.technia.tif.enovia.payload.PayloadUtils;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
public class MyJobExecutor implements JobExecutor {
@Override
public void perform(EnoviaJob job) throws ExtractionException {
PayloadData data = PayloadUtils.getInputPayload(job);
try (InputStream in = data.getInputStream()) {
// TODO: Do something with the input stream, e.g:
String string = IOUtils.toString(in, data.getEncoding());
} catch (IOException e) {
throw new ExtractionException(e);
}
}
}
Create/Update Integration
Support for External Files
The create/update integration now supports check-in of external files that can referenced in the payload by a file path or URL.
It is also possible to customize the external file handling by providing a custom file content provider
For example:
<CreateConfiguration>
<Config ...>
<ExternalFiles
nameSelect="@name"
formatFallback="generic"
pathSelect="@filePath"
...
/>
</Config>
</CreateConfiguration>
Read more here
CDM Document Processing
When processing files for a CDM (common document model) object, you can now configure what name you should base the version upon by specifying the attribute versionOf
.
The value can be a filename pattern containing * and ? to allow pattern matching.
This can be useful in case you don’t know exactly what the name of the file currently is, and you want the new file to appear as a new version to the existing file.
See example below:
<EmbeddedFiles>
<File cdm="true"
versionOf="*.*"
fileRefSelect="path/text()"
nameSelect="filename/text()"
formatFallback="generic" />
</EmbeddedFiles>
Job Cleanser Performance Improvement
The Job cleanser scheduled task and related DB queries have been optimized to improve the performance with large TIF databases.
ZIP File Encoding
TIF have relied on the Java libraries way of handling ZIP files. Problems have been discovered with this way vs how file names are encoded in some cases within the ZIP archives by certain ZIP tools.
TIF have change to use the IBM-437 charset as the default charset when decoding file names in a ZIP archive. TIF will continue to use the UTF-8 charset when creating ZIP archives. ZIP archives that contains UTF-8 encoded file names will still work fine, if the ZIP tool used to construct the ZIP archive correctly sets the EFS flag within the ZIP archive. If this condition is fulfilled, then it will switch to use UTF-8 automatically when decoding the file names regardless what have been configured in TIF.
There are two new properties available in the module.properties file to control this. The new default values should be working in most cases, but we allow to configure these in order to deal with the edge-cases.
These properties are defined as below
zip.read.fileNameCharset=cp437
zip.write.fileNameCharset=UTF-8
File Package - Transfer files one-by-one
The FilePackage
job that integrates the TVC File Manager with TIF is used to create ZIP packages with files and/or meta-data.
A flag have been added that allows transfering the files one-by-one to the configured destinations instead of transferring the ZIP as a whole.
Example config below:
<Job>
<FilePackage transferZIP="false">
<Content>
<Files dataSet="tvc:dataset/RefDocs.xml">
<FileFilter>
<Include>
<Format>format_generic</Format>
</Include>
</FileFilter>
</Files>
</Content>
<Destinations>
...
</Destinations>
</FilePackage>
</Job>
Http - Status Code Evaluation
The default behavior until now have been to only treat the HTTP status code 200 as success and any other code as failure.
As of this release, the default behavior is to treat any 2xx code as success code. This is a behavior change compared to earlier releases, but this change should not cause any compatibility problems since the specification says that a 2xx code indicates that the action requested by the client was received, understood, and accepted.
Http - Multipart Request
When transfering the payload to a destination, you can now configure the Http request to send the file as a multipart request.
<Job>
...
<Destinations>
<Http id="system-x" multiPart="true" />
</Destinations>
</Job>
Admin UI
Job Progress Log
If there is a progress log associated with a job, the Admin UI will display this in order to get better insight in what a job actually have performed.
The progress log feature is new as of this release and all jobs do not support this feature yet. This feature will be enhanced in future releases. |
JWT Authorization Tokens
The Admin UI now uses JSON Web Tokens (JWT) as format for the authorization header.
This change makes it possible to use the same authorization token without the need to issue a new token if the TIF server have been restarted. Per default, the JWT token is valid for 24h but can be configured.
Create Update Integration - XPath
The XSLT function current() that returns the current element, which is handy to use in some XPath constructs, is not present in the Saxon implementation (which is correct since it is not a strict XPath function), while available in the Java implementation.
TIF will now register a custom function that will allow you to use the current() function together with the Saxon XPath implementation seamlessly.
Create Update Integration - Interfaces
A new configuration element <Interface>
is available in context of <CreateValues>
.
The element can be used to add interfaces to business objects and connections. It also enables to define interface attributes on creation phase.
Example:
<Interface>
<Always use="interface_First" />
<If condition="@someAttribute = 'abc'">
<Use>interface_Second</Use>
<Use>interface_Third</Use>
</If>
<Unless condition="@otherAttribute = 'def'" use="interface_Fourth" />
</Interface>
Documentation
A tutorial illustrating how to utilize the create/update integration for import of file packages have been created.
See this page.
Fixed Bugs
Below is the list of fixed bugs as of this release.
Issue No | Description |
---|---|
781 |
Create/update integration processes relationship objects in wrong order |
782 |
Admin UI not working with reverse proxy |
787 |
Upgraded the Apache POI library to 5.0 in order to be able to run under Java 11. |
790 |
Expand error details button in Job view is not working |
804 |
Delete Jobs fails with 404 This is related to the Java version of the file-modifier that is used to set properties on Microsoft™ Office documents. |
795 |
Unable to use multiple CustomField’s within the Create / Update integration configuration. |