public String print(String strBlank) {
// Pre-process template to translate it in case it is necessary
if (!ignoreTranslation && xmlTemplate != null && xmlTemplate.strName != null) {
if (log4jXmlDocument.isDebugEnabled())
log4jXmlDocument.debug("Start of print of: " + xmlTemplate.strName);
final TranslationHandler handler = new TranslationHandler(
this.xmlTemplate.xmlEngine.connProvider, this);
String baseDirectory = xmlTemplate.strName.substring(0, xmlTemplate.strName.lastIndexOf("/"))
.replace("designorg/", "/org/");
String templateFileName = xmlTemplate.configuration.strTemplate;
String absoluteTemplateFile = baseDirectory + "/" + templateFileName;
handler.setFileName(absoluteTemplateFile);
log4jXmlDocument.debug("print() - xmlTemplate.xmlEngine.fileBaseLocation: "
+ xmlTemplate.xmlEngine.fileBaseLocation);
if (hasParameterValue != null && !hasParameterValue.isEmpty()) {
// check marker-parameter: is the template is a (generated) window?
if (hasParameterValue.get("isGeneratedWindow") != null) {
if (hasParameterValue.get("tabId") != null
&& hasParameterValue.get("tabId").strValue != null) {
log4jXmlDocument.debug("print(strBlank) - tabId: "
+ hasParameterValue.get("tabId").strValue);
handler.setTabId(hasParameterValue.get("tabId").strValue);
handler.setXmlDocumentType(TranslationHandler.ADWINDOW);
} else {
log4jXmlDocument.error("Generated window with templateFile: "
+ xmlTemplate.fileConfiguration
+ " has no tabId parameter; no translation will be done.");
}
}
if (hasParameterValue.get("processId") != null
&& hasParameterValue.get("processId").strValue != null
&& !hasParameterValue.get("processId").strValue.equals("")) {
log4jXmlDocument.debug("ProcessId: " + hasParameterValue.get("processId").strValue);
handler.setXmlDocumentType(TranslationHandler.PROCESS);
handler.setXmlDocumentTypeId(hasParameterValue.get("processId").strValue);
}
handler.setLanguage(xmlTemplate.xmlEngine.sessionLanguage);
log4jXmlDocument.debug("before running generateTranslations.");
handler.generateTranslations();
if (!ignoreTranslation && handler.getFormLabels() != null
&& !handler.getFormLabels().isEmpty()) {
xmlVectorValue.setTextMap(handler.getFormLabels());
}
if (xmlVectorValue != null)
xmlVectorValue.handler = handler;
} else {
log4jXmlDocument.debug("print(String strBlank) - properties file not found");