Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Updating of allocations

During the translation action, the system creates a new object for the selected language context by duplicating the source and changing some properties automatically:

  • the language will be the target language

  • if the object to be translated is linked to other object instances via the attribution concept (child, childmulti) and these objects are also translatable, the system will automatically retrieve equivalent translations to update the property


Warning
titleCaution

If no matching object is found in the desired context, the property will be empty. This implies that if the property is required by its structure configuration, an error will be removed and the translation action canceled. (see article on standard errors).


Warning
titleCaution

We don’t do a cascade translation: if you want this kind of behaviour you need to customize it.



Manually configure a property during translation

You can manually overload a property during translation.

Indeed, creating a translation using the WmsUtils module, we pass in parameter a java.util.HashMap with the values that will be object as well as a java.util.HashSet of the objects in the new object collection not to be duplicated (e.g. paragraphs).

The translation action is datatranslate. When creating a translation, we call the following JSPs:

/bov3/datatranslate/initNotCopiedObjects.jsp

initializes the java.util.HashSet objects not to be copied in cascade.
You can customize this JSP in your SAN this way:

Code Block
<%@page pageEncoding="ISO-8859-15"%>
<%@taglib prefix="noheto" uri="/WEB-INF/noheto.tld" %>
<%@taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%--
/san/bov3/datatranslate/initNotCopiedObjects.jsp
--%>
<%
java.util.Set notCopiedObjects = (java.util.HashSet) request.getAttribute("notCopiedObjects");
if (notCopiedObjects == null) {
notCopiedObjects = new java.util.HashSet();
}
/*
 collections of' frontlink' type objects are not duplicated during translation;
*/
notCopiedObjects.add("frontlink");
/*
 we do not duplicate the collections of paragraph objects when translating;
*/
notCopiedObjects.add("paragraph");

request.setAttribute("notCopiedObjects", notCopiedObjects);
%>


/bov3/datatranslate/initForcedValues.jsp

initializes the java.HashMap utility and iter on each object’s properties to overload them when copying.
You can customize a field in two ways:

  • if you specify the name or position of the property as a key: you will overload the property globally, i.e. it will be applied regardless of the nature of the object.

  • if you specify as key[object name].property name or index: you will overload the property in a fine way, i.e. it will be applied only for the nature of the specified object.

Example


Code Block
<%@page pageEncoding="ISO-8859-15"%>
<%@taglib prefix="noheto" uri="/WEB-INF/noheto.tld" %>
<%@taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%--
/san/bov3/datatranslate/initForcedValues.jsp
--%>
<%
java.util.Map forcedValues = (java.util.Map) request.getAttribute("forcedValues");
if (forcedValues == null) {
forcedValues = new java.util.HashMap();
}
/*
During a translation, we always want to empty the product's capacity so that
the user re-enters the contance in Onces (Oz) or Millilitres (ml) of the product.
*/
if (!forcedValues.containsKey("capacity")) {
forcedValues.put("capacity", "");
}
request.setAttribute("forcedValues", forcedValues);
%>

You can also customize properties by fields by overloading properties in this way:

  • [objects/[object_name]]/bov3/datatranslate/forcedvalues/properties/[property native type]/[nature]/[property name].jsp

  • [objects/[object_name]]/bov3/datatranslate/forcedvalues/properties/[property name].jsp

  • [objects/[object_name]]/bov3/datatranslate/forcedvalues/properties/[property native type]/[property type].jsp

Within these JSPs, you can work with the following variables:

form_object

nature of the current object in translation short

activeRefererObject

reference object under translation

itemValue

CTObjectField corresponding to the current property

colfield

name of the current property

nature

nature of the object pointed out in the context of an attribution relationship

forcedValues

java.util.HashMap properties to force properties to force

...