Tools plugin 1.6 (including zip & unzip)

The very first plugin for Servoy now reached it’s 6th revision.

I added zip and unzip functions and a function to mirror a text.

Have fun with it and check out my second (Splash) plugin to show a splash screen…

The tools plugin now holds the following SEVENTEEN functions:

FILES
1.zip
zip a (single) file, not a folder.

2.unzip
unzip a file or a group of files, not a folder.

ENCRYPTION

  1. encrypt
    java DES encrypt a string with an optional user key.

  2. decrypt
    decrypt a string previously encrypted with the above function.

CALCULATION

  1. getMaxDay
    returns the last day of the given month.

  2. getIT2Be
    returns my name, email and GSM.

(STRING) FORMATTING

  1. dateFormat
    very much like the Java dateFormat class to convert a date to a string and the other way around with (or without) a formatting string.

  2. numberFormat
    formats the (localized) number to the formatString.

  3. secondsFormat
    to make a number of seconds a string and the other way around. formatting like HH:mm:ss.

4.Mirror
reverse a string M-^QmirrorStringM-^R into M-^QgnirtSrorrimM-^R.

VALIDATION

  1. isEmail
    based on a method I posted earlier on this forum now available in this plugin. It takes a string with one or more email adresses and checks if the format is correct.

  2. isExpired
    takes a year, month and (optional) day and returns a boolean when expired. Can be used to check the expiration date of a credit card.

  3. isInteger
    returns a boolean value, checks a string.

  4. isInRange
    takes dates, numbers/integers and strings and returns true or false.

  • dates: dates need to be set with new Date() not a db timestamp
  • string: there is an option to be set to true if you want to ignore cases
  1. isModulus10
    takes a string, filters all numbers and tells you the result of a modulus10 check. Can be used to check a credit card number.

  2. isNumber
    returns a boolean value after checking a string.

  • localized but will return false when you input thousand seperators.
  1. isTextOnly
    takes a string and returns false if it finds numbers.

The result is attached. Just drop it in your plugins folder and restart Servoy.

REMARK: When you missed version 4 please read the remarks about the old version.

Feel free to use it and distribute it but give me credit for it.
The plugin is free, provided M-^Qas isM-^R and I can not take any responsibility for the way it behaves or works.

And I would really like some feedback on (most) wanted functions. Maybe in the direction of validation…

Cheers

Hi Marcel, I wanted to try this one, but
the file you are presenting here,contains the splash-plugin!

What don’t you like my splash plugin :lol:

I was already afraid there was something wrong because things went wrong this afternoon too when I tried to build another jar.

I uploaded a new version the other minute… The old one is deleted…

Anyone using or intending to use the zip/unzip functions?

I added the following for them:

  • possibility to read/write folders
  • renaming if name exists (’ 1’, ’ 2’ etc.)
  • throw away extentions ‘.app’ (os x) and ‘.exe’ (win) when zippin’
  • always zip/unzip into the same directory (no out directory choice anymore)
  • possibility to delete original after zip/unzip

I now concider adding a window with a progressbar. Anyone happy/unhappy with this and any additional suggestions

btw the above additions are not yet released…

I am using the latest IT2BE tools plug-in (3.4-241) to zip files and folders. I am finding a problem where the zip function fails when a folder or file name contains the characters ‘app’. For example, the folder I want to zip is in the Servoy/application_server path. This fails because of the ‘app’ in application_server. If I change the name to something without ‘app’ in it then it works OK.

Could this have something to do with the above quote:

  • throw away extentions ‘.app’ (os x) and ‘.exe’ (win) when zippin’

For your information, this issue is fixed in the next release of the Tools plugin 3.4-242 which has currently been released as a Beta.