Package com.debortoliwines.openerp.reporting.di

Examples of com.debortoliwines.openerp.reporting.di.OpenERPConfiguration


  private OpenERPDataFactory produceDataFactory()
  {

    final OpenERPDataFactory dataFactory = new OpenERPDataFactory();
    final OpenERPConfiguration config = mainPanel.getConfiguration();
    dataFactory.setQueryName(txtQueryName.getText());
    dataFactory.setConfig(config);
    return dataFactory;
  }
View Full Code Here


    final TypedTableModel resultSet = new TypedTableModel();

    final int queryLimit = calculateQueryLimit(parameters);
    final OpenERPHelper helper = new OpenERPHelper();
    final OpenERPConfiguration targetConfig = config.clone();
    final ArrayList<OpenERPFilterInfo> configFilters = targetConfig.getFilters();

    // Build a hashmap to pass all parameters as a dictionary to a custom OpenERP procedure
    final HashMap<String, Object> openERPParams = new HashMap<String, Object>();
    for (final String paramName : parameters.getColumnNames())
    {
View Full Code Here

    if (StringUtils.isEmpty(dataFactory.getQueryName()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "queryName", dataFactory.getQueryName());
    }

    OpenERPConfiguration config = dataFactory.getConfig();

    if (StringUtils.isEmpty(config.getHostName()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "hostName", config.getHostName());
    }

    configAttrs.setAttribute(OpenERPModule.NAMESPACE, "portNumber", Integer.toString(config.getPortNumber()));

    if (StringUtils.isEmpty(config.getDatabaseName()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "databaseName", config.getDatabaseName());
    }
    if (StringUtils.isEmpty(config.getUserName()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "userName", config.getUserName());
    }
    if (StringUtils.isEmpty(config.getPassword()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE,
          "password", PasswordEncryptionService.getInstance().encrypt(config.getPassword()));
    }
    if (StringUtils.isEmpty(config.getModelName()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "modelName", config.getModelName());
    }
    if (config.getDataSource() != null)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "dataSource", config.getDataSource().name());
    }

    if (StringUtils.isEmpty(config.getCustomFunctionName()) == false)
    {
      configAttrs.setAttribute(OpenERPModule.NAMESPACE, "customFunctionName", config.getCustomFunctionName());
    }

    xmlWriter.writeTag(OpenERPModule.NAMESPACE, "config", configAttrs, XmlWriterSupport.CLOSE);

    for (OpenERPFilterInfo filter : config.getFilters())
    {
      final AttributeList filterAttrs = new AttributeList();
      filterAttrs.setAttribute(OpenERPModule.NAMESPACE, "modelPath", filter.getModelPath());
      filterAttrs.setAttribute(OpenERPModule.NAMESPACE, "instanceNum", Integer.toString(filter.getInstanceNum()));
      filterAttrs.setAttribute(OpenERPModule.NAMESPACE, "operator", filter.getOperator());
      filterAttrs.setAttribute(OpenERPModule.NAMESPACE, "fieldName", filter.getFieldName());
      filterAttrs.setAttribute(OpenERPModule.NAMESPACE, "comparator", filter.getComparator());
      filterAttrs.setAttribute(OpenERPModule.NAMESPACE, "value", filter.getValue().toString());
      xmlWriter.writeTag(OpenERPModule.NAMESPACE, "filter", filterAttrs, XmlWriterSupport.CLOSE);
    }

    for (OpenERPFieldInfo field : config.getSelectedFields())
    {
      writeFieldInfo(xmlWriter, field);
    }

    xmlWriter.writeCloseTag();
View Full Code Here

      throw new ParseException("Required element 'config' is missing.", getLocator());
    }   

    srdf.setQueryName(configReadHandler.getQueryName());
   
    OpenERPConfiguration config = configReadHandler.getConfig();
    srdf.setConfig(config);
   
    ArrayList<OpenERPFilterInfo> filterRows = new ArrayList<OpenERPFilterInfo>();
    for (FilterReadHandler handler : filters){
      filterRows.add(handler.getFilter());
    }
    config.setFilters(filterRows);
   
    ArrayList<OpenERPFieldInfo> selectedFields = new ArrayList<OpenERPFieldInfo>();
    for (SelectedFieldReadHandler handler : selectedFieldHandlers){
      selectedFields.add(handler.getField());
    }
    config.setSelectedFields(selectedFields);
   
    dataFactory = srdf;
  }
View Full Code Here

TOP

Related Classes of com.debortoliwines.openerp.reporting.di.OpenERPConfiguration

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.