Thursday, August 28, 2014

Moving files into the azure cloud

Microsoft azure cloud provides SMB 2.1 file server functionality.

This is great when you need to access your files from different VM or services,
since don't need to run your own VM with the fileserver role installed.

As a bonus, you can access your files also via REST service, so your are very flexible in the usage of the service.

A introduction to the fileserver functionality can be found in this blog post.

When you have setup your service correctly, it's time to move some data to it.
The simplest approach would be to use xcopy or a similar tool to upload your files into the azure file service.

The drawback of such standard tools is, that they copy the files sequencially, one by one.
Azure is a cloud which provides massive paralell operations, so there is a faster way to get your file into the cloud.

Microsoft has released a tool named AzCopy which allows you to upload whole folders in paralell, which will speedup your uploads.

In this blog post there are more examples and use cases to bring your files into the Azure cloud.

Thursday, August 21, 2014

Using "related" fields/properties in vaadin tables with JPA containers

Vaadin is a Java framework for building modern web applications that look great, perform well and make you and your users happy.

It has a lot of features which help you in building data driven applications, without having to code everything yourself.
As with any powerfull frameworks you often come to a plcae where a "simple" thing isn't that simple to implement.
Perhaps the framework is just not prepared for that simple feature you wish to use, or you don't find the way to use it correctly.

Vaadin has containers which allow you do present data in forms and tables, without needing to code everything yourself.
There exist different types of containers, depending on your original data source, for example you can have SQL database, Bean objects and many others as a source.

With the JPA container, you can use to handle then whole data stuff with JPA.
So you could for example use hibernate or eclispelink to back your java objects in a sql database.

There is a whole chapter in the book of vaadin describing the JPA container.
When you have a object which has relations to other objects, then you can also specify the JPA container about such "related" properties or fields.
For example when you have a Person object, which has a relation to a country object, you can teel the JPA container about the additional fields available from the Country object.

// Have a persistent container
JPAContainer<Person> persons =
    JPAContainerFactory.make(Person.class, "book-examples");

// Add a nested property to a many-to-one property
persons.addNestedContainerProperty("country.name");
        
// Show the persons in a table, except the "country" column,
// which is an object - show the nested property instead
Table personTable = new Table("The Persistent People", persons);
personTable.setVisibleColumns(new String[]{"name","age",
                                           "country.name"});


// Have a nicer caption for the country.name column
personTable.setColumnHeader("country.name", "Nationality");


The Vaadin JPA container automagically knows to go via the object/database relation and retrieve the correct values.

When you use the filtering table add on available from the vaadin add ons, you can also implement filters on these additional fields.

For this you have to implement the FilterGenerator interface and then tell the table which properties are handled with this filter.
Of course your filter code must then generate the correct filter criterias.

@Override
public Container.Filter generateFilter(Object propertyId, Object value)
{
    if ("country.name".equals(propertyId))
    {
        if (value != null && value instanceof String)
        {
            return new Like("name", value.toString()+"%");
        }
    }
}


Tuesday, August 19, 2014

Free eBook about Ethernet Layer 2 encryption

You can download the free  2014 edition of Layer 2 Ethernet by Christoph Jaggi (published by inside-IT.ch) for your devices.
The book is best viewed on a tablet or computer.
Though you can tap them to expand to full size, there are many graphics which may be difficult to read on smaller devices, such as smartphones.

Go to the download page

For more about Christoph Jaggi, visit www.uebermeister.com or send an email.