Package org.jitterbit.plugin.sdk

Examples of org.jitterbit.plugin.sdk.DataElements


            close(out);
        }
    }

    private void extractOptions(PipelinePluginContext context) throws PipelinePluginException {
        DataElements des = context.getDataElements();
        includeTimestamp = getRequiredDataElementValue(des, "WSS.IncludeTimestamp", DataType.BOOLEAN).booleanValue();
        timeToLive = getRequiredDataElementValue(des, "WSS.TimeToLive", DataType.INTEGER).intValue();
        usePasswordDigest = getRequiredDataElementValue(des, "WSS.UsePasswordDigest", DataType.BOOLEAN).booleanValue();
        useMilliSecondPrecision = getOptionalDataElementValue(
                        des, "WSS.UseMilliSecondPrecision", DataType.BOOLEAN, Boolean.FALSE).booleanValue();
View Full Code Here


        return ret;
    }

    private void getResultData(Properties result, PipelinePluginContext context, PipelinePluginOutput output) {
      OutputFiles outputFiles = output.getOutputFiles();
      DataElements dataElements = context.getDataElements();
      String baseDir = result.getProperty(POP3Client.BASE_DIR_PROPERTY, "");
      int nAttachments = 0;
        for (String key : result.stringPropertyNames()) {
            if (isFileAttachment(key)) {
                String fileName = result.getProperty(key);
                outputFiles.add(new File(baseDir, fileName));
                dataElements.add(DataElementFactory.newDataElement(key, DataType.STRING, fileName));
                ++nAttachments;
            } else if (isOutputData(key)) {
                dataElements.add(DataElementFactory.newDataElement(key, DataType.STRING, result.getProperty(key)));
            }
        }
        dataElements.add(DataElementFactory.newDataElement("number_of_attachments", DataType.INTEGER, nAttachments));
    }
View Full Code Here

        int records_per_file = 1000;
        String field_separator = ":", array_element_separator = ";";
        int field_index = 2, array_index = 2;
        String header_record_identifier = "MSH", key_record_identifier = "PID";

        DataElements dataElements = context.getDataElements();
        if ( dataElements.contains(HEADER_DE_NAME, DataType.STRING) ) {
          header_record_identifier = dataElements.get(HEADER_DE_NAME, DataType.STRING).getValue();
        }
        if ( dataElements.contains(KEY_DE_NAME, DataType.STRING) ) {
          key_record_identifier = dataElements.get(KEY_DE_NAME, DataType.STRING).getValue();
        }
        if ( dataElements.contains(FIELD_SEPARATOR, DataType.STRING) ) {
          field_separator = dataElements.get(FIELD_SEPARATOR, DataType.STRING).getValue();
        }
        if ( dataElements.contains(ARRAY_ELEMENT_SEPARATOR, DataType.STRING) ) {
          array_element_separator = dataElements.get(ARRAY_ELEMENT_SEPARATOR, DataType.STRING).getValue();
        }
        if ( dataElements.contains(FIELD_INDEX, DataType.INTEGER) ) {
          // this is 0-based index
          field_index = dataElements.get(FIELD_INDEX, DataType.INTEGER).getValue();
        }
        if ( dataElements.contains(ARRAY_INDEX, DataType.INTEGER) ) {
          // this is 0-base index
          array_index = dataElements.get(ARRAY_INDEX, DataType.INTEGER).getValue();
        }
        if ( dataElements.contains(RECORDS_PER_FILE_DE_NAME, DataType.INTEGER) ) {
          records_per_file = dataElements.get(RECORDS_PER_FILE_DE_NAME, DataType.INTEGER).getValue();
        }

        if ( header_record_identifier.isEmpty() ) {
          throw new PipelinePluginException("No segment header was specified. Not enough information to perform splitting.");
        }
View Full Code Here

          return PluginResult.SUCCESS;
       
        // Get the variables needed to determine the maximum file size.
        String separator = ",";
        String segments = "";
        DataElements dataElements = context.getDataElements();
        if ( dataElements.contains(SEPARATOR_DE_NAME, DataType.STRING) )
          separator = dataElements.get(SEPARATOR_DE_NAME, DataType.STRING).getValue();
        if ( dataElements.contains(SEGMENTS_DE_NAME, DataType.STRING) )
          segments = dataElements.get(SEGMENTS_DE_NAME, DataType.STRING).getValue();
        if ( segments.isEmpty() ) {
          throw new PipelinePluginException("No segment list was specified. Not enough information to perform line break cleanup");
        }
       
        String[] segment_arr = segments.split(separator);
View Full Code Here

TOP

Related Classes of org.jitterbit.plugin.sdk.DataElements

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.