Skip to content

Commit

Permalink
[BACKLOG-38429][Add] Credit Card Validator Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mmujahiduddin committed Sep 12, 2023
1 parent bff96e1 commit a704df1
Show file tree
Hide file tree
Showing 28 changed files with 729 additions and 36 deletions.
13 changes: 13 additions & 0 deletions assemblies/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<ivw-bulk-loader-plugin.version>${project.version}</ivw-bulk-loader-plugin.version>
<edi2xml-plugin.version>${project.version}</edi2xml-plugin.version>
<random-cc-number-generator-plugin.version>${project.version}</random-cc-number-generator-plugin.version>
<credit-card-validator-plugin.version>${project.version}</credit-card-validator-plugin.version>
<mondrianinput-plugin.version>${project.version}</mondrianinput-plugin.version>
<lucid-db-streaming-loader-plugin.version>${project.version}</lucid-db-streaming-loader-plugin.version>
<gp-bulk-loader-plugin.version>${project.version}</gp-bulk-loader-plugin.version>
Expand Down Expand Up @@ -326,6 +327,18 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>credit-card-validator-plugins</artifactId>
<version>${credit-card-validator-plugin.version}</version>
<type>zip</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>mondrianinput-plugin</artifactId>
Expand Down
1 change: 0 additions & 1 deletion engine/src/main/resources/kettle-steps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
<step id="GetSubFolders"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.GetSubFolders</description> <classname>org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Input</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.GetSubFolders</tooltip> <iconfile>ui/images/LSF.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Get+SubFolder+names</documentation_url> <cases_url/> <forum_url/> </step>
<step id="MailValidator"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.MailValidator</description> <classname>org.pentaho.di.trans.steps.mailvalidator.MailValidatorMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Validation</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.MailValidator</tooltip> <iconfile>ui/images/MAV.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Mail+Validator</documentation_url> <cases_url/> <forum_url/> </step>
<step id="Mail"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.Mail</description> <classname>org.pentaho.di.trans.steps.mail.MailMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Utility</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.Mail</tooltip> <iconfile>ui/images/MAIL.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Mail+%28step%29</documentation_url> <cases_url/> <forum_url/> </step>
<step id="CreditCardValidator"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.CreditCardValidator</description> <classname>org.pentaho.di.trans.steps.creditcardvalidator.CreditCardValidatorMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Validation</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.CreditCardValidator</tooltip> <iconfile>ui/images/CCV.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Credit+card+validator</documentation_url> <cases_url/> <forum_url/> </step>
<step id="ProcessFiles"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.ProcessFiles</description> <classname>org.pentaho.di.trans.steps.processfiles.ProcessFilesMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Utility</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.ProcessFiles</tooltip> <iconfile>ui/images/PPF.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Process+files</documentation_url> <cases_url/> <forum_url/> </step>
<step id="DetectLastRow"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.DetectLastRow</description> <classname>org.pentaho.di.trans.steps.detectlastrow.DetectLastRowMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Flow</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.DetectLastRow</tooltip> <iconfile>ui/images/DLR.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Identify+last+row+in+a+stream</documentation_url> <cases_url/> <forum_url/> </step>
<step id="DetectEmptyStream"> <description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.DetectEmptyStream</description> <classname>org.pentaho.di.trans.steps.detectemptystream.DetectEmptyStreamMeta</classname> <category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Flow</category> <tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.DetectEmptyStream</tooltip> <iconfile>ui/images/EMS.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Detect+empty+stream</documentation_url> <cases_url/> <forum_url/> </step>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ BaseStep.TypeTooltipDesc.ReplaceString=Replace all occurences a word in a string
BaseStep.TypeLongDesc.MailInput=Email messages input
BaseStep.TypeTooltipDesc.MailInput=Read POP3/IMAP server and retrieve messages
BaseStep.TypeTooltipDesc.GetSubFolders=Read a parent folder and return all subfolders
BaseStep.TypeLongDesc.CreditCardValidator=Credit card validator
BaseStep.TypeLongDesc.RowFalttener=Row flattener
BaseStep.TypeLongDesc.SelectValues=Select values
BaseStep.TypeTooltipDesc.FileExists=Check if a file exists
Expand Down Expand Up @@ -287,7 +286,6 @@ BaseStep.TypeLongDesc.XMLOutput=XML output
BaseStep.TypeTooltipDesc.Janino=Calculate the result of a Java Expression using Janino
BaseStep.Log.StartingBuffersAllocation=Starting allocation of buffers & new threads...
BaseStep.ColumnName.LinesSkipped=lines_skipped
BaseStep.TypeTooltipDesc.CreditCardValidator=The Credit card validator step will help you tell\:\n(1) if a credit card number is valid (uses LUHN10 (MOD-10) algorithm)\n(2) which credit card vendor handles that number\n(VISA, MasterCard, Diners Club, EnRoute, American Express (AMEX),...)
BaseStep.TypeTooltipDesc.SortedMerge=Sorted merge
BaseStep.TypeLongDesc.SetValueField=Set field value
BaseStepDialog.ClearAndAdd=C&lear and add all
Expand Down
1 change: 1 addition & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ __List of the current core plugins:__
* ivw-bulk-loader
* edi2xml
* random-cc-number-generator
* credit-card-validator
* engine-configuration
* pur
* repositories
Expand Down
55 changes: 55 additions & 0 deletions plugins/credit-card-validator/assemblies/plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>credit-card-validator-assemblies</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
</parent>

<artifactId>credit-card-validator-plugins</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Credit Card Validator Plugins Distribution</name>
<description></description>

<dependencies>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>credit-card-validator-plugins-impl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>credit-card-validator-plugins-ui</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>add-libs</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/assembly/lib</outputDirectory>
<includeScope>compile</includeScope>
<excludeArtifactIds>credit-card-validator-plugins-impl,credit-card-validator-plugins-ui</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>random-cc-number-generator-plugin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>credit-card-validator-plugins</baseDirectory>

<files>
<file>
<source>${project.basedir}/src/main/resources/version.xml</source>
<outputDirectory>.</outputDirectory>
<filtered>true</filtered>
</file>
</files>

<fileSets>
<!-- the staging dir -->
<fileSet>
<directory>${project.build.directory}/assembly</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
</fileSets>

<dependencySets>
<dependencySet>
<outputDirectory>.</outputDirectory>
<includes>
<include>org.pentaho.di.plugins:credit-card-validator-plugins-impl:jar</include>
<include>org.pentaho.di.plugins:credit-card-validator-plugins-ui:jar</include>
</includes>
<useProjectArtifact>false</useProjectArtifact>
</dependencySet>
</dependencySets>
</assembly>


Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<version>${project.version}</version>
22 changes: 22 additions & 0 deletions plugins/credit-card-validator/assemblies/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>credit-card-validator</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
</parent>

<artifactId>credit-card-validator-assemblies</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Credit Card Validator Plugins Assemblies</name>

<modules>
<module>plugin</module>
</modules>
</project>
58 changes: 58 additions & 0 deletions plugins/credit-card-validator/impl/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>credit-card-validator</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
</parent>

<artifactId>credit-card-validator-plugins-impl</artifactId>
<name>Credit Card Validator Plugins Impl</name>

<dependencies>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-engine</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.healthmarketscience.jackcess</groupId>
<artifactId>jackcess</artifactId>
<scope>compile</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-core</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-engine</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down Expand Up @@ -49,12 +49,20 @@
import org.pentaho.di.trans.step.StepMetaInterface;
import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Node;
import org.pentaho.di.core.annotations.Step;

/*
* Created on 03-Juin-2008
*
*/

@Step( id = "CreditCardValidator", name = "BaseStep.TypeLongDesc.CreditCardValidator",
description = "BaseStep.TypeTooltipDesc.CreditCardValidator",
categoryDescription = "i18n:org.pentaho.di.trans.step:BaseStep.Category.Validation",
image = "CCV.svg",
documentationUrl = "http://wiki.pentaho.com/display/EAI/Credit+card+validator",
i18nPackageName = "org.pentaho.di.trans.steps.creditcardvalidator" )

public class CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface {
private static Class<?> PKG = CreditCardValidatorMeta.class; // for i18n purposes, needed by Translator2!!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#File generated by Hitachi Vantara Translator for package 'org.pentaho.di.trans.steps.CreditCardValidator' in locale 'en_US'
#
#
#Thu Jun 19 19:10:46 CEST 2008
BaseStep.TypeLongDesc.CreditCardValidator=Credit card validator
BaseStep.TypeTooltipDesc.CreditCardValidator=The Credit card validator step will help you tell\:\n(1) if a credit card number is valid (uses LUHN10 (MOD-10) algorithm)\n(2) which credit card vendor handles that number\n(VISA, MasterCard, Diners Club, EnRoute, American Express (AMEX),...)
CreditCardValidator.Error.ResultFieldMissing=Result fieldname is missing\!
CreditCardValidatorMeta.CheckResult.ResultFieldOK=Result fieldname is provided
CreditCardValidatorDialog.ResultField.Tooltip=Specify here the name of the result fieldname (Boolean)\nadded in the input stream
CreditCardValidatorDialog.Shell.Title=Credit card validator
CreditCardValidatorDialog.FailedToGetFields.DialogMessage=Unable to get fields from previous steps because of an error
CreditCardValidatorMeta.Exception.UnexpectedErrorReadingStepInfo=Unexpected error reading step information from the repository
CreditCardValidatorDialog.Stepname.Label=Step name
CreditCardValidator.Log.UnexpectedError=Unexpected error in ''
CreditCardValidatorDialog.CardType.Label=Credit card type field
CreditCardValidatorDialog.FieldName.Label=Credit Card field
CreditCardValidatorDialog.FailedToGetFields.DialogTitle=Get fields failed
CreditCardValidator.LineNumber=linenr {0}
CreditCardValidator.Log.StartingToRun=Starting to run...
CreditCardValidator.ErrorInStepRunning=Because of an error, this step can''t continue\:
CreditCardValidator.Log.ErrorFindingField=Error finding field\:
CreditCardValidatorMeta.Exception.UnableToSaveStepInfo=Unable to save step information to the repository for id_step\=
CreditCardValidatorMeta.CheckResult.CouldNotReadFields=Couldn''t read fields from the previous step.
CreditCardValidatorMeta.CheckResult.NoInpuReceived=No input received from other steps\!
CreditCardValidator.Exception.CouldnotFindField=Couldn''t find field ''{0}'' in row\!
CreditCardValidatorMeta.CheckResult.ReceivingInfoFromOtherSteps=Step is receiving info from other steps.
CreditCardValidatorDialog.ResultField.Label=Result fieldname
CreditCardValidator.Error.CardFieldMissing=Card number fieldname is missing\!
CreditCardValidatorMeta.CheckResult.ResultFieldMissing=Result fieldname is missing\!
CreditCardValidatorDialog.CardType.Tooltip=Specify the name of the field that contains Credit Card type.\r\nThis field will be added to the input stream.
CreditCardValidatorDialog.OutputFields.Label=Output fields
CreditCardValidatorMeta.CheckResult.ErrorOccurred=An error occurred\:
CreditCardValidatorMeta.Exception.UnableToReadStepInfo=Unable to read step information from XML
CreditCardValidatorMeta.CheckResult.CardFieldMissing=Credit Card number field name is missing\!
CreditCardValidatorMeta.CheckResult.CardFieldOK=Credit Card number field name was specified
CreditCardValidatorDialog.NotValidMsg.Label=Not valid Message
CreditCardValidatorDialog.NotValidMsg.Tooltip=Not valid Message
CreditCardValidator.Exception.ResultFieldMissing=Result fieldname is missing!
CreditCardValidator.getOnlyDigits.Label=Get only digits?
CreditCardValidator.getOnlyDigits.Tooltip=Extract only digits from credit card before checking.

CreditCardValidator.Log.NotValidVisa=Not a valid number for Visa.
CreditCardValidator.Log.NotValidMastercard=Not a valid number for Mastercard.
CreditCardValidator.Log.NotValidAmericanExpress=Not a valid number for American Express.
CreditCardValidator.Log.NotValidEnRoute=Not a valid number for En Route.
CreditCardValidator.Log.NotValidDiners=Not a valid number for Diner's CLub/Carte Blanche.
CreditCardValidator.Log.EmptyNumber=Card number cannot be blank!
CreditCardValidator.Log.CardNotValid=This card is not valid!
CreditCardValidator.Log.NotValidDiscover=Not a valid number for Discover
CreditCardValidator.Log.NotValidJcb1=Not a valid number for JCB1
CreditCardValidator.Log.NotValidJcb2=Not a valid number for JCB2
CreditCardValidator.Log.NotValidMaestro=Not a valid number for BankCard
CreditCardValidator.Log.NotValidMaestro=Not a valid number for MAESTRO
CreditCardValidator.Log.NotValidSolo=Not a valid number for SOLO
CreditCardValidator.Log.NotValidSwitch=Not a valid number for SWITCH
CreditCardValidator.OnlyNumbers=Credit card number can only contain numbers
CreditCardValidator.Log.NotValidAirplus=Not a valid AIRPLUS
CreditCardValidator.Log.NotValidLaser=Not a valid LASER
CreditCardValidator.Log.NotValidVoyager=Not a valid VOYAGER
Loading

0 comments on commit a704df1

Please sign in to comment.