Saturday 22 December 2018

Ubuntu touch (UBports)

Do you want learn how to develop applications for Ubuntu Touch (UBports) ?
Look at my collaboration with Miguel about that at :

https://mimecar.gitbook.io/qt-course/en/chapter-05-advanced

I have written the chapters about "Database access with QML" and "Qml charts" under "Advance qml Concepts" section.

Do you want start UBports Apps development ? Look at my Skeleton sample Apps:

https://github.com/fulvio999/ubports_app_templates


Do you want only use my UBports applications? Look at:

https://open-store.io/?sort=relevance&search=author%3Afulvio

(all the source code is on my GitHub repository)

Tuesday 12 May 2015

Jamesui - a web admin console for Apache James 3





What is
Jamesui is an unofficial Web admin console that I have made to manage Apache James 3.0 (a mail server written in java) ( http://james.apache.org/server/3/ ).

Why Jamesui
Some time ago i have decided to try Vaadin ( https://vaadin.com/home ) to create web applications. The best solution to learn it was create a “real case application”.
At work i have used Apache James to perform some tests, and i noticed that was missing a graphical user interface for the administration tasks....ok, that was my “real case application”.
Screenshot
Here some screenshot of Jamesui:





Quick reference
Here some little notes about jamesui features (please, for detailed informations see the pdf guide on download site, see above for the link).

After the login the available functions are divided on different panels:
Domain: allow to display the currently configured James domains, delete them or add new ones.
User: allow to display the currently configured James users , delete them, add new ones or modify his password.
Mapping: offer the necessary operations to add, delete any of the mapping types supported by James.
Mail Store: allow to configure the store used by James to save mails and other informations. To configure it is necessary install Jamesui on the same host of Apache James. After a mail store modification is necessary restart Apache James.
Note: depending on the store type chosen could be necessary add a new jar library to Apache James classpath (see James web site for more informations).
Statistics: display an instantaneous snapshot of Apache James status; update it on demand and export it to a pdf file.
Hystory statistic: show a previously saved statistic data collected using the monitoring functionality.
Monitoring: allow to schedule a monitoring job that periodically pick-up informations from James and save them to a Database (ie: MapDB).
Server configuration: allow to display and edit the Apache James server configuration (ie: the files under james/conf folder). To do this is necessary install Jamesui on the same host of James server.
(A restart of James is required) .
Product info: display in read-only mode some Jamesui informations (eg: the version of Apache james used in background and so on).
Jamesui configuration: display in read-only mode the content of the jamesui configuration files (see technical guide fo details).

Download
To download jamesui go to: https://github.com/fulvio999/jamesui

Installation and support
For more informations about the product and for technical details, please read the jamesui-tech-guide.pdf in the "Files" section on GitHub site ( https://github.com/fulvio999/jamesui/ ).

Friday 6 December 2013

AndOffline

What is
AndOffline is an open-source (GPL ) toolkit that i have done to offer some “support” tools for Android phones. His features takes advantages of existing Android Applications:

http://android.riteshsahu.com/apps/sms-backup-restore
http://android.riteshsahu.com/apps/call-logs-backup-restore

Also offers others features: "transform" your phone in a receiver to execute database stored jobs/script on the PC where is connected and running AndOffline desktop application (no internet connection is required).
Example scenario: you have a PC with a special task that when executed create a backup (or read a value form a probe). You want execute it occasionally sending an sms when you are away:

It is written in Java language, so that can run on any operating system with a valid installation of a JRE (Java Runtime Environment).

Other features: Base 64 encoder/decoder, VCF parser.

How is composed
The application is composed of two parts, both contained in the downloaded zip file: - a desktop application to install on your desktop/notebook (the .jar file) - an Android application to install on the phone (the .apk file) The desktop part can work without the Android application, but is not true the viceversa.


---------------------------------- See: --------------------------------------
https://github.com/fulvio999/Andoffline
for more informations, download and get the official PDF guide

-----------------------------------------------------------------------------------

Here some screenshots:

Wednesday 24 April 2013

My guide on slideshare.net about Maven plugin development using Modello framework


maven-properties-checker

What is
maven-properties-checker is a plugin for Apache Maven that i have done to have some validation checks at properties file (java.util.Properties) to prevent problems when you deploy the artifact.
(For more info about writing a new Apache Maven plugin see my guide on slideshare website or in the dedicated post of this blog) .

 Consider this possible scenario: you have a properties file with the connection parameters to access at a database and the “password” value have a blank space at the end (eg coming from a quick "copy and paste").
From java code the value is fetched but is not executed a “trim”; result: you can't access at the database and you must re-deploy the application.
Or, what's happen in someone forgot a value in a property value?
I know that the above errors can be avoided with a precise test-case, but using a dedicated plugin we can have some benefits, like prevent to write more code and use different checks for each properties file. The plugin contains built-in checks or allow at the user to specify a custom one based on regular expression.

Until Google code is active, you can download it from:
http://code.google.com/p/maven-properties-checker/downloads/list

After, download from:
https://github.com/fulvio999/maven-properties-checker/releases)


 How use it 

To use it declare his dependency in pom.xml of your project : 


<plugin>
         <groupId>properties.maven.plugin</groupId>
         <artifactId>maven-properties-checker</artifactId>
         <version>1.0</version>
         <executions>
               <execution>
                  <phase>compile</phase>
                  <goals>
                     <goal>check</goal>
                   </goals>
                </execution>
          </executions>
          <configuration>
               <verificationFile>src/test/verifier/property-check-input.xml</verificationFile>
          </configuration>
</plugin>
  

NOTE: It is not included in the default Maven repository, so that before use it is necessary install manually on your enterprise repository (eg Artifactory) or in the local repository (/.m2/repository).
To install in your local repository copy the jar file and his .pom (contained in the zip file that you have downloaded) file to folder:

.m2/repository/properties/maven/plugin/maven-properties-checker/1.0/ 

The input parameter “verificationFile” is an xml file (placed in the source tree of your project) containinig the checks to apply at each properties file that you provide.
To get information about theplugin usage execute:

 mvn properties.maven.plugin:maven-properties-checker:1.0:help -Ddetail=true 

The checks names to apply have a fixed name, that can be:
BLANK_VALUES: check the presence of property key without associated value, if found the build fails
EMPTY_SPACES_END: check the presence of blank space(s) at the end of a property key, if found stop the build
CUSTOM_REGEXP: apply a check based on a user defined regular expression: if the regular expression matches the build fails.
Example of input configuration file:
  
<propertyChecker>
          <checkBlock>
                <fileLocation>src/main/resources/file1.properties</fileLocation>
                <checks>
                      <check>
                              <checkName>BLANK_VALUES</checkName>
                      </check>
                      <check>
                                <checkName>EMPTY_SPACES_END</checkName>
                      </check>
                </checks>
          </checkBlock>
          <checkBlock>
                <fileLocation>src/main/resources/file2.properties</fileLocation>
                <checks>
                       <check>
                             <checkName>EMPTY_SPACES_END</checkName>
                       </check>
                       <check>
                              <checkName>CUSTOM_REGEXP</checkName>
                              <checkValue><![CDATA[ <("[^"]*"|'[^']*'|[^'">])*> ]]></checkValue>
                     </check>
               </checks>
         </checkBlock>
</propertyChecker>
 
The example input file above checks two java.util.Properties files.
At “file1.properties” are applyed two checks: BLANK_VALUES and EMPTY_SPACES_END.
While at “file2.properties” is applied only a custom check based on a custom regular expression.
Note that to use the custom check is necessary add a new node named  <checkValue> 
not necessary for the others two.
In more details the above regexp verify the presence of html tags in the “value” part of a key-value pair
(eg if we have:  myKey=testValue<div> using the above regexp the build fails).

Look my presentation on slideshare .net/
http://www.slideshare.net/slideshow/embed_code/19905023

Tuesday 20 November 2012

my-datagenerator

my-datagenerator



What is my-datagenerator

my-datagenerator is Java Swing GUI application (Operating system independent) that i have done to have an Apache DBunit GUI and a MySql data generator. His features are:
- Clean all the database tables
- Full database export as DBunit dataset
- Partial database export selecting only the tables of your interest
- Import in the database a DBunit dataset compliant with the database structure
- Obtain informations about the tables and know the right filling order that respect the FK constraints
- Random data generations to fill  Mysql 5.x databases.

Download & Installation
Source code and Download at:
https://github.com/fulvio999/my-datagenerator

To run the application the only requirement is a working installation of JRE (Java Runtime Environment).
No installation is required. Download the jar file with the "-bin" suffix (can be necessary set the execution bit on *nix systems) from the command line execute "java -jar MyDatagenerator-<version>-bin.jar"
or right click on the jar file and choose the option "Open with Java" or a similar one (depending on you Operating system).

How use use it

The first operation is set the target database providing the connection parameters in the "Target Database" panel. Also is possible enable an internal logging system based on Apache Log4j framework to trace the activity of the tool. This features is useful for debug purpose.
The generated log file will be named "mydatagenerator.log" and at each execution will be overwritten.

Follow the descriptions about the single features.

Database configuration panel



Database Cleaning panel



Allow to clean the contents of ALL the tables. In Mysql the tables with engine type "ARCHIVE" don't support the deletion operation (delete, truncate).
The user can choose if delete or not this tables marking the checkbox in the cleaning panel.
NOTE: the deletion of the ARCHIVE tables, is performed changing temporary the engine type to "InnoDB" and restoring it to "ARCHIVE" after the deletion.


Export panel



In this panel, the user can choose if export the full database content as Apache DBunit dataset or only some tables content.
In the second case, is necessary mark the table(s) to export (after loading them) and optionally customize the default export query by double clicking on it and press return to confirm the changes.
Note: there is no validations about the edited query, be careful !

The default export policy, extract all the table content. is possible extract only a subset adding a "where condition" to filter the table data.
Example 1: extract only the row with "myField" value greater than 5:

Default query: select * from myTable
Custom query: select * from myTable where myField > 5

Example 2: extract only the field "myField" :

Default query: select * from myTable
Custom query: select myField from myTable


Import Panel



Here the user can import a valid Apache DBunit dataset in the target database. Obviously the input dataset must respect the structure and data type of the destination database.


Table Utils



Display the tables contained in the databse ordered by FK (ie the filling order). That list can be exported to a text file. Selecting a table are displyed informartions about it, like his fields type and the engine type.


Data Generator



Fill the target database (previously set in Target Database panel) with random generated values. This features is useful in case of new web applications when there are no datas for the front-end part of the application.
The data are generated with the help of Apache Commons Library. For performance reasons, and to prevent possible errors caused by duplicated data, the max number of rows that can be inserted in each table in 300.
Maybe this limit can be increased without unwanted effects, but i haven't  made test to find a new limit.
Is possible customize this limit making a custom build of the application.
To change this limit, download the source code, edit the configuration file named "MyDatagenerator-conf.properties" and build with the command "mvn clean package" (you need java and Apache Maven to do this). The short solution could be edit the file directly in the jar file.
During my tests i have successfully filled a database on localhost with 85 table (with an average of 5/6 fields for each table) in [771123] ms
Important: The partitioned tables are supported by the data generator, but it can fails if there is no partitions for a generated value (ie the value can't be placed in any partitions).
This issues could be fixed adding the "ignore" condition at the insert query, but can produce problems during the database filling like table with different amount of row or (in the worst case) empty table if all generated valued cann't be placed in any partitions.

Before starting with the database filling is better empty the database, but this is not mandatory. The only unwanted effects are that the tables can contains differert amount of rows and errors caused by duplicated data, specially if the database contains a lot of data.

Tips: restart the application before try a new database filling, to reset the generators, caching...

The sql statements executed during the filling process can be logged to a specified output file.

Thursday 13 September 2012

Disconnect from SCM



Is a Nautilus script for Gnome desktop environment (available only for *nix like OS) to disconnect a source code project from a SCM (Source code management) like Subversion, CVS, Git, Mercurial.

Do you have a source code project containing the data folders about the versioning system used by the author and you want clean the source tree ? 
This is the tool for you.



More info & Download

Audio File Info

Nautilis Script for obtain information with SOXI

This is a simple Nautilis Script for Gnome desktop environment (ie available only for *nix like systems) to get informations about an audio file using the SOXI command line tool.



More info and download at: