Package org.openbravo.uiTranslation

Examples of org.openbravo.uiTranslation.TranslationHandler


    File reportFile = new File(reportName);

    InputStream reportInputStream = null;
    if (reportFile.exists()) {
      TranslationHandler handler = new TranslationHandler(conn);
      handler.prepareFile(reportName, language, reportFile, baseDesignPath);
      reportInputStream = handler.getInputStream();
    }
    JasperDesign jasperDesign;
    if (reportInputStream != null) {
      log4j.debug("Jasper report being created with inputStream.");
      jasperDesign = JRXmlLoader.load(reportInputStream);
View Full Code Here


  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");
View Full Code Here

TOP

Related Classes of org.openbravo.uiTranslation.TranslationHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.